Right, well I've got a Voting trigger, and I'm trying to get the two options to show how many voted for the choice.
What I'm doing is a simple code which checks which integer is greater out of the two, after the voting session ends.
Each vote adds 1+ to the selected choice, which adds 1 to the integer. I was trying to make it reset the text of the counter on the dialog items to the numbers in the Integer.
Would anyone know how to do this? I've seen it done on other maps for Voting sessions, but I was trying to make my own before coming to SC2Mapster.
Also, how would I make a timer in the dialog to show how many seconds is left until the session is over??
Right, my voting system works perfectly.
Now it's time for cosmetics.
I've got everything working except the two buttons and the timer, I have no clue how to do it.
Here is my Code so far, I use the pre-made triggers. Variable Votes1 and Votes2 are the buttons, and the Timer doesn't appear at all.
Dialog - Create a Modal dialog of size (850, 850) at (0, 0) relative to Center of screen
Variable - Set SkipCinematic = (Last created dialog)
Dialog - Show SkipCinematic for (All players)
Dialog - Create a label for dialog (Last created dialog) with the dimensions (200, 200) anchored to Top Left with an offset of (310, 100) with the text "Welcome to City of Horrors. It's a ..." color set to White text writeout set to True with a writeout duration of 1.5
Variable - Set SkipCinematicText = (Last created dialog item)
General - Wait 6.0 Game Time seconds
Dialog - Set SkipCinematicText text to "You may now Vote." for (All players)
Dialog - Create a button for dialog (Last created dialog) with the dimensions (200, 100) anchored to Top Left with an offset of (100, 500) setting the tooltip to "" with button text "Watch" and the hover image set to ""
Variable - Set WatchCinematicChoice = (Last created dialog item)
Dialog - Create a button for dialog (Last created dialog) with the dimensions (200, 100) anchored to Top Left with an offset of (550, 500) setting the tooltip to "" with button text "Skip" and the hover image set to ""
Variable - Set SkipCinematicChoice = (Last created dialog item)
Dialog - Create a button for dialog (Last created dialog) with the dimensions (50, 50) anchored to Top Left with an offset of (150, 600) setting the tooltip to "" with button text "" and the hover image set to ""
Variable - Set Votes1 = (Last created dialog item)
Dialog - Hide (Last created dialog item) for (All players)
Dialog - Create a button for dialog (Last created dialog) with the dimensions (50, 50) anchored to Top Left with an offset of (600, 600) setting the tooltip to "" with button text "" and the hover image set to ""
Variable - Set Votes2 = (Last created dialog item)
Dialog - Hide (Last created dialog item) for (All players)
UI - Show the mouse cursor for (All players).
Timer - Start (New timer) as a One Shot timer that will expire in 15.0 Game Time seconds
Timer - Move (Last created timer window) to (310, 700)
Timer - Show (Last created timer window) for (All players)
General - Wait 15.03 Game Time seconds
Timer - Destroy (Last created timer window)
Trigger - Run VotingCount (Check Conditions, Don't Wait until it finishes)
This is the design I'd like to make, I came to SC2Mapster for the Votes1 and Votes2 Variable, and the Timer issue. Everything else works perfectly.
You didn't make a timer window, thats why your timer isn't showing. To show the amount votes in the dialog item clicked trigger which modify the vote variable (which i know you have because it is necessary for this), add a function that sets vote 1's text to the number of votes. Ex: set Vote 1 text to (text(number of votes)) for all players.
I was headed in the right direction with my first attempt, however I had no clue there was a Covert Integer to Text. When somebody mentioned it, I blew it off until you mentioned it using the small example. Thanks!
Now I just need to make the timer.... hmmm.
Like I said, right direction... but.... I pass some things over my head.
I've got a dialog item's text I want to change to an Integer's value. How would I achieve this?
You can't change text to an integer, however you can change an integer to text with the convert integer to text function.
Still alive and kicking, just busy.
My guide to the trigger editor (still a work in progress)
Do you know how "Combine text" and "Convert integer into text" triggrs work? I'm not sure does it cause more problems with "dialog item".
If you are not familiar with these already this may help you: http://www.sc2mapster.com/forums/resources/tutorials/12560-trigger-how-to-link-variable-into-mission-objective/
Tutorial is about mission objective but may help you with dialog item too.
Right, well I've got a Voting trigger, and I'm trying to get the two options to show how many voted for the choice.
What I'm doing is a simple code which checks which integer is greater out of the two, after the voting session ends. Each vote adds 1+ to the selected choice, which adds 1 to the integer. I was trying to make it reset the text of the counter on the dialog items to the numbers in the Integer.
Would anyone know how to do this? I've seen it done on other maps for Voting sessions, but I was trying to make my own before coming to SC2Mapster.
Also, how would I make a timer in the dialog to show how many seconds is left until the session is over??
@Alnatair: Go
set text of dialog item action.
Still alive and kicking, just busy.
My guide to the trigger editor (still a work in progress)
Right, my voting system works perfectly. Now it's time for cosmetics.
I've got everything working except the two buttons and the timer, I have no clue how to do it. Here is my Code so far, I use the pre-made triggers. Variable Votes1 and Votes2 are the buttons, and the Timer doesn't appear at all.
Dialog - Create a Modal dialog of size (850, 850) at (0, 0) relative to Center of screen
Variable - Set SkipCinematic = (Last created dialog)
Dialog - Show SkipCinematic for (All players)
Dialog - Create a label for dialog (Last created dialog) with the dimensions (200, 200) anchored to Top Left with an offset of (310, 100) with the text "Welcome to City of Horrors. It's a ..." color set to White text writeout set to True with a writeout duration of 1.5
Variable - Set SkipCinematicText = (Last created dialog item)
General - Wait 6.0 Game Time seconds
Dialog - Set SkipCinematicText text to "You may now Vote." for (All players)
Dialog - Create a button for dialog (Last created dialog) with the dimensions (200, 100) anchored to Top Left with an offset of (100, 500) setting the tooltip to "" with button text "Watch" and the hover image set to ""
Variable - Set WatchCinematicChoice = (Last created dialog item)
Dialog - Create a button for dialog (Last created dialog) with the dimensions (200, 100) anchored to Top Left with an offset of (550, 500) setting the tooltip to "" with button text "Skip" and the hover image set to ""
Variable - Set SkipCinematicChoice = (Last created dialog item)
Dialog - Create a button for dialog (Last created dialog) with the dimensions (50, 50) anchored to Top Left with an offset of (150, 600) setting the tooltip to "" with button text "" and the hover image set to ""
Variable - Set Votes1 = (Last created dialog item)
Dialog - Hide (Last created dialog item) for (All players)
Dialog - Create a button for dialog (Last created dialog) with the dimensions (50, 50) anchored to Top Left with an offset of (600, 600) setting the tooltip to "" with button text "" and the hover image set to ""
Variable - Set Votes2 = (Last created dialog item)
Dialog - Hide (Last created dialog item) for (All players)
UI - Show the mouse cursor for (All players).
Timer - Start (New timer) as a One Shot timer that will expire in 15.0 Game Time seconds
Timer - Move (Last created timer window) to (310, 700)
Timer - Show (Last created timer window) for (All players)
General - Wait 15.03 Game Time seconds
Timer - Destroy (Last created timer window)
Trigger - Run VotingCount (Check Conditions, Don't Wait until it finishes)
This is the design I'd like to make, I came to SC2Mapster for the Votes1 and Votes2 Variable, and the Timer issue. Everything else works perfectly.
You didn't make a timer window, thats why your timer isn't showing. To show the amount votes in the dialog item clicked trigger which modify the vote variable (which i know you have because it is necessary for this), add a function that sets vote 1's text to the number of votes. Ex: set Vote 1 text to (text(number of votes)) for all players.
Still alive and kicking, just busy.
My guide to the trigger editor (still a work in progress)
I was headed in the right direction with my first attempt, however I had no clue there was a Covert Integer to Text. When somebody mentioned it, I blew it off until you mentioned it using the small example. Thanks!
Now I just need to make the timer.... hmmm.
Like I said, right direction... but.... I pass some things over my head.
How would I create a Timer like mentioned in the design?