Space map lua question.

In this forum you will find and post information regarding the modding of Star Wars Battlefront 2. DO NOT POST MOD IDEAS/REQUESTS.

Moderator: Moderators

Post Reply
PvtParts
Jedi
Jedi
Posts: 1001
Joined: Mon Apr 03, 2006 9:12 pm
Projects :: No Mod project currently.
xbox live or psn: No gamertag set
Location: plundering yer booty

Space map lua question.

Post by PvtParts »

How can I completely remove all traces of the assault gameplay from a space map?

I want to get rid of all objectives, so its basically just a deathmatch sort of thing. I have thus far been unsuccessful, and any attempts to delete the objective-object (from ZE) and remove the associated lua code have caused CTD.

I am using custom sides, but was able to set those up entirely (all units/vehicles ingame) prior to any crashing issues. Same goes for the associated custom sounds. And the extra capital ships and stuff. Just need to completely get rid of the objective-assault stuff and make it deathmatch.

Sooner I can get this done the sooner we can have a Space Battle of Naboo map.....

Parts
User avatar
trainmaster611
Sith Lord
Sith Lord
Posts: 1779
Joined: Thu Aug 24, 2006 5:22 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: Building a railway to Coruscant
Contact:

Re: Space map lua question.

Post by trainmaster611 »

If you leave the objectives in the LUA but delete the critical systems in ZE, the map will still work. The only problem is that the objectives will still appear when you press M. If you run BF2_Modtools, it will give you some MS2's saying that it could not find the specified object. But the map will still work fine.
MercuryNoodles
Jedi
Jedi
Posts: 1003
Joined: Sun Mar 12, 2006 7:16 pm
Projects :: Space - Boarding Action
xbox live or psn: No gamertag set

Re: Space map lua question.

Post by MercuryNoodles »

This may be unnecessary, but I have an idea:

Be sure to take out anything to do with SetupObjectives in the XXXx_Diet Dr. Pepper.lua (the cmn lua can be left alone), meaning both the line under function ScriptPostLoad(), and the entire block of code dealing with function SetupObjectives(). I've never tried this myself, but that should cut it out cleanly, and you'll still have the turret mainframe, destroyables, and shield code functional, unless you want that out as well.

Then, try setting your lua up for deathmatch by copying over what's needed from a hero assault lua. (the stuff above ScriptInit) Replace stuff as necessary, and fill in for anything missing.

Again, I've never done this, but it's a nudge in the right direction, I think. I think the reason you get a crash is because you didn't change the dofile call, so it's still loading the space assault script, therefore expecting SetupObjectives to be there, so it's crashing when it finds the code missing. I looked at the main scripts, and there may be more to it. So, definately report back on what happened, what else you tried, etc. I'm sure someone here would be able to help further, if it's much more complex than this.



Or you could use trainmaster's suggestion and forget about all of this. :P I'd only really try this if you want to actually work on the code and make it look pretty, professional, etc. :cpu: Good luck!
FragMe!
Gametoast Staff
Gametoast Staff
Posts: 2244
Joined: Sat May 13, 2006 12:34 am
Projects :: Not sure keep changing my mind.
Games I'm Playing :: F1 and SWBF
xbox live or psn: No gamertag set
Location: Origin name GT_FragMe
Contact:

Re: Space map lua question.

Post by FragMe! »

In ZE try setting "team" for each objective object to 0 instead of 1 or 2 on the associated Ships layer for both modes. For example all_drive_1 is one of the engine targets setting it to 0 makes it not a target anymore by either team.

That may help, just don't change things you need like vehicle spawn points :D
PvtParts
Jedi
Jedi
Posts: 1001
Joined: Mon Apr 03, 2006 9:12 pm
Projects :: No Mod project currently.
xbox live or psn: No gamertag set
Location: plundering yer booty

Re: Space map lua question.

Post by PvtParts »

If you leave the objectives in the LUA but delete the critical systems in ZE, the map will still work. The only problem is that the objectives will still appear when you press M. If you run BF2_Modtools, it will give you some MS2's saying that it could not find the specified object. But the map will still work fine.
I get a crash when I delete the objectives (ie comm array, engine, etc) from the map.

I also get a crash when I delete the code. However, I am not to good with lua so I may be deleting something I shouldn't be/not deleting enough.

I guess I was looking for more a specific tutorial on how to get a space map to work in a deathmatch-like function.
FragMe!
Gametoast Staff
Gametoast Staff
Posts: 2244
Joined: Sat May 13, 2006 12:34 am
Projects :: Not sure keep changing my mind.
Games I'm Playing :: F1 and SWBF
xbox live or psn: No gamertag set
Location: Origin name GT_FragMe
Contact:

Re: Space map lua question.

Post by FragMe! »

One of the better things to do, and I do it all the time is make a junk map and test things out on there, that way if things get buggered up it doesn't make you go :faint:

and if everything does go south well delete and make another junk one.
MercuryNoodles
Jedi
Jedi
Posts: 1003
Joined: Sun Mar 12, 2006 7:16 pm
Projects :: Space - Boarding Action
xbox live or psn: No gamertag set

Re: Space map lua question.

Post by MercuryNoodles »

Like I said, I think simple deletion is what's the problem. I don't think anyone's tried this, so I doubt there's a clear tutorial, unfortunately.
User avatar
[RDH]Zerted
Gametoast Staff
Gametoast Staff
Posts: 2982
Joined: Sun Feb 26, 2006 7:36 am
Projects :: Bos Wars AI - a RTS game
Games I'm Playing :: SWBF2 and Bos Wars
xbox live or psn: No gamertag set
Location: USA
Contact:

Re: Space map lua question.

Post by [RDH]Zerted »

I'd say you only need ScriptPostLoad(), ScriptPreInit(), and ScriptInit().

In ScriptInit() replace the SetupUnits() and SetupTeams() with the 'normal' way to setup teams and units. Remove the myScriptInit section. Leave ScriptPreInit() alone. Clear out ScriptPostLoad(). Put your conquest/deathmatch code in it. You can have all your code in XXXx_Diet Dr. Pepper.lua. Make sure to update any ScriptCBs and any ReadDataFiles function calls. Remove XXXx_cmn from any req files. Don't forget to update the ReadDataFile line with myGameMode in it.

If you want extras, such as shield and linked turrets, I would recommend removing them first and making sure the map works without them. Then slowly add their code back to the script. If your map is crashing, you should add debug statements in it, so you can see what your code is really doing ( Example: print("ScriptInit() - Finished setting up memory pools") )

Disclamer: I've never made a space map.
PvtParts
Jedi
Jedi
Posts: 1001
Joined: Mon Apr 03, 2006 9:12 pm
Projects :: No Mod project currently.
xbox live or psn: No gamertag set
Location: plundering yer booty

Re: Space map lua question.

Post by PvtParts »

Alright. Im bogged down with AP work for this week but come this weekend I'll let ya'll know.

A sort-of off topic question that would let me get around the code stuff (cause if there's anything I don't like screwing around with its the lua): If I munge a conquest map, then redo the terrain (so basically all the preset textures/objects are gone and you just have a black grid) would that work in space mode (keep the black grid and just add objects etc)?

I will probably give that a try. :cpu:
User avatar
Teancum
Jedi Admin
Jedi Admin
Posts: 11080
Joined: Wed Sep 07, 2005 11:42 pm
Projects :: No Mod project currently.
Games I'm Playing :: Destiny
xbox live or psn: No gamertag set
Location: Indiana

Re: Space map lua question.

Post by Teancum »

I've got Team Dogfight in the SWBF Conversion Pack. I'll up the scripts later tonight so you can look at it.
Post Reply