I've been working to create a button that sends the next wave of units. i'm going to have 2 events for sending the wave, timer expire, and this button, but i can't figure out how to even get the button to show up, much less to program it to do anything. can anybody help me?
That will create a button. You then need to create a Global Variable as a Boolean, mine is called Player 1 Ready. You will also need to create a Global Variable as a boolean called "isSpawning". Create a new trigger.
EventDialog-AnyDialogItemisClickedbyPlayer1ActionsVariable-SetPlayer1Ready=trueUI-Display((Text(Nameofplayer(Triggeringplayer))withcolor(Color((Currentplayer(Triggeringplayer)color))))+" is Ready!")for(Allplayers)toChatarea
This trigger will run when ever player 1 clicks a dialog item and will set the Player 1 Ready boolean variable to true.
This trigger will check every 1 second of game time if the Player 1 Ready boolean variable is true. (this is from my map which is set for 4 players but this trigger is for if only player 1 is in the game) the action will run another trigger i have set to spawn a wave of units.
Timer-StartWaveTimerasaOneShottimerthatwillexpirein120.0RealTimesecondsTimer-CreateatimerwindowforWaveTimer,withthetitle"Time Until Next Wave:",usingRemainingtime(initiallyVisible)
You first need to create a Global Variable as a Timer, mine is called "Wave Timer." This will be referenced later for spawning waves.
This trigger runs when the "Wave Timer" expires or when the Dialog button is pressed. The actions will reset the timer back to 120.0 seconds and will pause it. It will reset the Player 1 Ready variable to false and the isSpawning variable to true.
This trigger checks for the conditions every 2.0 seconds of game time. If the "isSpawning" variable is true and there are no units controlled by the attacking wave computer(player 6), it will restart the "Wave Timer" and set the "isSpawning" variable to false.
What this looks like in game is:
Timer starts at 120.0 and there is a button that says "Ready!"
if the button is pressed, the Infested Terran 1 wave will attack.
as soon as that wave is spawned, the timer will be reset to 120.0 and paused there.
When there are no units left controlled by the attacking computer, the timer will start counting down from 120.0
I have multiple waves set up in my map, so if the timer reaches 0, or you press the "Ready!" button, the next wave will spawn
I think i covered everything that creates a usable button and timer. Let me know if you have any questions.
I already have my waves, timer, timer reset, and difforent waves set up the way i wanted them before you gave me this tutorial. so i'm trying to integrate it into what i've already got. but i can't get the button to show up. i put the dialoge stuff in my map initialization trigger. but i can't see the button in game.
make sure you use the action "Show/Hide Dialog", and if the button isnt showing up, there is also "Show/hide Dialog Item" as dialogs (and weirdly sometimes dialog items) always start out as hidden
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
I've been working to create a button that sends the next wave of units. i'm going to have 2 events for sending the wave, timer expire, and this button, but i can't figure out how to even get the button to show up, much less to program it to do anything. can anybody help me?
@canichols2: Go
That will create a button. You then need to create a Global Variable as a Boolean, mine is called Player 1 Ready. You will also need to create a Global Variable as a boolean called "isSpawning". Create a new trigger.
This trigger will run when ever player 1 clicks a dialog item and will set the Player 1 Ready boolean variable to true.
This trigger will check every 1 second of game time if the Player 1 Ready boolean variable is true. (this is from my map which is set for 4 players but this trigger is for if only player 1 is in the game) the action will run another trigger i have set to spawn a wave of units.
You first need to create a Global Variable as a Timer, mine is called "Wave Timer." This will be referenced later for spawning waves.
This trigger runs when the "Wave Timer" expires or when the Dialog button is pressed. The actions will reset the timer back to 120.0 seconds and will pause it. It will reset the Player 1 Ready variable to false and the isSpawning variable to true.
This trigger checks for the conditions every 2.0 seconds of game time. If the "isSpawning" variable is true and there are no units controlled by the attacking wave computer(player 6), it will restart the "Wave Timer" and set the "isSpawning" variable to false.
What this looks like in game is:
Timer starts at 120.0 and there is a button that says "Ready!"
if the button is pressed, the Infested Terran 1 wave will attack.
as soon as that wave is spawned, the timer will be reset to 120.0 and paused there.
When there are no units left controlled by the attacking computer, the timer will start counting down from 120.0
I have multiple waves set up in my map, so if the timer reaches 0, or you press the "Ready!" button, the next wave will spawn
I think i covered everything that creates a usable button and timer. Let me know if you have any questions.
I already have my waves, timer, timer reset, and difforent waves set up the way i wanted them before you gave me this tutorial. so i'm trying to integrate it into what i've already got. but i can't get the button to show up. i put the dialoge stuff in my map initialization trigger. but i can't see the button in game.
make sure you use the action "Show/Hide Dialog", and if the button isnt showing up, there is also "Show/hide Dialog Item" as dialogs (and weirdly sometimes dialog items) always start out as hidden