A Variable is exists?

Huderlord

New Member
Reaction score
0
I need function which can test whether variable is exists in the game.
Can i do something like this?
 

HeX.16

Isn't Trollin You Right Now
Reaction score
131
Huh? you can see all variables in the editor by pressing the "X' kinda icon in the bar.
Im sure i dont understand what you are saying.
 

Huderlord

New Member
Reaction score
0
yes i know that lol, but i need function which can do this ingame.
it should return boolean
If variable is exists then return true else false
 

fogrn

New Member
Reaction score
2
You can do this with a hashtable location. Conditions>Boolean Comparison>Hashtable - Load Boolean Value(hashtable)
 

HydraRancher

Truth begins in lies
Reaction score
197
You can do this with a hashtable location. Conditions>Boolean Comparison>Hashtable - Load Boolean Value(hashtable)

No. This isn't what he is asking for.

Suppose you use a unit variable you can use:
Trigger:
  • If (All Conditions are True) Then do (Then Actions) Else do (Else Actions)
    • If - Conditions
      • Variable_Unit Equal To No Unit
    • Then - Actions
      • Set Boolean = False
    • Else - Actions
      • Set Boolean = True
 

Huderlord

New Member
Reaction score
0
Ok but those parameters are for me unknown:
Load Label of Category from last created hashtable

Label is variable name, Category is variable type?
I dont know how i can use it.
 

fogrn

New Member
Reaction score
2
Hm... You should see
Load Value of Value in Last created hashtable

Did you click on the game cache version of Load Boolean Value instead of the hashtable?
 

Huderlord

New Member
Reaction score
0
Sorry yes they are so similar.
I need this hashtable first right? So i'll created one in map initial and set this to variable arenaHash what is next?
 

Romek

Super Moderator
Reaction score
964
You cannot dynamically test whether or not a variable actually exists (has been created).
I don't see why you'd ever need to either...

If you want to test whether or not there is any data stored in a variable, simply compare it to null. Note that this wouldn't work for integers, booleans, etc.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top