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

System Problem

Status
Not open for further replies.

Deleted member 177737

D

Deleted member 177737

Hey,
I created a small system that allows the player to forage for food. But after doing a quick test I realized that the triggers are allowing the player to keep clicking the ability and keep triggering the trigger even if the ability is on cool down.
The trigger works, except that it allows the ability to keep triggering it.

EX of how the trigger looks:

  • Events
  • Unit - A unit Finishes casting an ability
  • Conditions
  • (Ability being cast) Equal to Forage
  • Actions
  • Set ForageSystemNumber = (Random integer number between 1 and 10)
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • ForageSystemNumber Equal to 1
    • Then - Actions
      • Environment - Change terrain type at (Position of (Casting unit)) to Lordaeron Winter - Grassy Snow using variation -1 in an area of size 1 and shape Circle
      • Set ForageRandomResourceNumber = (Random integer number between 2 and 10)
      • Set RandomInt[1] = (RandomInt[1] + ForageRandomResourceNumber)
      • Multiboard - Set the text for ResourcesMultiboard item in column 2, row 1 to (String(Resources[1]))
      • Game - Display to (All players) the text: (You manage to find + ((String(ForageRandomResourceNumber)) + food while foraging.))
    • Else - Actions
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • ForageSystemNumber Equal to 2
    • Then - Actions
      • Environment - Change terrain type at (Position of (Casting unit)) to Lordaeron Winter - Dirt using variation -1 in an area of size 1 and shape Circle
      • Game - Display to (All players) the text: You were unsuccessf...
    • Else - Actions
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • ForageSystemNumber Equal to 3
    • Then - Actions
      • Environment - Change terrain type at (Position of (Casting unit)) to Lordaeron Winter - Dirt using variation -1 in an area of size 1 and shape Circle
      • Game - Display to (All players) the text: You were unsuccessf...
    • Else - Actions
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • ForageSystemNumber Equal to 4
    • Then - Actions
      • Environment - Change terrain type at (Position of (Casting unit)) to Lordaeron Winter - Dirt using variation -1 in an area of size 1 and shape Circle
      • Game - Display to (All players) the text: You were unsuccessf...
    • Else - Actions
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • ForageSystemNumber Equal to 5
    • Then - Actions
      • Environment - Change terrain type at (Position of (Casting unit)) to Lordaeron Winter - Dirt using variation -1 in an area of size 1 and shape Circle
      • Game - Display to (All players) the text: You were unsuccessf...
    • Else - Actions
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • ForageSystemNumber Equal to 6
    • Then - Actions
      • Environment - Change terrain type at (Position of (Casting unit)) to Lordaeron Winter - Dirt using variation -1 in an area of size 1 and shape Circle
      • Game - Display to (All players) the text: You were unsuccessf...
    • Else - Actions
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • ForageSystemNumber Equal to 7
    • Then - Actions
      • Environment - Change terrain type at (Position of (Casting unit)) to Lordaeron Winter - Dirt using variation -1 in an area of size 1 and shape Circle
      • Game - Display to (All players) the text: You were unsuccessf...
    • Else - Actions
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • ForageSystemNumber Equal to 8
    • Then - Actions
      • Environment - Change terrain type at (Position of (Casting unit)) to Lordaeron Winter - Dirt using variation -1 in an area of size 1 and shape Circle
      • Game - Display to (All players) the text: You were unsuccessf...
    • Else - Actions
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • ForageSystemNumber Equal to 9
    • Then - Actions
      • Environment - Change terrain type at (Position of (Casting unit)) to Lordaeron Winter - Dirt using variation -1 in an area of size 1 and shape Circle
      • Game - Display to (All players) the text: You were unsuccessf...
    • Else - Actions
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • ForageSystemNumber Equal to 10
    • Then - Actions
      • Environment - Change terrain type at (Position of (Casting unit)) to Lordaeron Winter - Rough Dirt using variation -1 in an area of size 1 and shape Circle
      • Set ForageRandomResourceNumber = (Random integer number between 4 and 15)
      • Set RandomInt[1] = (RandomInt[1] + ForageRandomResourceNumber)
      • Multiboard - Set the text for ResourcesMultiboard item in column 2, row 1 to (String(Resources[1]))
      • Game - Display to (All players) the text: (You manage to find + ((String(ForageRandomResourceNumber)) + food while foraging.))
    • Else - Actions
Is there anyway to stop the trigger from turning on every time you click the ability when its on cool down?

I've attached the map below, the trigger is labeled "Forage 1" under the systems area. (Sorry couldn't upload the map so I uploaded the campaign. Just open Map01)
 

Attachments

  • Ev1.w3n
    1.1 MB · Views: 43
Status
Not open for further replies.
Top