• 🏆 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!

How can i do a multi-instancable loop action with gui?

Status
Not open for further replies.
Level 2
Joined
Apr 19, 2008
Messages
5
i have tried many ways but i couldnt find out how it is. more explanation what im talking about, here is a simplified example:

  • Starter
  • Events
    • Unit - A unit Starts the effect of an ability
  • Actions
    • Set Unit[(Player number of (Owner of (Triggering unit)))] = (Triggering unit)
    • Trigger - Turn on Effect <gen>
    • Wait 6.00 seconds
    • Trigger - Turn off Effect <gen>
and thats the effect

  • Effect
  • Events
    • Time - Every 1.00 seconds of game time
  • Actions
    • Unit - Cause Unit[X] to damage Unit[X], dealing 50.00 damage of attack type Spells and damage type Normal
im trying to make unique ids for every player but i cant. My problem is "X" here. How can i apply the player number on it? Or any other ways to do multi-instancable actions with gui? hope i could explain myself. Thanks anyway.
 
Level 19
Joined
Feb 25, 2009
Messages
2,004
You need to use indexing system, which saves units with unique ID (number) and then loop throught the ID (number) of the units.

As for the first, if your veriable is array, when you choose it as an unit, it will look like "<VarName>[Index]", click on the "Index" into the [] and then choose "Function" from the pop-up window, then click "P", and choose "Player - Player Number" then select the player that refers to that unit.
 
Level 2
Joined
Apr 19, 2008
Messages
5
I have searched the forum but cant find anything. In addition i already use index. So, in "starter", unit[triggering player]= triggering unit. unit[1] or unit[2] etc. index takes a number it isnt a static number it depends on player number so it makes the trigger multi-instancable. but i cant use this value and attach on loop effect.
 
Level 14
Joined
Aug 31, 2009
Messages
775
You should look into use HashTables.

They're a method of saving individual data about a unit/player/doodad/effect or whatever and loading specific information about that unit.

In your case, you want a 6 second timer to be specific to a unit, and HashTables can achieve this.
 
Status
Not open for further replies.
Top