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

[Solved] Gold Trigger

Status
Not open for further replies.
Level 5
Joined
Sep 27, 2011
Messages
141
Can someone Please help me fix the following trigger


  • Set Worker_Group = (Units in (Playable map area) matching (((Matching unit) is Undead) Equal to True))
  • Unit Group - Pick every unit in Worker_Group and do (Actions)
    • Loop - Actions
      • Set Worker_Pos = (Position of (Picked unit))
      • Set Gold_Coins_Group = (Units within 80.00 of Worker_Pos matching ((((Matching unit) is alive) Equal to True) and ((Unit-type of (Matching unit)) Equal to Gold Coin)))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Owner of (Picked unit)) is an ally of Player 1 (Red)) Equal to True
        • Then - Actions
          • Set Resources[1] = (Resources[1] + (Number of units in Gold_Coins_Group))
        • Else - Actions
          • Do nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Owner of (Picked unit)) is an ally of Player 6 (Orange)) Equal to True
        • Then - Actions
          • Set Resources[2] = (Resources[2] + (Number of units in Gold_Coins_Group))
        • Else - Actions
          • Do nothing
      • For each (Integer A) from 1 to (Number of units in Gold_Coins_Group), do (Actions)
        • Loop - Actions
          • Unit - Remove (Random unit from Gold_Coins_Group) from the game
  • Custom script: call DestroyGroup(udg_Worker_Group)
  • Custom script: call DestroyGroup(udg_Gold_Coins_Group)
  • Custom script: call RemoveLocation(udg_Worker_Pos)
The trigger is meant to increase resources when the worker unit is near them then remove the gold coin however nothing happens.
 
Last edited by a moderator:
Level 5
Joined
Sep 27, 2011
Messages
141
Srry your system didnt work quite how i wanted it to it needs to add to either resource 1 for team 1 or resource 2 for team 2 and i had exactly the same event as you
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
  • gather
    • Events
      • Time - Every 0.25 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in worker_group and do (Actions)
        • Loop - Actions
          • Set temp_unit = Picked unit
          • Set temp_point = (Position of (Picked unit))
          • Set temp_team = (Owner of (Picked unit))
          • Custom script: set bj_wantDestroyGroup = true
          • Unit Group - Pick every unit in (Units within area_pick of temp_point matching ((Unit-type of (Matching unit)) Equal to Footman)) and do (Actions)
            • Loop - Actions
              • If owner of temp_unit is an ally of P1 then
                • Add resource to team 1
              • Else Add resource to team 2
              • Endif
              • Unit - Remove picked unit from the game
          • Custom script: call RemoveLocation(udg_temp_point)
 
Status
Not open for further replies.
Top