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

For each intiger A and B

Status
Not open for further replies.
Level 10
Joined
Jan 21, 2007
Messages
576
If i had this action

  • For each (Integer A) from 1 to 12, do (Actions)
    • Loop - Actions
      • Set Caster_Bloodlust[1] = (Casting unit)
Would it set Caster_Bloodlust[1-12] to casting unit?

EDIT: Or would this set Caster_Bloodlust[1-12] to casting unit?

  • For each (Integer A) from 1 to 12, do (Actions)
    • Loop - Actions
      • Set Caster_Bloodlust[(Integer A)] = (Casting unit)
 
Level 10
Joined
Jan 21, 2007
Messages
576
I dont understrand what you just said.
I have a variable "Caster_Bloodlust" it is an array (size 12) i want it to set Caster_Bloodlust[1]
Caster_Bloodlust[2]
Caster_Bloodlust[3]
Caster_Bloodlust[4]
Caster_Bloodlust[5]
Caster_Bloodlust[6]
Caster_Bloodlust[7]
Caster_Bloodlust[8]
Caster_Bloodlust[9]
Caster_Bloodlust[10]
Caster_Bloodlust[11]
Caster_Bloodlust[12]
All to Casting Unit, will the second or first code, or niether do this?
 
Level 4
Joined
Apr 29, 2007
Messages
88
The second trigger works, the first will only command caster_bloodlust [1]

Anyway, for what purpose you use these trigger?? I don't remember if Bloodlust stuck with others
 
Level 21
Joined
Aug 21, 2005
Messages
3,699
if this is what you want to do:

Whenever someone casts Bloodlust, this unit should be added to the unit variable, and the 1 - 12 will stand for the player number of the owner of the unit

then this trigger will do fine:

Events:
a unit finishes casting an ability
Conditions:
ability being cast = bloodlust
Actions: Set Bloodlust_Caster[Player number of (owner of (casting unit) )] = casting unit

In your trigger, you take those 12 variables in the array and assign it the same unit... Thus, you don't need an array of 12 but an array of 1 because all 12 variables will result in the same unit.

Is that clear?
 
Status
Not open for further replies.
Top