• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Trigger] Getting a Timer Window Title?

Status
Not open for further replies.
Level 6
Joined
Jun 1, 2006
Messages
108
Basically, I've got a timer which tells you what time of the year it is, and that year (for example January 2009). Every month lasts 30 seconds and when the month is over, it moves onto the next month. I've done all the way from September 1939 to 1946 (yes, WW2...) and I don't particularly want to have to replace it all, as it took a while.

Anyway, my problem is that with events in my map, I need the date. However some of these events depend on when other events occur, for example Neville Chamberlain resigning as Prime Minister of the UK a month after Oslo in Norway falling to German control. Events in my map look like September 17 1939 - USSR Declares War On Poland, although for these dependent events I intend them to look more like 17 September 1939 - USSR Declares War On Poland. I've managed to get the day of the month done easily when depending on the timer, however I'm have no idea how to extract the Timer Window title, so I'm stuck without the month or year.
  • Trigger
    • Events
      • Unit - A unit Changes owner
    • Conditions
      • (Owner of (Triggering unit)) Equal to Player 9 (Gray)
      • (Triggering unit) Equal to City 0525 <gen>
    • Actions
      • Wait 30.00 seconds
      • Game - Display to (All players) for 15.00 seconds the text: ((String((Remaining time for MonthTimer))) + ( + (<Empty String> + <Empty String>)))
      • Trigger - Turn off (This trigger)
Currently that is what my trigger looks like, with <Empty String> holding the gaps I have yet to fill. Any ideas how I can extract the Timer Window title to a 'Text Message' action? I'm willing to use JASS if that is my only option.
 
Level 22
Joined
Jun 24, 2008
Messages
3,050
First off, at map init, you set all the titles.
  • Melee Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set Title[1] = Something happens
      • Set Title[2] = Something else happens
      • Set Title[3] = Something happens again
Afterwards, when you need to change the title, then just change it with.
  • Lulwut
    • Events
    • Conditions
    • Actions
      • Multiboard - Change the title of (Last created multiboard) to Title[1]
Also, you could make a trigger that sets the title to raise by one, every time something happens, or such.
When you want to get the title, then just use that variable.

I hope it helps.
 
Level 6
Joined
Jun 1, 2006
Messages
108
First off, at map init, you set all the titles.
  • Melee Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set Title[1] = Something happens
      • Set Title[2] = Something else happens
      • Set Title[3] = Something happens again
Afterwards, when you need to change the title, then just change it with.
  • Lulwut
    • Events
    • Conditions
    • Actions
      • Multiboard - Change the title of (Last created multiboard) to Title[1]
Also, you could make a trigger that sets the title to raise by one, every time something happens, or such.
When you want to get the title, then just use that variable.

I hope it helps.

I know I could do that, but I really don't want to have to change all this:

  • Month Timer
    • Events
      • Time - Elapsed game time is 1.00 seconds
    • Conditions
    • Actions
      • Countdown Timer - Create a timer window for MonthTimer with title September 1939
      • Set MonthTimerWindow = (Last created timer window)
      • Countdown Timer - Start MonthTimer as a Repeating timer that will expire in 30.00 seconds
      • Wait 30.00 seconds
      • Countdown Timer - Change the title of MonthTimerWindow to October 1939
      • Wait 30.00 seconds
      • Countdown Timer - Change the title of MonthTimerWindow to November 1939
      • Wait 30.00 seconds
      • Countdown Timer - Change the title of MonthTimerWindow to December 1939
      • Wait 30.00 seconds
      • Countdown Timer - Change the title of MonthTimerWindow to January 1940
      • Wait 30.00 seconds
      • Countdown Timer - Change the title of MonthTimerWindow to February 1940
      • Wait 30.00 seconds
      • Countdown Timer - Change the title of MonthTimerWindow to March 1940
      • Wait 30.00 seconds
      • Countdown Timer - Change the title of MonthTimerWindow to April 1940
      • Wait 30.00 seconds
      • Countdown Timer - Change the title of MonthTimerWindow to May 1940
      • Wait 30.00 seconds
      • Countdown Timer - Change the title of MonthTimerWindow to June 1940
      • Wait 30.00 seconds
      • Countdown Timer - Change the title of MonthTimerWindow to July 1940
      • Wait 30.00 seconds
      • Countdown Timer - Change the title of MonthTimerWindow to August 1940
      • Wait 30.00 seconds
      • Countdown Timer - Change the title of MonthTimerWindow to September 1940
      • Wait 30.00 seconds
      • Countdown Timer - Change the title of MonthTimerWindow to October 1940
      • Wait 30.00 seconds
      • Countdown Timer - Change the title of MonthTimerWindow to November 1940
      • Wait 30.00 seconds
      • Countdown Timer - Change the title of MonthTimerWindow to December 1940
      • Wait 30.00 seconds
      • Countdown Timer - Change the title of MonthTimerWindow to January 1941
      • Wait 30.00 seconds
      • Countdown Timer - Change the title of MonthTimerWindow to February 1941
      • Wait 30.00 seconds
      • Countdown Timer - Change the title of MonthTimerWindow to March 1941
      • Wait 30.00 seconds
      • Countdown Timer - Change the title of MonthTimerWindow to April 1941
      • Wait 30.00 seconds
      • Countdown Timer - Change the title of MonthTimerWindow to May 1941
      • Wait 30.00 seconds
      • Countdown Timer - Change the title of MonthTimerWindow to June 1941
      • Wait 30.00 seconds
      • Countdown Timer - Change the title of MonthTimerWindow to July 1941
      • Wait 30.00 seconds
      • Countdown Timer - Change the title of MonthTimerWindow to August 1941
      • Wait 30.00 seconds
      • Countdown Timer - Change the title of MonthTimerWindow to September 1941
      • Wait 30.00 seconds
      • Countdown Timer - Change the title of MonthTimerWindow to October 1941
      • Wait 30.00 seconds
      • Countdown Timer - Change the title of MonthTimerWindow to November 1941
      • Wait 30.00 seconds
      • Countdown Timer - Change the title of MonthTimerWindow to December 1941
      • Wait 30.00 seconds
      • Countdown Timer - Change the title of MonthTimerWindow to January 1942
      • Wait 30.00 seconds
      • Countdown Timer - Change the title of MonthTimerWindow to February 1942
      • Wait 30.00 seconds
      • Countdown Timer - Change the title of MonthTimerWindow to March 1942
      • Wait 30.00 seconds
      • Countdown Timer - Change the title of MonthTimerWindow to April 1942
      • Wait 30.00 seconds
      • Countdown Timer - Change the title of MonthTimerWindow to May 1942
      • Wait 30.00 seconds
      • Countdown Timer - Change the title of MonthTimerWindow to June 1942
      • Wait 30.00 seconds
      • Countdown Timer - Change the title of MonthTimerWindow to July 1942
      • Wait 30.00 seconds
      • Countdown Timer - Change the title of MonthTimerWindow to August 1942
      • Wait 30.00 seconds
      • Countdown Timer - Change the title of MonthTimerWindow to September 1942
      • Wait 30.00 seconds
      • Countdown Timer - Change the title of MonthTimerWindow to October 1942
      • Wait 30.00 seconds
      • Countdown Timer - Change the title of MonthTimerWindow to November 1942
      • Wait 30.00 seconds
      • Countdown Timer - Change the title of MonthTimerWindow to December 1942
      • Wait 30.00 seconds
      • Countdown Timer - Change the title of MonthTimerWindow to January 1943
      • Wait 30.00 seconds
      • Countdown Timer - Change the title of MonthTimerWindow to February 1943
      • Wait 30.00 seconds
      • Countdown Timer - Change the title of MonthTimerWindow to March 1943
      • Wait 30.00 seconds
      • Countdown Timer - Change the title of MonthTimerWindow to April 1943
      • Wait 30.00 seconds
      • Countdown Timer - Change the title of MonthTimerWindow to May 1943
      • Wait 30.00 seconds
      • Countdown Timer - Change the title of MonthTimerWindow to June 1943
      • Wait 30.00 seconds
      • Countdown Timer - Change the title of MonthTimerWindow to July 1943
      • Wait 30.00 seconds
      • Countdown Timer - Change the title of MonthTimerWindow to August 1943
      • Wait 30.00 seconds
      • Countdown Timer - Change the title of MonthTimerWindow to September 1943
      • Wait 30.00 seconds
      • Countdown Timer - Change the title of MonthTimerWindow to October 1943
      • Wait 30.00 seconds
      • Countdown Timer - Change the title of MonthTimerWindow to November 1943
      • Wait 30.00 seconds
      • Countdown Timer - Change the title of MonthTimerWindow to December 1943
      • Wait 30.00 seconds
      • Countdown Timer - Change the title of MonthTimerWindow to January 1944
      • Wait 30.00 seconds
      • Countdown Timer - Change the title of MonthTimerWindow to February 1944
      • Wait 30.00 seconds
      • Countdown Timer - Change the title of MonthTimerWindow to March 1944
      • Wait 30.00 seconds
      • Countdown Timer - Change the title of MonthTimerWindow to April 1944
      • Wait 30.00 seconds
      • Countdown Timer - Change the title of MonthTimerWindow to May 1944
      • Wait 30.00 seconds
      • Countdown Timer - Change the title of MonthTimerWindow to June 1944
      • Wait 30.00 seconds
      • Countdown Timer - Change the title of MonthTimerWindow to July 1944
      • Wait 30.00 seconds
      • Countdown Timer - Change the title of MonthTimerWindow to August 1944
      • Wait 30.00 seconds
      • Countdown Timer - Change the title of MonthTimerWindow to September 1944
      • Wait 30.00 seconds
      • Countdown Timer - Change the title of MonthTimerWindow to October 1944
      • Wait 30.00 seconds
      • Countdown Timer - Change the title of MonthTimerWindow to November 1944
      • Wait 30.00 seconds
      • Countdown Timer - Change the title of MonthTimerWindow to December 1944
      • Wait 30.00 seconds
      • Countdown Timer - Change the title of MonthTimerWindow to January 1945
      • Wait 30.00 seconds
      • Countdown Timer - Change the title of MonthTimerWindow to February 1945
      • Wait 30.00 seconds
      • Countdown Timer - Change the title of MonthTimerWindow to March 1945
      • Wait 30.00 seconds
      • Countdown Timer - Change the title of MonthTimerWindow to April 1945
      • Wait 30.00 seconds
      • Countdown Timer - Change the title of MonthTimerWindow to May 1945
      • Wait 30.00 seconds
      • Countdown Timer - Change the title of MonthTimerWindow to June 1945
      • Wait 30.00 seconds
      • Countdown Timer - Change the title of MonthTimerWindow to July 1945
      • Wait 30.00 seconds
      • Countdown Timer - Change the title of MonthTimerWindow to August 1945
      • Wait 30.00 seconds
      • Countdown Timer - Change the title of MonthTimerWindow to September 1945
      • Wait 30.00 seconds
      • Countdown Timer - Change the title of MonthTimerWindow to October 1945
      • Wait 30.00 seconds
      • Countdown Timer - Change the title of MonthTimerWindow to November 1945
      • Wait 30.00 seconds
      • Countdown Timer - Change the title of MonthTimerWindow to December 1945
      • Wait 30.00 seconds
      • Countdown Timer - Change the title of MonthTimerWindow to Sometime past 1946
Laziness sucks.
 
Level 13
Joined
May 11, 2008
Messages
1,198
well, what i would do is convert the trigger to custom text.
then you can have your variable name[0] replace all those dates much faster, then you can replace the 0 with the appropriate number of the array. plus, before you do that, you can copy and paste those dates into your custom text trigger that sets your variables for your strings.

using lots of strings is the main thing that i use jass for, although i should probably use it for other things...this is very simple for an idiot like me and is MUCH MUCH faster than using the GUI.
 
Level 7
Joined
Jul 20, 2008
Messages
377
Wut?



You tell me.



Because there is no simple way of doing it that I have discovered?

I believe he was talking about something to this effect:

  • Set string_variable = 17 September 1939
  • Countdown Timer - Change the title of (Last created timer window) to string_variable
  • Game - Display to (All players) the text: (The date is: + string_variable)
What's not simple about that? If you need pieces of the date... use different string variables for things like day, month, year, and event description? When putting it into the timer title, concatenate it together?
 
Status
Not open for further replies.
Top