Hello People! So im currently balls deep trying to figuring out how to make this work.
Im horrible when it comes to triggers, i havnt used it much but i got some experience
I'm trying to do a trigger that gives active players ( total of 4 ) 10 Income every 30 seconds.
But i want it to skip the first 30 second i.e start timer after 60 seconds game time and give 10 minerals, and then after that give 10 minerals ever 30 seconds.
And some sort of on screen text to notify players of income. (can probably figure this one out myself)
If anyone can write this out for me, and what I need to make this work and explain it, then i'll be VERY grateful! Ill make sure to remember it.
There are several different ways to accomplish this.
The simplest method which would work based on your description would be a single trigger with a "Periodic Event" and a condition to check if the elapsed mission time is greater than one minute. (example: Income)
However, this isn't very flexible and only works if the initial delay is a multiple of the periodic delay.
A more advanced solution would be a trigger with a while-loop that can be controlled via other triggers. The while-loop generates income and waits 30 seconds for every iteration, checking if a certain boolean variable is true. Other triggers can set this variable to false in order to stop the loop (or kill the trigger directly). The loop can be started via the "Run Trigger" action. (example: Start Income, Generate Income)
However, you have to check that only one instance of the trigger is ever running at one time, and it's also somewhat inflexible and could get messy.
A better solution would be to use a timer. You can pause, resume and restart income generation by modifying the timer. This comes with the added benefit that you can easily display a countdown on the players' screens. (example: Start Income, Generate Income)
For the on-screen notification you could do a lot of things. I personally think it would look good if you flashed a little label with the text "+10" next to the player's mineral/gas bank in the top-right corner of the screen whenever you give them resources. I created a little example of what I mean and I included the code for it in the example map I attached to this post.
Thanks alot mate! :) I now got some homework to do.....
there will be questions.. ill be back.
EDIT: Well i got it to work,thanks ALOT for the time and effort to help me out !
Only one problem, when income timer starts, a window pops up with a 30 sec timer on it,when the timer expires you get 10+ min but then another "income" window pops up, so now instead of one ive got 2 income timer windows.. which will turn into 3.4...5..6. etc...
:EDIT:EDIT: NEVERMIND! F* yeah i got it to work, so beautiful! thank you SO much man!
The simple income you made .. cant BELIEVE i didnt figure that out myself.. i know how to do that ,haha
but I'D NEVER figure out the advanced version you did with the beautiful mineral add tick.. thats so clever. ! thank you! :D
Hello People! So im currently balls deep trying to figuring out how to make this work.
Im horrible when it comes to triggers, i havnt used it much but i got some experience
I'm trying to do a trigger that gives active players ( total of 4 ) 10 Income every 30 seconds. But i want it to skip the first 30 second i.e start timer after 60 seconds game time and give 10 minerals, and then after that give 10 minerals ever 30 seconds. And some sort of on screen text to notify players of income. (can probably figure this one out myself)
If anyone can write this out for me, and what I need to make this work and explain it, then i'll be VERY grateful! Ill make sure to remember it.
Thanks!
There are several different ways to accomplish this.
The simplest method which would work based on your description would be a single trigger with a "Periodic Event" and a condition to check if the elapsed mission time is greater than one minute. (example: Income)
However, this isn't very flexible and only works if the initial delay is a multiple of the periodic delay.
A more advanced solution would be a trigger with a while-loop that can be controlled via other triggers. The while-loop generates income and waits 30 seconds for every iteration, checking if a certain boolean variable is true. Other triggers can set this variable to false in order to stop the loop (or kill the trigger directly). The loop can be started via the "Run Trigger" action. (example: Start Income, Generate Income)
However, you have to check that only one instance of the trigger is ever running at one time, and it's also somewhat inflexible and could get messy.
A better solution would be to use a timer. You can pause, resume and restart income generation by modifying the timer. This comes with the added benefit that you can easily display a countdown on the players' screens. (example: Start Income, Generate Income)
For the on-screen notification you could do a lot of things. I personally think it would look good if you flashed a little label with the text "+10" next to the player's mineral/gas bank in the top-right corner of the screen whenever you give them resources. I created a little example of what I mean and I included the code for it in the example map I attached to this post.
@temhawk: Go
Thanks alot mate! :) I now got some homework to do..... there will be questions.. ill be back.
EDIT: Well i got it to work,thanks ALOT for the time and effort to help me out !
Only one problem, when income timer starts, a window pops up with a 30 sec timer on it,when the timer expires you get 10+ min but then another "income" window pops up, so now instead of one ive got 2 income timer windows.. which will turn into 3.4...5..6. etc...
:EDIT:EDIT: NEVERMIND! F* yeah i got it to work, so beautiful! thank you SO much man!
The simple income you made .. cant BELIEVE i didnt figure that out myself.. i know how to do that ,haha but I'D NEVER figure out the advanced version you did with the beautiful mineral add tick.. thats so clever. ! thank you! :D