• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Trigger] Using min, max

Status
Not open for further replies.
Level 9
Joined
Oct 11, 2009
Messages
477
How to use min, max math function?

Hello. Can I ask how to use the min, max; The mathematical function in the integer section because it give lags to my map due to much variable functions. I want to know what formula to use. Thanks!:smile:
 
Last edited:
Level 28
Joined
Jan 26, 2007
Messages
4,789
Can you show us the trigger perhaps?
Min, max shouldn't lag...

Anyway, it's something like this:
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • Integer 1 Greater than Integer 2
    • Then - Actions
      • -------- Maximum = Integer 1 --------
    • Else - Actions
      • -------- Maximum = Integer 2 --------
Same goes for Minmum, but then you should either use "less than", or you should switch Integer 1 and Integer 2's places.

Yet again: it shouldn't lag if you use the functions "min" and/or "max", so I'd really rlike to see the trigger.
 
Level 9
Joined
Oct 11, 2009
Messages
477
No. I mean setting arrayed variables to specified values because I created arrayed variables which has 200+ indices especially the integer variables. I want the variables to set their value instantly to zero without any lags... Because when I test my map, the map initialization trigger function, when the map is loading, I experience damn head-aching lags. Could you help me how to do it? Thanks!
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
No. I mean setting variables indices because I created variables which has 200+ indices. I want the variables to set their value instantly to zero without any lags... Because when I test my map, the map initialization trigger function lags. Could you help me how to do it? Thanks!
Oh, like that! Sorry, I didn't understand you at first ^^
Yeah, you should use something like this:
  • For each (Integer LoopInt) from 1 to 200, do (Actions)
    • Loop - Actions
      • Set YourVariable[LoopInt] = 0
      • Set AnotherVariable[LoopInt] = 0.00
LoopInt is an integer variable (wthout array).
YourVariable is obviously the variable with a lot of indexes, which you wanted to set to 0.

However: if you want to do it at map init, then go to the variable editor, select the variable with the indexes, set array amount = your amount of arrays and initial value = your initial value.
Then they're all the value you want at map init.

Umm, I hope I understood you correct this time.
 
Status
Not open for further replies.
Top