• 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.

How to create a calendar for Wc3 map

Status
Not open for further replies.
Level 3
Joined
Apr 3, 2019
Messages
48
Hello all. This my first post on the Hive so if I did something wrong or stupid apologies. I am trying to... basically just have my integer variable reduce by 1 in value every time an event happens. Sounded simple at first, but I've tried 100 different ideas and so far nothing.

Here's a list of my trigger's actions of my first attempt (couldn't upload screenshot I guess) which I recreated after maddeningly adding and removing triggers I thought would do the trick. I am trying to create a calendar system for my map. The goal of this was so that I could create another trigger later on which would... say it would be told to wait until the integer value was at value/day 7 (7 days b4 New Year) and maybe do like a Christmas event for the map or something like that, or maybe change the weather depending on the season, so like, all days from 365 (err January 1st? -- w/e) to Spring (lets say day 300 is start of Spring) would be light snow or heavy rain or something and then day 299 would dry up a little or have light showers or something idk.

When Calendar is typed as a chat string, the leaderboard I created pops up and displays the # of days left in the year. So I made an integer with initial value of 365, told it to decrease by 1 every time a new day happens and ideally this was suppose to make the number in the leader board decrease by 1 every midnight in game time. As of right now... the triggers work up to the very first day, setting days left in the year to 364. However, it stops after that and stays stuck at 364. The only thing that seems to make sense is that, my arithmetic on 2nd trigger is reseting the initial value of my integer variable to 365 EVERY SINGLE TIME... -1. Thus, I'm stuck at 364 =( Anyone got any ideas? I'd much appreciate. Oh and -- I know that once it hits zero I need to tell it to reset to 365 for new year;P I just don't want to touch that till I get this other part working 1st.

Event
Game - the in-game time of day becomes Equal to 24.00

Actions
Set Day_Of_Year (Integer) = (Day_Of_Year -1)
Leaderboard - Change the value for Player 1 (Red) in last created leaderboard to Day_Of_Year


Didn't post the other trigger which just a basic setup for my leaderboard, but can if necessary.
 
Last edited:
my arithmetic on 2nd trigger is reseting the initial value of my integer variable to 365 EVERY SINGLE TIME
You probably just answered it yourself, that this is the reason. But why do you reset it? If resetting is not wanted, you should not do that. If you need some temporary same value, maybe an other/new integer variable might help out.
 
Level 3
Joined
Apr 3, 2019
Messages
48
You probably just answered it yourself, that this is the reason. But why do you reset it? If resetting is not wanted, you should not do that. If you need some temporary same value, maybe an other/new integer variable might help out.


Thanks for the help IcemanBo, but I cannot figure out how to make the Integer value temporary in the first place. I've tried adding another Integer, but its value stays the same as well, so that doesn't change anything. I may as well be telling the new integer to be equal to 365-1 every time. You can change the value of any integer once it seems, but if you try to reference it again then it always returns to its initial value no matter what. When I try to store the new 364 value as the current value by setting the old variable equal to the new variable -1, it just ignores that and switches the variable back to its initial value. For example, I tried this:

Events
Game - The in-game time of day becomes Equal to 24.00

Actions
Set Day_Of_Year_2 = (Day_Of_Year - 1)
Set Day_Of_Year = Day_Of_Year_2
Leaderboard - Change the value for Player 1 (Red) in Calendar to Day_Of_Year





Its dumb because when they reset initial value every time then it doesn't make sense to even call them "variables". How is it a variable if its value is permanent?
 
Last edited:
Level 45
Joined
Feb 27, 2007
Messages
5,578
Variables do work exactly how you expect they should. if they didn't, everyone here would know about it already. It's literally as simple as this:
  • Set Day_Of_Year = (Day_Of_Year - 1)
  • -------- Update visually --------
Perhaps the problem is more that you're using a leaderboard when you should be using a multiboard.
 
Level 3
Joined
Apr 3, 2019
Messages
48
Hey Pyrogasm. I get what your saying, but it just doesn't seem to be working for me. I'll admit I've never really used Multiboards before, but judging by looking at them, I cannot really see a way to input an integer value into them. I tried converting integer to string when setting their textual value, but that just seemed to remove the row in game. Also, I just don't understand why it would work for a multiboard and not also a leaderboard.

Here is what I've been working on so far. I've also had some success working with real variables as you can set a destructible's current AND max health to whatever you want and it actually seems to perform the way I want it to (Although it requires having a destructible in the map which is changing health value every 24 in game hours only to reset b4 it dies which is a bit annoying).

I recreated my initial triggers too because I would like to figure this out if possible. I changed the value so it starts at 0 and goes up this time instead of down from 365, but ultimately the problem is the same.

  • Create Board
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Leaderboard - Create a leaderboard for (All players) titled Calendar
      • Set Calendar = (Last created leaderboard)
      • Leaderboard - Add Player 1 (Red) to Calendar with label Day and value Days_Of_Year
      • Leaderboard - Show Calendar
  • Change Board
    • Events
      • Game - The in-game time of day becomes Equal to 24.00
    • Conditions
    • Actions
      • Set Days_Of_Year = (Days_Of_Year + 1)
      • Leaderboard - Change the value for Player 1 (Red) in Calendar to Days_Of_Year
And my variables are just the 2: Calendar (Leaderboard), and Dayofyear (Integer) with default value and no arrays.

P.S. ty Icemanbo for telling me how to post triggers!
 
Last edited:
Level 3
Joined
Apr 3, 2019
Messages
48
Hmmm... well this is interesting. I tried typing in cheats for the hell of it and the integer refused to even go up the +1 amount. I typed lightsout to get to the end of the day cycle quicker and when I do that it just stays at 0 and refuses to change value no matter how many days go by. That one's completely lost on me.
 
Last edited:
Level 45
Joined
Feb 27, 2007
Messages
5,578
Huh, the GUI tip for the "elapsed game time" event is misleading. It says the allowed range of the event is 0.00 to 24.00 but... the time of day never actually becomes 24.00, it goes from 23.99 to 0.00. Change the event to time = 0.00 and it should be working fine (made a test trigger myself that worked).
 
Level 3
Joined
Apr 3, 2019
Messages
48
Huh, the GUI tip for the "elapsed game time" event is misleading. It says the allowed range of the event is 0.00 to 24.00 but... the time of day never actually becomes 24.00, it goes from 23.99 to 0.00. Change the event to time = 0.00 and it should be working fine (made a test trigger myself that worked).

Oh snap! You were absolutely right Pyro. I changed it from 24 hours and it started working beautifully. Thinking about it now I can't believe I didn't try that. Thanks a lot!

I'm still a little unsure as to why it changed value at all if it didn't recognize 24 as an appropriate event response though, but after that hectic mess I think I'm just going to quit while I'm ahead.
 
Status
Not open for further replies.
Top