need some help with trigger idea.
I am looking to have a unit created after 5 minutes into the game, and every 15 seconds an additional unit will be spawned, and multiplied by 2 for every player so example.
if 1 player
5 min in 1 unit 15 seconds 2 unit 15 seconds 3 unit
if 2 player
5 min in 2 unit 15 seconds 4 unit 15 seconds 6 unit
I know it would be something like
Events - Time lapse - Elapsed Time is x game seconds
-
-
Actions - Unit - Create Unit facing angle at point x
How do I keep the trigger running and creating new units with an increasing value ?
Can some one point me in the right direction for some trigger help and or guides.
Make the time elapsed trigger start a timer trigger that spawns units using a variable for the amount of units and increment the variable by the number of players in the game every the periodic trigger runs.
That not the best way really. You'll want a threaded action definition with the 5 minute wait and then a loop (forever i presume or however long you want it to run) that spawns a unit with the amount being arithmetic of 2 times a local integer. Then mod an integer after and a 15 sec wait. You don't need a local integer if your using a pick loop instead the forever.
Here is what I am looking for the trigger to do exactly, Sorry I should have been more clear.
At 5 minutes the trigger will get to work.
Every 15 seconds a new unit will be added to the amount of units that spawn starting at 1
For example , 1 unit spawns 15 seconds lapse 2 units spawn 15 seconds lapse 3...
at 15 Minute the trigger will stop.
Sorry I havent worked with triggers in a long time and trying to relearn what I have lost. ^.^
If you could quickly just arrange it in the trigger editor fashion I could understand it a bit better.
Events - Time lapse 5 minute
Locals
Actions - spawn unit
This sort of arrangement would help alot for me.
Also I am looking to make this the most resource efficient to run the trigger? I have heard that triggers that run for an extended period of time cause some maps to become sluggish.
I am largely inactive, but I am still around. Feel free to poke me if you need some help, just be warned that I only really come back if I need help and/or if I'm posting a new map/library.
That wouldn't work, the pick each play action would only run through once, and would stop at the repeat forever loop.
I've actually used while loops in a pick each units function and it worked fine, but all you really need to do otherwise is make a pick each player function in the forever loop if this is the case.
Although having the number of players in a variable as well as only running the modify variable function once is crucial, I didn't really feel it was necessary though as this was a "rough draft" if you will.
I am largely inactive, but I am still around. Feel free to poke me if you need some help, just be warned that I only really come back if I need help and/or if I'm posting a new map/library.
I have an error with the trigger but it is working properly. Can we fix the error? The error is.
00:00:15.00 Scri: Trigger Error in 'gt_Hakitmatisua_Func': Event response function 'EventUnit' has no matching event Near line 64 in gt_Hakitmatisua_Func() in MapScript.galaxy
It happens right when the trigger is fired.
Thank for you for the trigger by the way. Much appreciated.
Well first of all I thought you wanted to to start at 5 minutes? 300 seconds.
Regardless make sure you pick all players in active players, and then MOVE the repeating function out and pick all players in the repeating function.
As well, make sure you move the modification of the variable out of the pick each player in the repeating so it is only changed once.
Past that I'll have to get back to it later.
Rollback Post to RevisionRollBack
I am largely inactive, but I am still around. Feel free to poke me if you need some help, just be warned that I only really come back if I need help and/or if I'm posting a new map/library.
To post a comment, please login or register a new account.
need some help with trigger idea.
I am looking to have a unit created after 5 minutes into the game, and every 15 seconds an additional unit will be spawned, and multiplied by 2 for every player so example.
if 1 player
5 min in 1 unit 15 seconds 2 unit 15 seconds 3 unit
if 2 player
5 min in 2 unit 15 seconds 4 unit 15 seconds 6 unit
I know it would be something like
Events - Time lapse - Elapsed Time is x game seconds
-
-
Actions - Unit - Create Unit facing angle at point x
How do I keep the trigger running and creating new units with an increasing value ?
Can some one point me in the right direction for some trigger help and or guides.
Make the time elapsed trigger start a timer trigger that spawns units using a variable for the amount of units and increment the variable by the number of players in the game every the periodic trigger runs.
@Spoolofwhool: Go
That not the best way really. You'll want a threaded action definition with the 5 minute wait and then a loop (forever i presume or however long you want it to run) that spawns a unit with the amount being arithmetic of 2 times a local integer. Then mod an integer after and a 15 sec wait. You don't need a local integer if your using a pick loop instead the forever.
What does that look like in the trigger editor?
Here is what I am looking for the trigger to do exactly, Sorry I should have been more clear.
At 5 minutes the trigger will get to work.
Every 15 seconds a new unit will be added to the amount of units that spawn starting at 1
For example , 1 unit spawns 15 seconds lapse 2 units spawn 15 seconds lapse 3...
at 15 Minute the trigger will stop.
Sorry I havent worked with triggers in a long time and trying to relearn what I have lost. ^.^
If you could quickly just arrange it in the trigger editor fashion I could understand it a bit better.
Events - Time lapse 5 minute
Locals
Actions - spawn unit
This sort of arrangement would help alot for me.
Also I am looking to make this the most resource efficient to run the trigger? I have heard that triggers that run for an extended period of time cause some maps to become sluggish.
Thanks for the help in advanced
Misu - <3
I know some one has seen this thread with an answer to my post, Please a little help would be kindly appreciated.
@iMisu: Go
Umm, I think something like this:
?
That wouldn't work, the pick each play action would only run through once, and would stop at the repeat forever loop.
I would suggest doing a periodic event that works kind of like the above trigger. I'm too lazy to actually make it for u tho :( sorry
This makes me sad.
I've actually used while loops in a pick each units function and it worked fine, but all you really need to do otherwise is make a pick each player function in the forever loop if this is the case.
Although having the number of players in a variable as well as only running the modify variable function once is crucial, I didn't really feel it was necessary though as this was a "rough draft" if you will.
I have an error with the trigger but it is working properly. Can we fix the error? The error is.
00:00:15.00 Scri: Trigger Error in 'gt_Hakitmatisua_Func': Event response function 'EventUnit' has no matching event Near line 64 in gt_Hakitmatisua_Func() in MapScript.galaxy
It happens right when the trigger is fired.
Thank for you for the trigger by the way. Much appreciated.
@iMisu: Go
Well first of all I thought you wanted to to start at 5 minutes? 300 seconds.
Regardless make sure you pick all players in active players, and then MOVE the repeating function out and pick all players in the repeating function.
As well, make sure you move the modification of the variable out of the pick each player in the repeating so it is only changed once.
Past that I'll have to get back to it later.