- Joined
- Dec 16, 2007
- Messages
- 252
I'm making a Meathook spell by emijl3r MUI but it didn't go so well. (I can't use the JASS versions).
To thoose who don't know what the spell does, it throws a chain and when it hits a unit the hitten unit will get pulled back. But when I tried to make the Meat Hook MUI this happens.
The spell is thrown.
A chain is created towards the targeted unit.
The chain stops in front of the unit and are ready to pull it back to the caster.
But the chain only pulls the unit one step and the chain remains.
Here's the triggers, I think the third one is the problem.
EDIT: ADDED THE MAP BELOW SO YOU CAN SEE WHAT HAPPENS!
To thoose who don't know what the spell does, it throws a chain and when it hits a unit the hitten unit will get pulled back. But when I tried to make the Meat Hook MUI this happens.
The spell is thrown.
A chain is created towards the targeted unit.
The chain stops in front of the unit and are ready to pull it back to the caster.
But the chain only pulls the unit one step and the chain remains.
Here's the triggers, I think the third one is the problem.
EDIT: ADDED THE MAP BELOW SO YOU CAN SEE WHAT HAPPENS!
-
MH Cast
-
Events
- Unit - A unit Begins casting an ability
-
Conditions
- (Ability being cast) Equal to Meat Hook
-
Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- MH_CustomValue Less than 1000
-
Then - Actions
- Set MH_CustomValue = (MH_CustomValue + 1)
-
Else - Actions
- Set MH_CustomValue = 1
-
If - Conditions
- Set MH_Level = (Level of Meat Hook for (Triggering unit))
- Set MH_Unit[MH_CustomValue] = (Triggering unit)
- Set MH_UnitPoint[MH_CustomValue] = (Position of MH_Unit[MH_CustomValue])
- Set MH_TargetPoint[MH_CustomValue] = (Target point of ability being cast)
- Set MH_Angle[MH_CustomValue] = (Angle from MH_UnitPoint[MH_CustomValue] to MH_TargetPoint[MH_CustomValue])
- Unit - Create 1 Footman for (Owner of MH_Unit[MH_CustomValue]) at (Center of Region 000 <gen>) facing Default building facing degrees
- Unit - Turn collision for (Last created unit) Off
- Unit - Set the custom value of (Last created unit) to MH_CustomValue
- Unit Group - Add (Last created unit) to MH_Group
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Events
-
MH Extend
-
Events
- Time - Every 0.04 seconds of game time
-
Conditions
- (Number of units in MH_Group) Greater than 0
-
Actions
-
Unit Group - Pick every unit in MH_Group and do (Actions)
-
Loop - Actions
- Set MH_CustomValue2 = (Custom value of (Picked unit))
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- MH_Links Less than 30
-
Then - Actions
- Set MH_Links = (MH_Links + 1)
- Unit - Create 1 Chain Link for (Owner of MH_Unit[MH_CustomValue2]) at (MH_UnitPoint[MH_CustomValue2] offset by (Real((40 x MH_Links))) towards MH_Angle[MH_CustomValue2] degrees) facing MH_Angle[MH_CustomValue2] degrees
- Set MH_Link[MH_Links] = (Last created unit)
- Set Temp_Group = (Units within 115.00 of (Position of MH_Link[MH_Links]) matching (((Matching unit) is alive) Equal to True))
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- MH_Links Greater than 3
-
Then - Actions
- Set MH_Target[MH_CustomValue2] = (Random unit from Temp_Group)
- Custom script: call DestroyGroup(udg_Temp_Group)
- Custom script: set udg_Temp_Group = null
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (MH_Target[MH_CustomValue2] belongs to an ally of (Owner of MH_Unit[MH_CustomValue2])) Equal to False
-
Then - Actions
- Unit - Cause MH_Unit[MH_CustomValue2] to damage MH_Target[MH_CustomValue2], dealing (100.00 x (Real(MH_Level))) damage of attack type Chaos and damage type Normal
- -------- PERRRRRRRRRRRRFFFFFEEEEEECTTTTT --------
- Else - Actions
-
If - Conditions
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- MH_Target[MH_CustomValue2] Not equal to No unit
-
Then - Actions
- Unit - Set the custom value of MH_Unit[MH_CustomValue2] to MH_CustomValue2
- Unit Group - Add MH_Unit[MH_CustomValue2] to MH_Group2
- Unit - Kill (Picked unit)
- Else - Actions
-
If - Conditions
-
Else - Actions
- Unit - Set the custom value of MH_Unit[MH_CustomValue2] to MH_CustomValue2
- Unit Group - Add MH_Unit[MH_CustomValue2] to MH_Group2
- Unit - Kill (Picked unit)
-
If - Conditions
-
Loop - Actions
-
Unit Group - Pick every unit in MH_Group and do (Actions)
-
Events
-
MH Retract
-
Events
- Time - Every 0.04 seconds of game time
-
Conditions
- (Number of units in MH_Group2) Greater than 0
-
Actions
-
Unit Group - Pick every unit in MH_Group2 and do (Actions)
-
Loop - Actions
- Set MH_CustomValue3 = (Custom value of (Picked unit))
- Unit - Move MH_Target[MH_CustomValue3] instantly to (Position of MH_Link[MH_Links])
- Unit - Remove MH_Link[MH_Links] from the game
- Set MH_Links = (MH_Links - 1)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- MH_Links Equal to 0
-
Then - Actions
- Game - Display to (All players) for 2.00 seconds the text: Worked a bit
- Custom script: call RemoveLocation(udg_MH_UnitPoint[udg_MH_CustomValue])
- Custom script: call RemoveLocation(udg_MH_TargetPoint[udg_MH_CustomValue])
- Custom script: set udg_MH_Target[udg_MH_CustomValue3] = null
- Custom script: set udg_MH_Unit[udg_MH_CustomValue3] = null
- Unit - Kill (Picked unit)
- Else - Actions
-
If - Conditions
-
Loop - Actions
-
Unit Group - Pick every unit in MH_Group2 and do (Actions)
-
Events
Attachments
Last edited: