• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

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: 48
Status
Not open for further replies.
Top