2 layer problems

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
MandeRek
Sith Master
Sith Master
Posts: 2766
Joined: Tue Oct 02, 2007 10:51 am
Projects :: Battlefront Zer0
Games I'm Playing :: SWTOR
xbox live or psn: No gamertag set
Location: Ghosting around GT
Contact:

2 layer problems

Post by MandeRek »

Okay, i wanted to add a layer to another lvl world/munged world.. The layer is base, in LAY.lvl.

It loaded like everyother layer. Now both layers seem to showup, only it seems that my cp-props of the original world have dissapeared; all units spawn somewhere very weird and occasionally, die!! Anyone got an idea how to add my objects to another world without messing it up? I tried replacing objects through lua, but i got stuck on 2 things:

- Couldn't find the name of the object to replace
- Didn't know how to do this through scripting

Any help would be VERY welcome since i REALLY need this.. thanks :)
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: 2 layer problems

Post by [RDH]Zerted »

I'm not sure how you can find all the objects in your map (maybe hex editing), but you may be able to disable all the other CPs. Just read the scripting system doc. Command posts have labels, capture regions, control regions, and spawn paths (among many other things). Use any of the CP event callbacks to get a reference to CP object, then use SetProperty() or other functions to kill it.

If you are able to print out the CP names, then you can just add those killing functions to your final map (You will have to play through it at least once with all the extra CP event handling to grab all the CP references).

Edit:
Oh, there is a easier way to get the CP names and other info. Assuming its a map where the CPs are in the lua (like Conquest), then use the v1.3 patch's Print Globals Nested command. Its a real pain to shift through its 37,749+ lines of game variables, but the CP names will be in there. Searching for "commandPosts" might help you find them faster. You are looking for something similar to this:
Hidden/Spoiler:
[code]0: Key, Value: conquest table: 03DD1A8C
1: Key, Value: AIGoalWeight 1
1: Key, Value: teamATT 1
1: Key, Value: multiplayerRules true
1: Key, Value: timeLimitWinningTeam 1
1: Key, Value: usingGameOptionsTimeLimit 0
1: Key, Value: textDEF game.modes.con2
1: Key, Value: teamDEF 2
1: Key, Value: textATT game.modes.con
1: Key, Value: AIGoals table: 03DD1B6C
2: Key, Value: 1 userdata: 053D871C
2: Key, Value: 2 userdata: 053D8758

1: Key, Value: disallowDefensiveVictory false
1: Key, Value: timeLimit 0
1: Key, Value: defeatTimer userdata: 0598B0B8
1: Key, Value: isComplete false
1: Key, Value: winningTeam 0
1: Key, Value: bleedTimer table: 03DD1B4C
2: Key, Value: 1 userdata: 0598B060
2: Key, Value: 2 userdata: 0598B08C

1: Key, Value: commandPosts table: 03DD1AAC
2: Key, Value: cp3 table: 03DD1A2C
3: Key, Value: name cp3

2: Key, Value: cp4 table: 03DD1A4C
3: Key, Value: name cp4

2: Key, Value: cp1 table: 03DD19EC
3: Key, Value: name cp1

2: Key, Value: cp5 table: 03DD1A6C
3: Key, Value: name cp5

2: Key, Value: cp2 table: 03DD1A0C
3: Key, Value: name cp2


1: Key, Value: totalBleedValue table: 03DD1B2C
2: Key, Value: 1 50
2: Key, Value: 2 50


0: Key, Value:[/code]
MandeRek
Sith Master
Sith Master
Posts: 2766
Joined: Tue Oct 02, 2007 10:51 am
Projects :: Battlefront Zer0
Games I'm Playing :: SWTOR
xbox live or psn: No gamertag set
Location: Ghosting around GT
Contact:

Re: 2 layer problems

Post by MandeRek »

Okay, that's for cps.. Now say i wanna replace a CP by scripting/lua, for another object out off a side..

Can someone give me a clear explanation how to do that?
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: 2 layer problems

Post by Teancum »

Well, that's gonna be a lot more complex. You can use SetProperty for a lot of it, but I don't know that you can change the class from "controlzone" to something else using it. It's worth a shot.
MandeRek
Sith Master
Sith Master
Posts: 2766
Joined: Tue Oct 02, 2007 10:51 am
Projects :: Battlefront Zer0
Games I'm Playing :: SWTOR
xbox live or psn: No gamertag set
Location: Ghosting around GT
Contact:

Re: 2 layer problems

Post by MandeRek »

Teancum wrote:Well, that's gonna be a lot more complex. You can use SetProperty for a lot of it, but I don't know that you can change the class from "controlzone" to something else using it. It's worth a shot.
Isn't there a way to replace an odf from a same-named odf from another side?

I need to replace the odf, but in that side's odf there's also linked to other meshes ofcourse, i need to replace the whole thing..

There must be a way besides SetProperty lines..
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: 2 layer problems

Post by Teancum »

Well, typically speaking whichever lvl gets loaded first will overwrite stuff in the second, but they have to be named the same.

So theoretically you could do:
ReadDataFile("DC://123/NEW/123.lvl")
ReadDataFile("DC://123/123.lvl")

And load your updated odfs in the top lvl.
MandeRek
Sith Master
Sith Master
Posts: 2766
Joined: Tue Oct 02, 2007 10:51 am
Projects :: Battlefront Zer0
Games I'm Playing :: SWTOR
xbox live or psn: No gamertag set
Location: Ghosting around GT
Contact:

Re: 2 layer problems

Post by MandeRek »

Teancum wrote:Well, typically speaking whichever lvl gets loaded first will overwrite stuff in the second, but they have to be named the same.

So theoretically you could do:
ReadDataFile("DC://123/NEW/123.lvl")
ReadDataFile("DC://123/123.lvl")

And load your updated odfs in the top lvl.
Does that count for position as well?! Okay, I'll definetaly give this a go, thanks for explaining..
Post Reply