How to keep vehicles from spawning [Solved]
Moderator: Moderators
- StarkillerMarek
- Rebel Colonel

- Posts: 611
- Joined: Wed Aug 12, 2009 4:42 pm
- Location: I may be back.
How to keep vehicles from spawning [Solved]
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.
-
Xavious
- Sith Master

- Posts: 2783
- Joined: Mon Jun 12, 2006 3:46 pm
Re: How to keep vehicles from spawning
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
Then when you wanted it back
For example
Code: Select all
KillObject("VehicleSpawnName")Code: Select all
RespawnObject("VehicleSpawnName")- StarkillerMarek
- Rebel Colonel

- Posts: 611
- Joined: Wed Aug 12, 2009 4:42 pm
- Location: I may be back.
Re: How to keep vehicles from spawning
I tried that already and it didn't work. Any other suggestions?
- Maveritchell
- Jedi Admin

- Posts: 7366
- Joined: Mon Aug 21, 2006 11:03 pm
Re: How to keep vehicles from spawning
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.
- StarkillerMarek
- Rebel Colonel

- Posts: 611
- Joined: Wed Aug 12, 2009 4:42 pm
- Location: I may be back.
Re: How to keep vehicles from spawning
I can't really do that. The control region is tied to a CP that I need.
Is there any other way?
Is there any other way?
-
Xavious
- Sith Master

- Posts: 2783
- Joined: Mon Jun 12, 2006 3:46 pm
Re: How to keep vehicles from spawning
Create an invisible CP and associate the control region and vehicle spawns with it, then use Mav's method above.
- Maveritchell
- Jedi Admin

- Posts: 7366
- Joined: Mon Aug 21, 2006 11:03 pm
Re: How to keep vehicles from spawning
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?StarkillerMarek wrote:I can't really do that. The control region is tied to a CP that I need.
Is there any other way?
- StarkillerMarek
- Rebel Colonel

- Posts: 611
- Joined: Wed Aug 12, 2009 4:42 pm
- Location: I may be back.
Re: How to keep vehicles from spawning
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.
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.
- Maveritchell
- Jedi Admin

- Posts: 7366
- Joined: Mon Aug 21, 2006 11:03 pm
Re: How to keep vehicles from spawning
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.
- StarkillerMarek
- Rebel Colonel

- Posts: 611
- Joined: Wed Aug 12, 2009 4:42 pm
- Location: I may be back.
Re: How to keep vehicles from spawning
I tried what Mav said and it did not work. The CP was changed but the vehicle were still there.
- Maveritchell
- Jedi Admin

- Posts: 7366
- Joined: Mon Aug 21, 2006 11:03 pm
Re: How to keep vehicles from spawning
Then show us your lua, please, as there's a chance you made an error.StarkillerMarek wrote:I tried what Mav said and it did not work. The CP was changed but the vehicle were still there.
- StarkillerMarek
- Rebel Colonel

- Posts: 611
- Joined: Wed Aug 12, 2009 4:42 pm
- Location: I may be back.
Re: How to keep vehicles from spawning
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.
-
501st_commander
- Master Bounty Hunter

- Posts: 1570
- Joined: Wed Dec 10, 2008 7:48 pm
Re: How to keep vehicles from spawning
then give us the unit part
- StarkillerMarek
- Rebel Colonel

- Posts: 611
- Joined: Wed Aug 12, 2009 4:42 pm
- Location: I may be back.
Re: How to keep vehicles from spawning
That doesn't have anything to do with it, does it?
-
501st_commander
- Master Bounty Hunter

- Posts: 1570
- Joined: Wed Dec 10, 2008 7:48 pm
Re: How to keep vehicles from spawning
yes it does, but if you have anything wrong with the script part you need to give us the entire lua
- StarkillerMarek
- Rebel Colonel

- Posts: 611
- Joined: Wed Aug 12, 2009 4:42 pm
- Location: I may be back.
Re: How to keep vehicles from spawning
I figured out a workaround that worked, so I'm good.
