• 🏆 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!

[Trigger] Problem with triggers

Status
Not open for further replies.
Level 11
Joined
Mar 30, 2008
Messages
666
Hey!
I get an error and I don't know why.
Here is my first trigger that gets erorr.
  • Retaliation
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Level of Retaliation for (Attacked unit)) Greater than or equal to 1
      • (Random integer number between 1 and 100) Less than or equal to (5 x (Level of Retaliation for (Attacked unit)))
      • (((Attacked unit) is an illusion) Equal to False) and (((Attacking unit) is A melee attacker) Equal to True)
    • Actions
      • -------- Variable to determine the special effect which should be placed at point of attacked unit --------
      • Set Ret_SpEf = Abilities\Spells\Orc\MirrorImage\MirrorImageCaster.mdl
      • -------- Don't modify anything below this line --------
      • -------- Here we set variables for main hero's stats to add them to the clone in future --------
      • Set Ret_Stats[1] = (Strength of (Attacked unit) (Exclude bonuses))
      • Set Ret_Stats[2] = (Agility of (Attacked unit) (Exclude bonuses))
      • Set Ret_Stats[3] = (Intelligence of (Attacked unit) (Exclude bonuses))
      • -------- Here we store the items of the main hero into the variables in order to get the full damage dealt by illusion afterwards --------
      • Set Ret_Items[1] = (Item carried by (Attacked unit) in slot 1)
      • Set Ret_Items[2] = (Item carried by (Attacked unit) in slot 2)
      • Set Ret_Items[3] = (Item carried by (Attacked unit) in slot 3)
      • Set Ret_Items[4] = (Item carried by (Attacked unit) in slot 4)
      • Set Ret_Items[5] = (Item carried by (Attacked unit) in slot 5)
      • Set Ret_Items[6] = (Item carried by (Attacked unit) in slot 6)
      • Set Ret_Loc = (Position of (Attacked unit))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in Ret_Group) Equal to 0
        • Then - Actions
          • Custom script: set udg_Ret_Group = CreateGroup()
        • Else - Actions
      • Unit - Create 1 Dummy (Retatialitzation) for (Owner of (Attacked unit)) at Ret_Loc facing Default building facing degrees
      • Unit - Set level of Retaliation for (Last created unit) to (Level of Retaliation for (Attacked unit))
      • -------- Adding stats and items to the newly created hero --------
      • Hero - Modify Strength of (Last created unit): Set to Ret_Stats[1]
      • Hero - Modify Agility of (Last created unit): Set to Ret_Stats[2]
      • Hero - Modify Intelligence of (Last created unit): Set to Ret_Stats[3]
      • Hero - Give Ret_Items[1] to (Last created unit)
      • Hero - Give Ret_Items[2] to (Last created unit)
      • Hero - Give Ret_Items[3] to (Last created unit)
      • Hero - Give Ret_Items[4] to (Last created unit)
      • Hero - Give Ret_Items[5] to (Last created unit)
      • Hero - Give Ret_Items[6] to (Last created unit)
      • -------- End --------
      • Unit - Order (Last created unit) to Attack (Attacking unit)
      • Animation - Change (Last created unit)'s vertex coloring to (100.00%, 100.00%, 100.00%) with 60.00% transparency
      • Special Effect - Create a special effect at Ret_Loc using Ret_SpEf
      • Unit Group - Add (Last created unit) to Ret_Group
      • Special Effect - Destroy (Last created special effect)
      • Unit - Add a 1.20 second Unknown expiration timer to (Last created unit)
      • Custom script: call RemoveLocation(udg_Ret_Loc)
This is the 2nd

  • Retaliation Cleaning
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • ((Attacking unit) is in Ret_Group) Equal to True
    • Actions
      • -------- Here we are setting the additional damage should be dealt --------
      • Set Ret_Damage = (5.00 x (Real((Level of Retaliation for (Attacking unit)))))
      • -------- Don't modify anything below this line --------
      • Unit - Cause (Attacking unit) to damage (Attacked unit), dealing Ret_Damage damage of attack type Normal and damage type Normal
      • Unit Group - Remove (Attacking unit) from Ret_Group
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Ret_Group is empty) Equal to True
        • Then - Actions
          • Custom script: call DestroyGroup(udg_Ret_Group)
        • Else - Actions
And this is the error that I get when I want to save the map.
 

Attachments

  • Errorret.JPG
    Errorret.JPG
    98.7 KB · Views: 83
Level 4
Joined
Apr 16, 2009
Messages
85
it wants you to set a valid TimedLife Ability (currently it says Unit - Add a 1.20 second Unknown expiration timer to (Last created unit) that doesn't sound correct)
 
Level 15
Joined
Mar 31, 2009
Messages
1,397
Also, it will bug for one more reason, for a stupid reason, all Conditions in Wc3 are Or by default, and I assume you want And?

Bottom of the list, And-Multi Conditions


Edit: To reiterate, currently, if any of those conditions are satisfied, the trigger will run.
 
Level 12
Joined
Jul 27, 2008
Messages
1,181
Also, it will bug for one more reason, for a stupid reason, all Conditions in Wc3 are Or by default, and I assume you want And?

Bottom of the list, And-Multi Conditions


Edit: To reiterate, currently, if any of those conditions are satisfied, the trigger will run.

They aren't. Here is the way conditios are in JASS (as GUI makes them)
JASS:
function Trig_Name_Conditions takes nothing returns boolean
    if (not (Condition_A) ) then
        return false
    elseif (not (Condition_B) ) then
        return false
    elseif (not (Condition_C) ) then
        return false
    endif

    return true

So if any condition is false, it returns false.
 
Status
Not open for further replies.
Top