• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.
  • Notice the new look? We've updated to a new version of Xenforo, please read our latest post.

Timer not working

Maulmad

Blood Imp
Jul 9, 2018
2
0
5
34
#1
1531102686678.png


Ok so this is my current Script. My Idea is to spawn a unit at the overworld gate and have it go to the players dungeon heart after X amount of time has passed. As you can see I have a timer and then it should create the dig path then spawn the diggers then wait X amount of time and the spawn another party. Now when I test it both parties spawn at the start of match instead of after their timers. Why? and if Im doing it wrong please let me know. P.S. I know how to get them to dig and I know how to get them to attack the dungeon heart. what Im tring to figure out is how to get them to spawn at the right time after the timer count reaches 0.
 

Nutter

Frost Weaver
Founder
Jan 19, 2013
2,448
1,090
615
28
Huddersfield, UK
nutter666.tumblr.com
#2
You're not using a Timer there... SetTimerState isn't an actual timer, it's just a function to turn a (pre-created) timer on/off. That's the main mistake I see, as for why they're both spawning immediately:

OnStart happens at the start of the game and since both of your spawn unit actions are in here it's obviously all happening at the start. Instead what you want to do is use this as the trigger where you want to start your timer, but not actually spawn any units (creating the dig path here is fine though).

You then need to use a second Script and Trigger that runs when the timer ends (I think it's called OnTrigger or OnEvent? and you choose the timer ID) where all of the unit spawning stuff goes.
 

Maulmad

Blood Imp
Jul 9, 2018
2
0
5
34
#3
You're not using a Timer there... SetTimerState isn't an actual timer, it's just a function to turn a (pre-created) timer on/off. That's the main mistake I see, as for why they're both spawning immediately:

OnStart happens at the start of the game and since both of your spawn unit actions are in here it's obviously all happening at the start. Instead what you want to do is use this as the trigger where you want to start your timer, but not actually spawn any units (creating the dig path here is fine though).

You then need to use a second Script and Trigger that runs when the timer ends (I think it's called OnTrigger or OnEvent? and you choose the timer ID) where all of the unit spawning stuff goes.
Thank you because Ive been trying to figure that out. I ended up messing with it a bit and ended up using the "Wait" action and everything else works now the way i want except now they won't attack when spawned even if there is a clear path to the players dungeon heart and I have the path set up to go there. is it because I used the "Wait" action instead of the timer?
 
Top Bottom