Vehicle Spawn Delay
Moderator: Moderators
Vehicle Spawn Delay
This may seem like a stupid question, but I wish to know how to make the initial spawn of a vehicle take place after a certain ammount of time has passed. I don't mean respawn.
The situation is: I want to make an AT-TE spawn at an uncapturable commandpost after about 3 minutes of game time have passed, is it possible to do so?
I've tried searching the forums, and I'm quite confused when it comes to understanding every little bit of the documentation.
The answer to this question is probably basic and somewhere in the documentation, but I've probably missed it. :p
Thanks for the help in advance.
The situation is: I want to make an AT-TE spawn at an uncapturable commandpost after about 3 minutes of game time have passed, is it possible to do so?
I've tried searching the forums, and I'm quite confused when it comes to understanding every little bit of the documentation.
The answer to this question is probably basic and somewhere in the documentation, but I've probably missed it. :p
Thanks for the help in advance.
- Rends
- Sith
- Posts: 1278
- Joined: Fri Oct 15, 2004 6:34 pm
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
- Location: Germany
- Contact:
RE: Vehicle Spawn Delay
select the spawn_item_vehicle_ spawn and set the time in the Spawntime option box you find under object instance.
RE: Vehicle Spawn Delay
I'm pretty sure that sets the respawn only. My AT-TE spawns at the start of the game and respawns after the time specified after being destroyed.
RE: Vehicle Spawn Delay
In short, I don't think so.
- [RDH]Zerted
- Gametoast Staff
- Posts: 2982
- Joined: Sun Feb 26, 2006 7:36 am
- Projects :: Bos Wars AI - a RTS game
- xbox live or psn: No gamertag set
- Location: USA
- Contact:
RE: Vehicle Spawn Delay
Start a 3 minute timer when your map begins. When the timer ends, spawn the AT-AE. You can spawn the At-AE with CreateEntity("[vehicle odf]", [spawn location], "[object name]")
Example lua code:
Example lua code:
[vehicle spawn] should be the only thing you need to change. You don't need the "ShowTimer()", but its good to see when you are trying to get it working. The code can be improved, its just a starting point.--put this right after "ScriptPostLoad()"
ATAESpawnTimer();
--put this after ScriptPostLoad()'s "end" and before the start of "ScriptInit()"
function ATAESpawnTimer()
ATAE_timer = CreateTimer( "ATAE_timer" )
SetTimerValue( ATAE_timer, 180 )
StartTimer( "ATAE_timer" )
ShowTimer( ATAE_timer )
ATAE_elaspe = OnTimerElaspe(
function(timer)
CreateEntity( "rep_walk_atte", [vehicle spawn], "ATAE" )
end, ATAE_timer
)
end
RE: Vehicle Spawn Delay
I'm pretty sure you mean AT-TE, not AT-AE... but thanks a lot for the help.
Only problem is, I have no idea how to do the timer thing and stuff.
Edit: Very bad timing. Me posting right when you edit your post. <.<
Only problem is, I have no idea how to do the timer thing and stuff.
Edit: Very bad timing. Me posting right when you edit your post. <.<
- [RDH]Zerted
- Gametoast Staff
- Posts: 2982
- Joined: Sun Feb 26, 2006 7:36 am
- Projects :: Bos Wars AI - a RTS game
- xbox live or psn: No gamertag set
- Location: USA
- Contact:
RE: Vehicle Spawn Delay
I tested the timer out. It should work. SetTimerValue uses seconds. I haven't tested the CreateEntity(). By the examples for the scripts, it should work. I don't have the time right now to setup a map with vehicles to test that section out.
RE: Vehicle Spawn Delay
I don't think the CreateEntity() works... my map crashes when the time runs out. Oh and, you made a typo.
Shouldn't that be elapse?ATAE_elaspe = OnTimerElaspe
- [RDH]Zerted
- Gametoast Staff
- Posts: 2982
- Joined: Sun Feb 26, 2006 7:36 am
- Projects :: Bos Wars AI - a RTS game
- xbox live or psn: No gamertag set
- Location: USA
- Contact:
RE: Vehicle Spawn Delay
Yeah, I didn't directly test the timer code, I typed it up after I tested a different timer.
I was messing around with creating an infantry unit. Even when CreateEntity() didn't work, it never crashed the map. Did you add the memory for the walker? Did you remember to read in the rep_walk_atte?
You could try disabling the spawn point, then enabling it when the timer runs out instead of using CreateEntity().
I was messing around with creating an infantry unit. Even when CreateEntity() didn't work, it never crashed the map. Did you add the memory for the walker? Did you remember to read in the rep_walk_atte?
You could try disabling the spawn point, then enabling it when the timer runs out instead of using CreateEntity().
RE: Vehicle Spawn Delay
Been trying a lot of different things throughout the day. It either doesn't work, or it crashes.
Although I kinda got the AT-TE into a disabled state until the timer runs out. But that doesn't really work well, since the jedi can destroy it when it is disabled.
How to disable the spawn point? I've tried a few methods, but not none really gave the desired results. Hopefully, I'm just missing something, and this can be actually done.
Although I kinda got the AT-TE into a disabled state until the timer runs out. But that doesn't really work well, since the jedi can destroy it when it is disabled.
How to disable the spawn point? I've tried a few methods, but not none really gave the desired results. Hopefully, I'm just missing something, and this can be actually done.
- [RDH]Zerted
- Gametoast Staff
- Posts: 2982
- Joined: Sun Feb 26, 2006 7:36 am
- Projects :: Bos Wars AI - a RTS game
- xbox live or psn: No gamertag set
- Location: USA
- Contact:
RE: Vehicle Spawn Delay
This can be done, we are just trying to get it working the better way (using CreateEntity() ). CreateEntity() isn't documented, so thats why we are having problems with it.
There are many ways to do what you want. Another way would be to spawn the AT-TE under the ground on a platform. After the timer is up, run an animation which moves the platform (and thus the AT-TE) up to ground level (a simple elevator). Now reset the animation. The AT-TE will now be sitting on the ground and the platform is at its starting point to 'catch' another spawning AT-TE. You want the platform to move really fast or the players will notice the AT-TE slowing comming out of the gound. However if you make it too fast, the platform may 'jump' to ground level letting the AT-TE fall into nothingness.
You can also blow up the AT-TE on its first spawn. Then the spawn point's timer will kick in and spawn the AT-TE in 3 minutes.
Here are some CreateEntity() examples from the game code:
CreateEntity("dea_icon_disk", PlansSpawn, "plans") --spawns the flag
CreateEntity("fel1_flag_powercell", PowerCellSpawn, "powercell") --Spawns the Holocron.
CreateEntity("geo1_flag_disk", plans_spawn, "plans") --spawns the flag
CreateEntity("hot1_flag_bomb", Holocron1Spawn, "holodisk")
CreateEntity("mus_flag_bomb", bomblocation2, "bomb2") --spawns the bomb
CreateEntity("myg1_flag_crystal", Holocron1Spawn, "crystal") --spawns the disk
There are many ways to do what you want. Another way would be to spawn the AT-TE under the ground on a platform. After the timer is up, run an animation which moves the platform (and thus the AT-TE) up to ground level (a simple elevator). Now reset the animation. The AT-TE will now be sitting on the ground and the platform is at its starting point to 'catch' another spawning AT-TE. You want the platform to move really fast or the players will notice the AT-TE slowing comming out of the gound. However if you make it too fast, the platform may 'jump' to ground level letting the AT-TE fall into nothingness.
You can also blow up the AT-TE on its first spawn. Then the spawn point's timer will kick in and spawn the AT-TE in 3 minutes.
Here are some CreateEntity() examples from the game code:
CreateEntity("dea_icon_disk", PlansSpawn, "plans") --spawns the flag
CreateEntity("fel1_flag_powercell", PowerCellSpawn, "powercell") --Spawns the Holocron.
CreateEntity("geo1_flag_disk", plans_spawn, "plans") --spawns the flag
CreateEntity("hot1_flag_bomb", Holocron1Spawn, "holodisk")
CreateEntity("mus_flag_bomb", bomblocation2, "bomb2") --spawns the bomb
CreateEntity("myg1_flag_crystal", Holocron1Spawn, "crystal") --spawns the disk
RE: Vehicle Spawn Delay
I figured out how to use CreateEntity, but apparently a vehicle spawn is a too complicated thing to use. And destroying the AT-TE on its initial spawn doesn't help that much either. That crashes the level too. Maybe vehicle spawns are just too complicated.
I'll keep messing around with it today. Hopefully I will find somethng.
I'll keep messing around with it today. Hopefully I will find somethng.
- [RDH]Zerted
- Gametoast Staff
- Posts: 2982
- Joined: Sun Feb 26, 2006 7:36 am
- Projects :: Bos Wars AI - a RTS game
- xbox live or psn: No gamertag set
- Location: USA
- Contact:
RE: Vehicle Spawn Delay
How did you get CreateEntity to work?
Code: Select all
Holocron1Spawn = GetPathPoint("becon", 0)
CreateEntity("hot1_flag_bomb", Holocron1Spawn, "holodisk")
Not too hard.
- [RDH]Zerted
- Gametoast Staff
- Posts: 2982
- Joined: Sun Feb 26, 2006 7:36 am
- Projects :: Bos Wars AI - a RTS game
- xbox live or psn: No gamertag set
- Location: USA
- Contact: