• 🏆 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!
  • ✅ Time to vote for the top 3 models! The POLL for Hive's 6th HD Modeling Contest: Mechanical is now open! 📅 Poll close on July 16, 2024! 🔗 Cast your vote now!
  • ✅ The POLL for Hive's Texturing Contest #33 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!

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