Switching-Up Who Spawns Where

Started by Ascertes, February 04, 2016, 11:44:28 PM

Previous topic - Next topic
I'm looking to try adjusting which teams spawn at which Command Posts. In the latest map I'm working on, in the CW Era I want the (non-playable) natives spawning at a Command Post. In the GCW Era however I'd like a playable faction to use this CP instead of the natives, and the non-playable natives use the CP's that the playable team uses in the CW.

Is it possible to achieve this? I've fussed with the LUA and the only way I've been able to get it to work would be to have teams allied with each other, which I don't want to do as I want all 3 teams fighting one another. Adjusting the ScripInit functions causes the whole map to crash so that's off the table as far as I can see. This is for SWBF1. The only other thing I can think of is using Ginev's tutorial on the Layer system but that's for Bf2 so I'm not sure it will work.

As always, all help is appreciated :)
"Birth, pain, fear, death; the cycle of existence." -Dread Master Calphayus.

SWBF1 Maps: Tatooine: Mos Anek, Kashyyyk: Village, Naboo: Province, Tatooine: Gulch.

SWBF2 Maps: Space Carida.

February 05, 2016, 04:36:19 AM #1 Last Edit: February 05, 2016, 04:39:05 AM by Phobos
Quote from: Ascertes on February 04, 2016, 11:44:28 PM
I'm looking to try adjusting which teams spawn at which Command Posts. In the latest map I'm working on, in the CW Era I want the (non-playable) natives spawning at a Command Post. In the GCW Era however I'd like a playable faction to use this CP instead of the natives, and the non-playable natives use the CP's that the playable team uses in the CW.

Is it possible to achieve this? I've fussed with the LUA and the only way I've been able to get it to work would be to have teams allied with each other, which I don't want to do as I want all 3 teams fighting one another. Adjusting the ScripInit functions causes the whole map to crash so that's off the table as far as I can see. This is for SWBF1. The only other thing I can think of is using Ginev's tutorial on the Layer system but that's for Bf2 so I'm not sure it will work.

As always, all help is appreciated :)

Due to the way CP ownership is defined in ZeroEditor you will need to have 2 copies of the world LVL for this to work. Just build the map as intended for GCW and then munge it. Keep a copy of this world (example name modmap_gcw.lvl) and then edit the WLD file in notepad to change ownership to team 3. Remunge this and then name the new lvl modmap_cw.lvl

in the mission lua you want to call on the _gcw world lvl in the gcw script, and the _cw lvl for the clone wars script. I dont know how this works with layer system, but if the CP ownership information isn't contained in the WLD it might be stored in a LYR file. If you can't find it just change the ownership in zeroeditor. Keep both world files in the same folder.

Note that any CP-dependent vehicles called to spawn for the GCW faction (team 1 or 2) will not spawn for team 3 on CW. It is impossible afaik to spawn vehicles in zeroeditor for factions other than attacker/defender.

Quote from: Phobos on February 05, 2016, 04:36:19 AM
Due to the way CP ownership is defined in ZeroEditor you will need to have 2 copies of the world LVL for this to work. Just build the map as intended for GCW and then munge it. Keep a copy of this world (example name modmap_gcw.lvl) and then edit the WLD file in notepad to change ownership to team 3. Remunge this and then name the new lvl modmap_cw.lvl

in the mission lua you want to call on the _gcw world lvl in the gcw script, and the _cw lvl for the clone wars script. I dont know how this works with layer system, but if the CP ownership information isn't contained in the WLD it might be stored in a LYR file. If you can't find it just change the ownership in zeroeditor. Keep both world files in the same folder.

Note that any CP-dependent vehicles called to spawn for the GCW faction (team 1 or 2) will not spawn for team 3 on CW. It is impossible afaik to spawn vehicles in zeroeditor for factions other than attacker/defender.

Those last couple sentences just put a real damper on my day :td: I'll work with what I have, though. Gonna test this out and hopefully it will work!
"Birth, pain, fear, death; the cycle of existence." -Dread Master Calphayus.

SWBF1 Maps: Tatooine: Mos Anek, Kashyyyk: Village, Naboo: Province, Tatooine: Gulch.

SWBF2 Maps: Space Carida.

Quote from: Ascertes on February 05, 2016, 05:54:40 AM
Those last couple sentences just put a real damper on my day :td: I'll work with what I have, though. Gonna test this out and hopefully it will work!
While this isn't directly related to your map I wanted to elaborate on this specific issue in general. Maybe it's possible to edit zeroeditor to support this feature, I don't know if the limit is directly tied to the zero engine.

[spoiler]
Yeah I find this limit very disappointing, my original outline for NOTLD included a system where several local factions could be utilized to create a unique wavespawn for each wave of zombies. However since vehicles can't be assigned to native factions, if zombies are instead assigned as a primary faction, there is no control over how many zombies spawn per wave, which unit classes spawn, how many of each per wave, etc. and limited to only 5 classes.

Keeping zombies as locals offers more unit class variety but the lack of vehicle spawn really sucks because RespawnTime is only supported by CommandVehicles (which zeroeditor only allows to be assigned to primary factions). If there was a workaround to this limitation, I could use the "warlock trick" to have several respawn vehicles, one for each native faction. Then I could customize the exact number/type of zombies to spawn and keep the memory pools from being overloaded.

The only workaround idea I have would easily overload model memory online, though maybe not in SP. It would require building several underground tunnels beneath where you want the zombies to appear to "spawn" from. All the local zombies (factions 3-12, one faction per wave) would spawn at the beginning in the various tunnels and proceed to start destroying an object blocking the tunnel to ground exit. The health of these objects would be increased to simulate each wave timer, but it would not be as exact due to some variations in the AI building attack behavior.[/spoiler]

Anyway, good luck with your mod! :tu:

Quote from: Phobos on February 05, 2016, 07:21:21 AM
While this isn't directly related to your map I wanted to elaborate on this specific issue in general. Maybe it's possible to edit zeroeditor to support this feature, I don't know if the limit is directly tied to the zero engine.

[spoiler]
Yeah I find this limit very disappointing, my original outline for NOTLD included a system where several local factions could be utilized to create a unique wavespawn for each wave of zombies. However since vehicles can't be assigned to native factions, if zombies are instead assigned as a primary faction, there is no control over how many zombies spawn per wave, which unit classes spawn, how many of each per wave, etc. and limited to only 5 classes.

Keeping zombies as locals offers more unit class variety but the lack of vehicle spawn really sucks because RespawnTime is only supported by CommandVehicles (which zeroeditor only allows to be assigned to primary factions). If there was a workaround to this limitation, I could use the "warlock trick" to have several respawn vehicles, one for each native faction. Then I could customize the exact number/type of zombies to spawn and keep the memory pools from being overloaded.

The only workaround idea I have would easily overload model memory online, though maybe not in SP. It would require building several underground tunnels beneath where you want the zombies to appear to "spawn" from. All the local zombies (factions 3-12, one faction per wave) would spawn at the beginning in the various tunnels and proceed to start destroying an object blocking the tunnel to ground exit. The health of these objects would be increased to simulate each wave timer, but it would not be as exact due to some variations in the AI building attack behavior.[/spoiler]

Anyway, good luck with your mod! :tu:

Perhaps editing the CP ODF file could allow these vehicles to be used by natives? I wouldn't know as I haven't tampered with them but its just a thought.

Side Note: Would you recommend I "complete" the map before I go making the 2 different LVL files? Because the way I understand it I would have to keep making edits to 2 separate WLD files, which would be twice the work!
"Birth, pain, fear, death; the cycle of existence." -Dread Master Calphayus.

SWBF1 Maps: Tatooine: Mos Anek, Kashyyyk: Village, Naboo: Province, Tatooine: Gulch.

SWBF2 Maps: Space Carida.

Quote from: Ascertes on February 05, 2016, 09:15:35 AM
Perhaps editing the CP ODF file could allow these vehicles to be used by natives? I wouldn't know as I haven't tampered with them but its just a thought.

Side Note: Would you recommend I "complete" the map before I go making the 2 different LVL files? Because the way I understand it I would have to keep making edits to 2 separate WLD files, which would be twice the work!
Natives can use vehicles spawned by other factions if the ODF is set to this. An example is wookiees taking the clone planes on kashyyyk islands. But the vehicles can only be CP spawned by a primary faction. I don't think natives can enter command vehicles for primary factions either even if allied.

Yes I recommend building it for GCW first and then copying the WLD file when it's done to make the final CP edit. If you improve the map later you can just improve either world and then change the CP ownership again in notepad.

Well, I completed the map and followed your instructions, Phobos. And it works! Huzzah! Now to send it in for testing and hopefully have it released soon  :)
"Birth, pain, fear, death; the cycle of existence." -Dread Master Calphayus.

SWBF1 Maps: Tatooine: Mos Anek, Kashyyyk: Village, Naboo: Province, Tatooine: Gulch.

SWBF2 Maps: Space Carida.