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

Display variable's value during a game

Status
Not open for further replies.
Level 2
Joined
Aug 12, 2023
Messages
3
Hello everyone

I'm posting this message to ask a question

I'd like to test the random manipulation on the warcraft 3 legion TD map.

I saw that the creation of turrets with the random race goes through the function MathRandom

I was wondering if there was any documentation about this?

I was also wondering if, in order to test certain manipulations, it was possible to display the values of variables during a game (like on a programming debugger). The idea is that when a value is assigned to a variable, it should be visible in a console or in chat, so that you can see in real time how the game is behaving.

I've also noticed that when I randomly build a turret, if I go back, it's always the same turret that's built.
I deduce that we're in a pseudo-randomization situation, and that the values are probably generated from a seed generated at the start of the game.

Is it possible to find this seed once the game has started?

Is this possible? Are there any resources along these lines?

Thanks for your answers
 
Last edited:

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,866

Aside from those, there's also the Display Text action which lets you convert Integers/Reals to Strings. With that you could easily display the value of any variable.
 
Last edited:
Level 30
Joined
Aug 29, 2012
Messages
1,383
Also make sure to have "Use Fixed Random Seed" turned off in File > Preferences, I believe it's on by default and does pretty much what it says when you use triggers with random numbers involved

1691886335991.png
 
Status
Not open for further replies.
Top