- Joined
- Sep 3, 2009
- Messages
- 458
Well I'm making my "Lock-On Battle System" MUI or atleast MPI. I just can't seem to make it work.
Basically you have a "Target" skill that once used on any unit it will mark it as your target. An invisible dummy unit will then be created for the hero with the shop sharing model and will follow the target. When the caster dies, acquires a new target, or the target dies, the arrow unit will be destroyed. But then even when I destroy it in the trigger it just doesn't work.
Here's my trigger
Basically you have a "Target" skill that once used on any unit it will mark it as your target. An invisible dummy unit will then be created for the hero with the shop sharing model and will follow the target. When the caster dies, acquires a new target, or the target dies, the arrow unit will be destroyed. But then even when I destroy it in the trigger it just doesn't work.
Here's my trigger
-
Init
-
Events
-
Map initialization
-
-
Conditions
-
Actions
-
-------- Target --------
-
For each (Integer Target) from 1 to 1000, do (Actions)
-
Loop - Actions
-
Set TargetId[Target] = Target
-
Set TargetCaster[Target] = No unit
-
Set TargetUnit[Target] = No unit
-
-
-
-
-
Target Start
-
Events
-
Unit - A unit Starts the effect of an ability
-
-
Conditions
-
(Ability being cast) Equal to Target
-
-
Actions
-
Trigger - Run Target NewIndex <gen> (ignoring conditions)
-
Unit - Kill TargetDummy[TargetCurrentIndex]
-
Set TargetCaster[TargetCurrentIndex] = (Triggering unit)
-
Set TargetUnit[TargetCurrentIndex] = (Target unit of ability being cast)
-
Set TargetPoint[TargetCurrentIndex] = (Position of TargetUnit[TargetCurrentIndex])
-
Unit - For (Owner of TargetCaster[TargetCurrentIndex]) create 1 Dummy Target at TargetPoint[TargetCurrentIndex] facing Default building facing degrees
-
Set TargetDummy[(Player number of (Owner of TargetCaster[TargetCurrentIndex]))] = (Last created unit)
-
Custom script: call RemoveLocation(udg_TargetPoint[udg_TargetCurrentIndex])
-
-
-
Target Loop
-
Events
-
Time - Every 0.01 seconds of game time
-
-
Conditions
-
Actions
-
For each (Integer Target) from 1 to 1000, do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(TargetCaster[Target] Not equal to No unit) or (TargetUnit[Target] Not equal to No unit)
-
-
Then - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(TargetCaster[Target] Not equal to No unit) or (TargetUnit[Target] Not equal to No unit)
-
-
Then - Actions
-
Set TargetPoint[Target] = (Position of TargetUnit[Target])
-
Unit - Move TargetDummy[Target] instantly to TargetPoint[Target]
-
Custom script: call RemoveLocation(udg_TargetPoint[udg_Target])
-
-
Else - Actions
-
Unit - Kill TargetDummy[Target]
-
Set TargetCurrentIndex = Target
-
Set TargetCaster[Target] = No unit
-
Set TargetUnit[Target] = No unit
-
Custom script: call RemoveLocation(udg_TargetPoint[udg_Target])
-
Trigger - Run Target ReturnIndex <gen> (ignoring conditions)
-
-
-
-
Else - Actions
-
Custom script: call RemoveLocation(udg_TargetPoint[udg_Target])
-
-
-
-
-
-
-
Target NewIndex
-
Events
-
Conditions
-
Actions
-
Set TargetIndex = (TargetIndex + 1)
-
Set TargetCurrentIndex = TargetId[TargetIndex]
-
-
-
Target ReturnIndex
-
Events
-
Conditions
-
Actions
-
Set TargetId[TargetIndex] = TargetCurrentIndex
-
Set TargetIndex = (TargetIndex - 1)
-
-