• 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.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

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

Status
Not open for further replies.

aggro

A

aggro

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.
 
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.
 
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.
 
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.
Back
Top