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

Need a little help about Custom Scripts: Locals

Status
Not open for further replies.
Level 11
Joined
Aug 1, 2009
Messages
714
I am making a sprout skill for my map and I need it to be MUI.
  • Sprout Effect
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Sprout
    • Actions
      • Custom script: local unit udg_Sprout_Target
      • Custom script: local real udg_Sprout_Angle
      • Set Sprout_Target = (Target unit of ability being cast)
      • Set Sprout_Angle = 0.00
      • For each (Integer A) from 1 to 8, do (Actions)
        • Loop - Actions
          • Set Sprout_Target_Point[1] = (Position of Sprout_Target)
          • Set Sprout_Target_Point[2] = (Sprout_Target_Point[1] offset by 200.00 towards Sprout_Angle degrees)
          • Destructible - Create a Snowy Tree Wall at Sprout_Target_Point[2] facing (Random angle) with scale 1.00 and variation 0
          • Set Sprout_Trees[(Integer A)] = (Last created destructible)
          • Set Sprout_Angle = (Sprout_Angle + 45.00)
      • Wait (1.00 + (Real((Level of Sprout for (Triggering unit))))) seconds
      • For each (Integer A) from 1 to 8, do (Actions)
        • Loop - Actions
          • Destructible - Remove Sprout_Trees[(Integer A)]
So I got two local variable
  • Custom script: local unit udg_Sprout_Target
  • Custom script: local real udg_Sprout_Angle
All i need to know is how to create a a local variable which is an array since I got two array variables here. Sprout_Trees and Sprout_Target_Point
 
Level 11
Joined
Aug 1, 2009
Messages
714
I got it! But When I try it. The skill is not MUI.
Here is my triggers.
  • Sprout Effect
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Sprout
    • Actions
      • Custom script: local unit Sprout_Target
      • Custom script: local real Sprout_Angle
      • Custom script: local location array Sprout_Target_Point
      • Custom script: local destructable array Sprout_Trees
      • Set Sprout_Target = (Target unit of ability being cast)
      • Set Sprout_Angle = 0.00
      • For each (Integer A) from 1 to 8, do (Actions)
        • Loop - Actions
          • Set Sprout_Target_Point[1] = (Position of Sprout_Target)
          • Set Sprout_Target_Point[2] = (Sprout_Target_Point[1] offset by 200.00 towards Sprout_Angle degrees)
          • Destructible - Create a Snowy Tree Wall at Sprout_Target_Point[2] facing (Random angle) with scale 1.00 and variation 0
          • Set Sprout_Trees[(Integer A)] = (Last created destructible)
          • Set Sprout_Angle = (Sprout_Angle + 45.00)
      • Wait (1.00 + (Real((Level of Sprout for (Triggering unit))))) seconds
      • For each (Integer A) from 1 to 8, do (Actions)
        • Loop - Actions
          • Destructible - Remove Sprout_Trees[(Integer A)]
 
Status
Not open for further replies.
Top