• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Trigger] Someone help me please~

Status
Not open for further replies.
Level 12
Joined
Aug 12, 2008
Messages
349
The triggers below seemed to not MUI. But why?

[trigger=Map INIT]Map Initialization
Events
Map initialization
Conditions
Actions
Set T_effect_float = Abilities\Spells\Other\Drain\ManaDrainTarget.mdl
Set T_effect_end = Abilities\Spells\Orc\WarStomp\WarStompCaster.mdl
[/trigger]


[trigger=T cast]T cast
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Telekinesis
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
T_casternumber Equal to 0
Then - Actions
Trigger - Turn on T loop <gen>
Else - Actions
Set T_casternumber = (T_casternumber + 1)
Set T_index_selected = False
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
T_dyn_index Less than T_index
T_index_clear[T_dyn_index] Equal to True
T_dyn_index Not equal to 0
Then - Actions
Set T_index_selected = True
Else - Actions
For each (Integer T_Integer_dyn_check) from 1 to T_index, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
T_index_selected Equal to False
T_index_clear[T_Integer_dyn_check] Equal to True
Then - Actions
Set T_dyn_index = T_Integer_dyn_check
Set T_index_selected = True
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
T_index_selected Equal to False
Then - Actions
Set T_index = (T_index + 1)
Set T_dyn_index = T_index
Else - Actions
Set T_index_clear[T_dyn_index] = False
Set T_caster[T_dyn_index] = (Triggering unit)
Set T_count[T_dyn_index] = 0.00
Set T_target[T_dyn_index] = (Target unit of ability being cast)
-------- -------------------------------------------------------------------------------------------------------------------------- --------
-------- The duration of float for the target unit --------
Set T_duration[T_dyn_index] = (1.50 + (0.50 x (Real((Level of Telekinesis for T_caster[T_dyn_index])))))
-------- -------------------------------------------------------------------------------------------------------------------------- --------
-------- Float height and speed --------
Set T_speed[T_dyn_index] = (Random real number between 125.00 and 225.00)
Set T_height[T_dyn_index] = (Random real number between 400.00 and 900.00)
-------- -------------------------------------------------------------------------------------------------------------------------- --------
Unit - Add Crow Form to T_target[T_dyn_index]
Unit - Remove Crow Form from T_target[T_dyn_index]
Unit - Pause T_target[T_dyn_index]
Unit Group - Add T_target[T_dyn_index] to T_targetgroup
Animation - Change T_target[T_dyn_index] flying height to T_height[T_dyn_index] at T_speed[T_dyn_index]
[/trigger]


[trigger=T loop]T loop
Events
Time - Every 0.05 seconds of game time
Conditions
Actions
For each (Integer T_X) from 1 to T_index, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Number of units in T_targetgroup) Greater than 0
Then - Actions
Set T_count[T_X] = (T_count[T_X] + 0.05)
Unit Group - Pick every unit in T_targetgroup and do (Actions)
Loop - Actions
Special Effect - Create a special effect attached to the origin of T_target[T_X] using T_effect_float
Special Effect - Destroy (Last created special effect)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
T_count[T_X] Greater than or equal to T_duration[T_X]
Then - Actions
-------- -------------------------------------------------------------------------------------------------------------------------- --------
-------- Damage --------
Set T_damage[T_X] = ((Current flying height of T_target[T_X]) / 2.00)
-------- -------------------------------------------------------------------------------------------------------------------------- --------
Animation - Change T_target[T_X] flying height to 0.00 at 1500.00
Set T_targetpoint[T_X] = (Position of T_target[T_X])
Special Effect - Create a special effect at T_targetpoint[T_X] using T_effect_end
Special Effect - Destroy (Last created special effect)
Unit - Cause T_caster[T_X] to damage T_target[T_X], dealing T_damage[T_X] damage of attack type Spells and damage type Normal
Unit Group - Remove T_target[T_X] from T_targetgroup
-------- -------------------------------------------------------------------------------------------------------------------------- --------
Set T_casternumber = (T_casternumber - 1)
Set T_index_clear[T_X] = True
-------- -------------------------------------------------------------------------------------------------------------------------- --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
T_index_selected Equal to False
Then - Actions
Set T_dyn_index = T_X
Set T_index_selected = True
Else - Actions
-------- -------------------------------------------------------------------------------------------------------------------------- --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
T_casternumber Not equal to 0
T_X Equal to T_index
Then - Actions
Set T_index = (T_index - 1)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
T_casternumber Equal to 0
Then - Actions
Set T_index = 0
Set T_dyn_index = 0
Trigger - Turn off (This trigger)
Else - Actions
-------- -------------------------------------------------------------------------------------------------------------------------- --------
Else - Actions
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
T_casternumber Not equal to 0
T_X Equal to T_index
Then - Actions
Set T_index = (T_index - 1)
Else - Actions
[/trigger]


Is there any problems with the triggers @@?
 
Level 29
Joined
Mar 10, 2009
Messages
5,016
If the trigger is off, then you set "Set T_index = 0"...so whats the use of reducing Set T_index = (T_index - 1) twice???...

The Set T_casternumber should be reduced after the duration of the spell...in order to do that you should make a boolean checking...

For more info take a look at this...

  • Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to SAMPLE (Neutral Hostile 1)
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Index1 Equal to 0
        • Then - Actions
          • Trigger - Turn on Loop <gen>
        • Else - Actions
      • Set Index1 = (Index1 + 1)
      • Set Index2 = (Index2 + 1)
      • -------- after this, set all arrays to Index2 --------
      • Set BooleanCheck[Index2] = False
      • Set Target[Index2] = (Target unit of ability being cast)
      • Special Effect - Create a special effect attached to the overhead of Target[Index2] using abilities\weapons\DemolisherMissile\DemolisherMissile.mdl
      • Set Sfx[Index2] = (Last created special effect)
      • Set SfxDuration[Index2] = 10.00
  • Loop
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • For each (Integer Index3Loop) from 1 to Index2, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • SfxDuration[Index3Loop] Greater than 0.00
            • Then - Actions
              • Set SfxDuration[Index3Loop] = (SfxDuration[Index3Loop] - 1.00)
              • Floating Text - Create floating text that reads (String(SfxDuration[Index3Loop])) above Target[Index3Loop] with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
              • Floating Text - Change (Last created floating text): Disable permanence
              • Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
              • Floating Text - Change the lifespan of (Last created floating text) to 3.00 seconds
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • BooleanCheck[Index3Loop] Equal to False
                • Then - Actions
                  • Set BooleanCheck[Index3Loop] = True
                  • Set Index1 = (Index1 - 1)
                  • Special Effect - Destroy Sfx[Index3Loop]
                  • Game - Display to (All players) the text: (Index 1 is now + (String(Index1)))
                • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Index1 Equal to 0
        • Then - Actions
          • Trigger - Turn off (This trigger)
          • Set Index2 = 0
          • Game - Display to (All players) the text: Index1 and Index2 i...
          • Game - Display to (All players) the text: TRIGGER OFF
        • Else - Actions
 
Level 12
Joined
Aug 12, 2008
Messages
349
Ohh .. wow.. That's simpler a lot . Thanks mckill2009! I'll update the above spell as soon as possible ^-^ Thank you very much!!!
Actually I learn the index system from Kingz's tutorial bt somehw it seems to be quite complex >< I'll learn from yours from today onwards~

EDIT: btw, hw come the it turn off (this trigger) before set the index2=0 in the second trigger? can it run?

EDIT: Here goes the new triggers. it still does not work in MUI. the first cast works perfectly fine but if i cast it multiple times. some units did not drop down.
[trigger=T cast]T cast
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Telekinesis
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
T_index1 Equal to 0
Then - Actions
Trigger - Turn on T loop <gen>
Else - Actions
Set T_index1 = (T_index1 + 1)
Set T_index2 = (T_index2 + 1)
-------- -------------------------------------------------------------------------------------------------------------------------- --------
Set T_caster[T_index2] = (Triggering unit)
Set T_count[T_index2] = 0.00
Set T_target[T_index2] = (Target unit of ability being cast)
-------- -------------------------------------------------------------------------------------------------------------------------- --------
-------- The duration of float for the target unit --------
Set T_duration[T_index2] = (1.50 + (0.50 x (Real((Level of Telekinesis for T_caster[T_index2])))))
-------- -------------------------------------------------------------------------------------------------------------------------- --------
-------- Float height and speed --------
Set T_speed[T_index2] = (Random real number between 150.00 and 300.00)
Set T_height[T_index2] = (Random real number between 400.00 and 900.00)
-------- -------------------------------------------------------------------------------------------------------------------------- --------
Unit - Add Crow Form to T_target[T_index2]
Unit - Remove Crow Form from T_target[T_index2]
Unit - Pause T_target[T_index2]
Unit Group - Add T_target[T_index2] to T_targetgroup
Animation - Change T_target[T_index2] flying height to T_height[T_index2] at T_speed[T_index2]
[/trigger]

[trigger=T loop]T loop
Events
Time - Every 0.05 seconds of game time
Conditions
Actions
For each (Integer T_index3) from 1 to T_index2, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
T_count[T_index3] Greater than or equal to T_duration[T_index3]
Then - Actions
-------- -------------------------------------------------------------------------------------------------------------------------- --------
-------- Damage --------
Set T_damage[T_index3] = ((Current flying height of T_target[T_index3]) / 3.00)
-------- -------------------------------------------------------------------------------------------------------------------------- --------
Animation - Change T_target[T_index3] flying height to 0.00 at 0.00
Set T_targetpoint[T_index3] = (Position of T_target[T_index3])
Special Effect - Create a special effect at T_targetpoint[T_index3] using Abilities\Spells\Orc\WarStomp\WarStompCaster.mdl
Special Effect - Destroy (Last created special effect)
Unit - Cause T_caster[T_index3] to damage T_target[T_index3], dealing T_damage[T_index3] damage of attack type Spells and damage type Normal
Unit - Unpause T_target[T_index3]
Unit Group - Remove T_target[T_index3] from T_targetgroup
-------- -------------------------------------------------------------------------------------------------------------------------- --------
Set T_index1 = (T_index1 - 1)
-------- -------------------------------------------------------------------------------------------------------------------------- --------
Else - Actions
Set T_count[T_index3] = (T_count[T_index3] + 0.05)
Unit Group - Pick every unit in T_targetgroup and do (Actions)
Loop - Actions
Special Effect - Create a special effect attached to the origin of T_target[T_index3] using Abilities\Spells\Undead\AbsorbMana\AbsorbManaBirthMissile.mdl
Special Effect - Destroy (Last created special effect)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
T_index1 Equal to 0
Then - Actions
Trigger - Turn off (This trigger)
Set T_index2 = 0
Else - Actions
[/trigger]


really appreciate it if you guys can help =)
 
Last edited:
Status
Not open for further replies.
Top