MUI spell help pls

Status
Not open for further replies.
Level 5
Joined
Jan 12, 2010
Messages
132
Two hours ago i found a tutorial here on hive about hashtable and i decided try to create a spell MUI.The first trigger of spell work fine but second no.So the second trigger obviously should move unit to a specific point facing a specific angle .Here are the trigger:
  • Twist
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to LB
    • Actions
      • Set Twist_point = (Target point of ability being cast)
      • Set Twist_caster = (Triggering unit)
      • Set Twist_timer = 6.00
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • Set Twist_angle = ((Real((Integer A))) x 30.00)
          • Unit - Create 1 Dummy (sword) for (Owner of Twist_caster) at Twist_point facing Twist_angle degrees
          • Unit - Turn collision for (Last created unit) Off
          • Unit - Add a 6.10 second Generic expiration timer to (Last created unit)
          • Unit - Make (Last created unit) Explode on death
          • Unit Group - Add (Last created unit) to Twist_group[1]
          • Hashtable - Save Handle OfTwist_point as 1 of (Key (Last created unit)) in MY_hashtable
          • Hashtable - Save Twist_angle as 2 of (Key (Last created unit)) in MY_hashtable
          • Hashtable - Save Twist_timer as 3 of (Key (Last created unit)) in MY_hashtable
      • Custom script: call RemoveLocation(udg_Twist_point)
  • Twist event
    • Events
      • Time - Every 0.04 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in Twist_group[1] and do (Actions)
        • Loop - Actions
          • Set Twist_timer = (Load 3 of (Key (Picked unit)) from MY_hashtable)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Twist_timer Greater than 0.04
            • Then - Actions
              • Set Twist_angle = (Load 2 of (Key (Picked unit)) from MY_hashtable)
              • Set Twist_angle = (Twist_angle + 5.00)
              • If (Twist_angle Equal to 365.00) then do (Set Twist_angle = 5.00) else do (Do nothing)
              • Unit - Move (Picked unit) instantly to (Load 1 of (Key (Picked unit)) in MY_hashtable), facing Twist_angle degrees
              • Hashtable - Save Twist_angle as 2 of (Key (Picked unit)) in MY_hashtable
              • Hashtable - Save (Twist_timer - 0.04) as 3 of (Key (Picked unit)) in MY_hashtable
            • Else - Actions
              • Unit Group - Remove (Picked unit) from Twist_group[1]
              • Hashtable - Clear all child hashtables of child (Key (Picked unit)) in MY_hashtable
 
Level 5
Joined
Jan 12, 2010
Messages
132
Remove these from the first trigger:

Unit - Add a 6.10 second Generic expiration timer to (Last created unit)
Unit - Make (Last created unit) Explode on death

You can just use "Unit - Remove (Picked unit)" from your other trigger.

yea but this is less importat and doesn`t explain why the second trigger wont work.
Please is anyone know to use hashtable please show me how to create this spell correctly.
 
You really haven't given us much information to work with:

1) no map

2) you still haven't clarified what isn't working with the second trigger

I can guess what your problem is and that is you need to use a normal
group instead of a group array for this, because arrays will only initialize
the group at index 0.

So change Twist_group[1] to just "Twist_group1" (a non-array) or change
it to Twist_group[0] and it should work fine. If not, make sure that your
second trigger is enabled/turned on.
 
Level 5
Joined
Jan 12, 2010
Messages
132
This trigger is supposed i hope to create to hashtable at game init.
  • Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Hashtable - Create a hashtable
      • Set Hashtable = (Last created hashtable)
      • Hashtable - Create a hashtable
      • Set MY_hashtable = (Last created hashtable)
So this trigger set the variable that are requied for second trigger.Triger is Enabled and turned on
  • Twist
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to LB
    • Actions
      • Set Twist_point = (Target point of ability being cast)
      • Set Twist_caster = (Triggering unit)
      • Set Twist_timer = 6.00
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • Set Twist_angle = ((Real((Integer A))) x 30.00)
          • Unit - Create 1 Dummy (sword) for (Owner of Twist_caster) at Twist_point facing Twist_angle degrees
          • Unit Group - Add (Last created unit) to Twist_group1
          • Unit - Turn collision for (Last created unit) Off
          • Unit - Add a 6.10 second Generic expiration timer to (Last created unit)
          • Unit - Make (Last created unit) Explode on death
          • Hashtable - Save Twist_angle as 2 of (Key (Last created unit)) in MY_hashtable
          • Hashtable - Save Twist_timer as 3 of (Key (Last created unit)) in MY_hashtable
      • Custom script: call RemoveLocation(udg_Twist_point)
This trigger should make units in Twist_group1 to face Twist_angle.Trigger is turned on and is enabled.
  • Twist event
    • Events
      • Time - Every 0.04 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in Twist_group1 and do (Actions)
        • Loop - Actions
          • Set Twist_timer = (Load 3 of (Key (Picked unit)) from MY_hashtable)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Twist_timer Greater than 0.04
            • Then - Actions
              • Set Twist_angle = (Load 2 of (Key (Picked unit)) from MY_hashtable)
              • Set Twist_angle = (Twist_angle + 5.00)
              • If (Twist_angle Equal to 365.00) then do (Set Twist_angle = 5.00) else do (Do nothing)
              • Unit - Make (Picked unit) face Twist_angle over 0.00 seconds
              • Hashtable - Save Twist_angle as 2 of (Key (Picked unit)) in MY_hashtable
              • Hashtable - Save (Twist_timer - 0.04) as 3 of (Key (Picked unit)) in MY_hashtable
              • Game - Display to (All players) the text: (String(Twist_angle))
            • Else - Actions
              • Unit Group - Remove (Picked unit) from Twist_group1
              • Hashtable - Clear all child hashtables of child (Key (Picked unit)) in MY_hashtable
Problem is dont make unit to face Twist_angle at all.I add Game diplay message to see if value of Twist_angle is changed,and true is changed.Is a big question for me;Why picked unit dont face angle?
 
Status
Not open for further replies.
Top