• 🏆 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 Checking Request

Status
Not open for further replies.
Level 10
Joined
Mar 19, 2010
Messages
622
I'm not sure if this is suitable to post it here.
I'd got a threat system made myself for my map, but I'm not sure if it is leakless. Maker will get +rep and given credits.
Some info about this trigger:

1)This trigger is made to: To make the boss attack the hero(total of 3) with the highest threat value when they are fighting it.
2)Important Point:
*This is only made for 3 unit to use.
*There is only 3 boss also which will be fought separately.
*Please help me check if is is compatible for it's uses.
  • Attack Threat
    • Events
      • Unit - A unit Is attacked
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Attacking unit) Equal to Threater[1]
        • Then - Actions
          • Set ThreatValue[1] = (ThreatValue[1] + ((Hero level of Threater[1]) x 2))
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Attacking unit) Equal to Threater[2]
        • Then - Actions
          • Set ThreatValue[2] = (ThreatValue[2] + ((Hero level of Threater[2]) x 2))
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Attacking unit) Equal to Threater[3]
        • Then - Actions
          • Set ThreatValue[3] = (ThreatValue[3] + ((Hero level of Threater[3]) x 2))
        • Else - Actions
  • Casting Threat
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Triggering unit) Equal to Threater[1]
        • Then - Actions
          • Set ThreatValue[1] = (ThreatValue[1] + ((Level of (Ability being cast) for (Triggering unit)) x 7))
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Triggering unit) Equal to Threater[2]
        • Then - Actions
          • Set ThreatValue[2] = (ThreatValue[2] + ((Level of (Ability being cast) for (Triggering unit)) x 7))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Triggering unit) Equal to Threater[3]
            • Then - Actions
              • Set ThreatValue[3] = (ThreatValue[3] + ((Level of (Ability being cast) for (Triggering unit)) x 7))
            • Else - Actions
        • Else - Actions
  • Force Attack
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • And - All (Conditions) are true
            • Conditions
              • ThreatValue[1] Greater than ThreatValue[2]
              • ThreatValue[1] Greater than ThreatValue[3]
        • Then - Actions
          • Unit - Order Boss to Attack Threater[1]
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • And - All (Conditions) are true
            • Conditions
              • ThreatValue[2] Greater than ThreatValue[1]
              • ThreatValue[2] Greater than ThreatValue[3]
        • Then - Actions
          • Unit - Order Boss to Attack Threater[2]
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • And - All (Conditions) are true
            • Conditions
              • ThreatValue[3] Greater than ThreatValue[1]
              • ThreatValue[3] Greater than ThreatValue[2]
        • Then - Actions
          • Unit - Order Boss to Attack Threater[3]
        • Else - Actions
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
Maker will get +rep and given credits.

Yay! ;D

Looks quite good to me. Small changes:

  • Attack Threat
    • Events
      • Unit - A unit Is attacked
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Attacking unit) Equal to Threater[1]
        • Then - Actions
          • Set ThreatValue[1] = (ThreatValue[1] + ((Hero level of Threater[1]) x 2))
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Attacking unit) Equal to Threater[2]
            • Then - Actions
              • Set ThreatValue[2] = (ThreatValue[2] + ((Hero level of Threater[2]) x 2))
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Attacking unit) Equal to Threater[3]
                • Then - Actions
                  • Set ThreatValue[3] = (ThreatValue[3] + ((Hero level of Threater[3]) x 2))
                • Else - Actions
  • Casting Threat
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Triggering unit) Equal to Threater[1]
        • Then - Actions
          • Set ThreatValue[1] = (ThreatValue[1] + ((Level of (Ability being cast) for (Triggering unit)) x 7))
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
          • (Triggering unit) Equal to Threater[2]
            • Then - Actions
              • Set ThreatValue[2] = (ThreatValue[2] + ((Level of (Ability being cast) for (Triggering unit)) x 7))
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
              • (Triggering unit) Equal to Threater[3]
                • Then - Actions
              • Set ThreatValue[3] = (ThreatValue[3] + ((Level of (Ability being cast) for (Triggering unit)) x 7))
                • Else - Actions

  • Force Attack
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • And - All (Conditions) are true
            • Conditions
              • ThreatValue[1] Greater than ThreatValue[2]
              • ThreatValue[1] Greater than ThreatValue[3]
        • Then - Actions
          • Unit - Order Boss to Attack Threater[1]
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • And - All (Conditions) are true
            • Conditions
              • ThreatValue[2] Greater than ThreatValue[1]
              • ThreatValue[2] Greater than ThreatValue[3]
        • Then - Actions
          • Unit - Order Boss to Attack Threater[2]
        • Else - Actions
          • Unit - Order Boss to Attack Threater[3]


Not sure if every one second is good event. You could try higher value. Or run the trigger every time a new "highest threat unit" is chosen. You should check that the new order target is not the current target. Since the new order interrupt current order.
 
Level 10
Joined
Mar 19, 2010
Messages
622
Not sure if every one second is good event. You could try higher value. Or run the trigger every time a new "highest threat unit" is chosen. You should check that the new order target is not the current target. Since the new order interrupt current order.

So will it be better if I set it to every 5 seconds?
Or can you give me an example of how to make a trigger to choose a new "highest threat unit"?
Thanks for reply. + rep!
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
Create a variable called Boss_Target (unit) or something like that. Before ordering the boss to attack any unit check that the selected unit is not equal to Boss_Target. if it's the same unit, nothing should happen as the unit is already being attacked by the boss. But if it is different unit, set Boss_Target = selected target and order the boss to attack Boss_Target.
 
Status
Not open for further replies.
Top