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

Ctf

Status
Not open for further replies.
Level 8
Joined
Jun 16, 2008
Messages
333
Why won't this work?
  • Capture
    • Events
      • Unit - A unit enters Region 001 <gen>
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Human
      • ((Triggering unit) has Horde Flag 0000 <gen>) Equal to True
    • Actions
      • Set HumanG = (All allies of Player 1 (Red))
      • Set OrcG = (All allies of Player 6 (Orange))
      • Item - Move Horde Flag 0000 <gen> to (Center of Region 002 <gen>)
      • Player Group - Pick every player in OrcG and do (Actions)
        • Loop - Actions
          • Unit - Move (Picked unit) instantly to (Random point in Region 007 <gen>)
      • Player Group - Pick every player in HumanG and do (Actions)
        • Loop - Actions
          • Unit - Move (Picked unit) instantly to (Center of Region 006 <gen>)
      • Set HumanScore = (HumanScore + 1)
      • Game - Display to (All players) the text: ((Name of (Owner of (Triggering unit))) + has just scored for the Humans!)
      • Custom script: call RemoveLocation(udg_OrcLoc)
      • Custom script: call DestroyForce(udg_HumanG)
      • Custom script: call DestroyForce(udg_OrcG)
      • Trigger - Turn on Game On <gen>
 
Level 14
Joined
Nov 18, 2007
Messages
1,084
You're referring to Picked unit even though no group enumeration was done.
Do the moving action under this for both force enumeration:
  • Custom script: set bj_wantDestroyGroup = true
  • Unit Group - Pick every unit in (Units owned by (Picked player)) and do (Actions)
    • Loop - Actions
You're also leaking locations with Center of Region 002 <gen> and the other ones.
 
Level 8
Joined
Jun 16, 2008
Messages
333
  • Events
    • Capture
      • Events
        • Unit - A unit enters Region 001 <gen>
      • Conditions
        • (Unit-type of (Triggering unit)) Equal to Human
        • ((Triggering unit) has Horde Flag 0000 <gen>) Equal to True
      • Actions
        • Set HumanG = (All allies of Player 1 (Red))
        • Set OrcG = (All allies of Player 6 (Orange))
        • Set OrcLoc = (Center of Region 002 <gen>)
        • Item - Move Horde Flag 0000 <gen> to OrcLoc
        • Custom script: set bj_wantDestroyGroup = true
        • Player Group - Pick every player in OrcG and do (Actions)
          • Loop - Actions
            • Unit - Move (Picked unit) instantly to (Random point in Region 007 <gen>)
        • Custom script: set bj_wantDestroyGroup = true
        • Player Group - Pick every player in HumanG and do (Actions)
          • Loop - Actions
            • Unit - Move (Picked unit) instantly to (Center of Region 006 <gen>)
        • Set HumanScore = (HumanScore + 1)
        • Game - Display to (All players) the text: ((Name of (Owner of (Triggering unit))) + has just scored for the Humans!)
        • Custom script: call RemoveLocation(udg_OrcLoc)
        • Custom script: call DestroyForce(udg_HumanG)
        • Custom script: call DestroyForce(udg_OrcG)
        • Trigger - Turn on Game On <gen>
 
Level 14
Joined
Nov 18, 2007
Messages
1,084
That's not what I meant...
  • Player Group - Pick every player in OrcG and do (Actions)
    • Loop - Actions
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units owned by (Picked player)) and do (Actions)
        • Loop - Actions
          • Unit - Move (Picked unit) instantly to (Random point in Region 007 <gen>)
Do the same for HumanG. Remember to take care of the location leaks.
 
Status
Not open for further replies.
Top