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

[Trigger] Repick

Status
Not open for further replies.
Level 8
Joined
Jul 10, 2018
Messages
383
hi Im trying to fix Repick system by making it only Remove heroes but it aint working
  • Unit Group - Pick every unit in (Units in (Playable map area) owned by (Triggering player)) and do (Actions)
    • Loop - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Picked unit) is A Hero) Equal to True
        • Then - Actions
          • Unit - Remove (Picked unit) from the game
        • Else - Actions
this is not the whole trigger
 
Level 8
Joined
Jul 10, 2018
Messages
383
Save the picked unit to a variable and remove the variable instead.
How do I do that? like this?

  • Set RemovedUnit = (Picked unit)
  • Unit Group - Pick every unit in (Units in (Playable map area) owned by (Triggering player)) and do (Actions)
    • Loop - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Picked unit) is A Hero) Equal to True
        • Then - Actions
          • Unit - Remove RemovedUnit from the game
        • Else - Actions
 
How do I do that? like this?

  • Set RemovedUnit = (Picked unit)
  • Unit Group - Pick every unit in (Units in (Playable map area) owned by (Triggering player)) and do (Actions)
    • Loop - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Picked unit) is A Hero) Equal to True
        • Then - Actions
          • Unit - Remove RemovedUnit from the game
        • Else - Actions

No, you don't need to set it to a variable when you remove it, only when you pick it. I assume this is for a hero pick system?

  • Pick
    • Events
      • Unit - A unit enters Region 000 <gen>
    • Conditions
    • Actions
      • Unit - Create 1 Paladin for Player 1 (Red) at (Center of (Playable map area)) facing Default building facing degrees
      • Set PickedHero = (Last created unit)
  • Remove
    • Events
      • Player - Player 1 (Red) types a chat message containing -repick as An exact match
    • Conditions
    • Actions
      • Unit - Remove PickedHero from the game

This is the gist of it but should give you a general idea.
 

Wrda

Spell Reviewer
Level 26
Joined
Nov 18, 2012
Messages
1,887
This doesn't make any sense at all. All these options are fine, why yours wouldn't work?
this is not the whole trigger
THEN POST THE WHOLE DAMN TRIGGER. This is the 3rd time you post a partial trigger instead if you posted the full trigger you wouldn't be wasting everyone's time, including yours. Why wouldn't you post the full trigger anyway?
The only reason yours wouldn't work is because of the trigger's event, and the event response doesn't match that, so fix it. I bet all my money that's the problem.
 
Level 8
Joined
May 21, 2019
Messages
435
Your action works fine, so the problem is probably the event.
In general, it's a very good method of diagnostics to check if event is even triggered, for example, with an endgame message saying "Triggered" at the very start of the trigger. If that doesn't appear, you know that the trigger isn't even being run.

Also, please, post the whole trigger the next time. It helps.

THEN POST THE WHOLE DAMN TRIGGER.
Deep breaths man, deep breaths.
 
Level 8
Joined
May 21, 2019
Messages
435
Player - Player 1 (Red) types a chat message containing -repick as An exact match
Minor detail, don't know if it has been changed since I last saw it, but hitting the "-" (minus) sign, even in a chat message, will reduce the game speed in single player. As a result, I tend to use / (slash) instead. Of course, it's only a matter of hitting the plus key to reverse it, but it's still a pretty bothersome detail.
 
Level 8
Joined
May 21, 2019
Messages
435
"-" doesn 't reduce game speed if you're going to type a message.
Like I said, may have changed since I saw it, which was well over a decade ago. I still recommend avoiding it in case people hit it out of order though.
Thanks for the update in any case!
 
Status
Not open for further replies.
Top