Page 1 of 1

How to keep vehicles from spawning [Solved]

Posted: Sat Aug 29, 2009 3:59 pm
by StarkillerMarek
I have been recently scripting a mission for a map I made, and I was wondering if there was a way to keep vehicles form spawning at the begining of a mission but then spawn at a later time, like the Geonosis mission. I read the campaign script for the Geonosis mission but could not figure out how to do it. Any help would be appreciated.

Re: How to keep vehicles from spawning

Posted: Sat Aug 29, 2009 4:09 pm
by Xavious
I'd think you could kill the vehicle spawn at the start of the map and respawn it when you wanted vehicles to be available.

For example

Code: Select all

KillObject("VehicleSpawnName")
Then when you wanted it back

Code: Select all

RespawnObject("VehicleSpawnName")

Re: How to keep vehicles from spawning

Posted: Sat Aug 29, 2009 4:24 pm
by StarkillerMarek
I tried that already and it didn't work. Any other suggestions?

Re: How to keep vehicles from spawning

Posted: Sat Aug 29, 2009 5:10 pm
by Maveritchell
The easiest way to do it is tie your vehicles to a control region of a command post, kill that command post at the beginning of the mission, and then respawn your command post later. KillObject and RespawnObject don't work on every object, but they do work on CPs.

Re: How to keep vehicles from spawning

Posted: Sat Aug 29, 2009 6:19 pm
by StarkillerMarek
I can't really do that. The control region is tied to a CP that I need.
Is there any other way?

Re: How to keep vehicles from spawning

Posted: Sat Aug 29, 2009 6:20 pm
by Xavious
Create an invisible CP and associate the control region and vehicle spawns with it, then use Mav's method above.

Re: How to keep vehicles from spawning

Posted: Sat Aug 29, 2009 6:22 pm
by Maveritchell
StarkillerMarek wrote:I can't really do that. The control region is tied to a CP that I need.
Is there any other way?
Make a second CP? You can always force spawn a vehicle using CreateEntity, but that is not the best solution. What is the exact circumstance you're trying to make happen?

Re: How to keep vehicles from spawning

Posted: Sat Aug 29, 2009 6:27 pm
by StarkillerMarek
Okay I don't want to reveal to much, but the first objective requires the team to defend a certain area for a certain amount of time, then after the timer(and the objective) the vehicles will spawn.

The problem I have with creating a second CP is that my new mode reads the conquest layer(which is where the vehicles and CPs are) and if I change the control zone then the other team during conquest mode cannot stop the other teams vehicles from spawning.

Re: How to keep vehicles from spawning

Posted: Sat Aug 29, 2009 6:33 pm
by Maveritchell
All you need to do is make a new CP in your layer for spawning units (instead of using that specific CP from conquest). Once you're ready to use the conquest-layer CP, kill the one you've been using and respawn the conquest one. Then you'll be able to spawn units from the objective-mode-only CP before the event and after the event you spawn units from the conquest-CP.

Re: How to keep vehicles from spawning

Posted: Sat Aug 29, 2009 10:48 pm
by StarkillerMarek
I tried what Mav said and it did not work. The CP was changed but the vehicle were still there.

Re: How to keep vehicles from spawning

Posted: Sat Aug 29, 2009 11:41 pm
by Maveritchell
StarkillerMarek wrote:I tried what Mav said and it did not work. The CP was changed but the vehicle were still there.
Then show us your lua, please, as there's a chance you made an error.

Re: How to keep vehicles from spawning

Posted: Sun Aug 30, 2009 11:42 am
by StarkillerMarek
But I don't want to reveal the whole mission to everyone, I would rather have vehicles where their not supposed to be then that.

Re: How to keep vehicles from spawning

Posted: Sun Aug 30, 2009 11:50 am
by 501st_commander
then give us the unit part

Re: How to keep vehicles from spawning

Posted: Sun Aug 30, 2009 12:02 pm
by StarkillerMarek
That doesn't have anything to do with it, does it?

Re: How to keep vehicles from spawning

Posted: Sun Aug 30, 2009 12:08 pm
by 501st_commander
yes it does, but if you have anything wrong with the script part you need to give us the entire lua

Re: How to keep vehicles from spawning

Posted: Sun Aug 30, 2009 9:06 pm
by StarkillerMarek
I figured out a workaround that worked, so I'm good.