• 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.
  • 💡 We're thrilled to announce that our upcoming texturing contest is in the works, and we're eager to hear your suggestions! Please take this opportunity to share your ideas in this theme discussion thread for the Texturing Contest #34!
  • 🏆 Hive's 7th HD Modeling Contest: Icecrown Creature is now open! The frozen wastes of Icecrown are home to some of Azeroth’s most terrifying and resilient creatures. For this contest, your challenge is to design and model a HD 3D monster that embodies the cold, undead, and sinister essence of Icecrown! 📅 Submissions close on April 13, 2025. Don't miss this opportunity to let your creativity shine! Enter now and show us your frozen masterpiece! 🔗 Click here to enter!

Whats wrong with fucking selection/Deseletion, shit...

Status
Not open for further replies.
Level 15
Joined
Nov 30, 2007
Messages
1,202
Whats wrong with selection/Deseletion...

I have been pulling my hairs out for hours and distilled my problem for you here:

  • select
    • Events
      • Player - Player 1 (Red) Selects a unit
    • Conditions
      • b Equal to True
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Triggering unit)) Equal to Town Hall
        • Then - Actions
          • Game - Display to (All players) the text: Selected: City
          • Set b = False
          • Selection - Select Farm 0001 <gen>
          • Set b = True
        • Else - Actions
          • Game - Display to (All players) the text: Selected: Other
  • deselet
    • Events
      • Player - Player 1 (Red) Deselects a unit
    • Conditions
      • b Equal to True
    • Actions
      • Game - Display to (All players) the text: Deselect
Basically I don't want Selection - Select Farm 0001 <gen> to be registered , thus b is set to false. But... for some ungodly reason it still goes through. And laughingly informs me that yes, a city was selected and deselected and then another unit was selected....
 
Last edited:
Level 12
Joined
Feb 22, 2010
Messages
1,115
That is probably because of delay with selection event.Try adding a wait action before "set b = true" to test it.
 
Level 15
Joined
Nov 30, 2007
Messages
1,202
That is probably because of delay with selection event.Try adding a wait action before "set b = true" to test it.

Yep that was it:

  • select
    • Events
      • Player - Player 1 (Red) Selects a unit
    • Conditions
      • b Equal to True
    • Actions
      • Set u[1] = u[0]
      • Set u[0] = (Triggering unit)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • u[1] Not equal to u[0]
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Triggering unit)) Equal to Town Hall
            • Then - Actions
              • Set b = False
              • Selection - Select Farm 0001 <gen>
              • Wait 0.00 seconds
              • Set b = True
              • Game - Display to (All players) the text: Selected: City
            • Else - Actions
              • Game - Display to (All players) the text: selected other
        • Else - Actions
          • Game - Display to (All players) the text: same selection found
 
Level 15
Joined
Nov 30, 2007
Messages
1,202
You can try just to directly filter the unit or unit type:

Code:
Event:
    Player selects a unit

Condition:
    TriggeringUnit != Farm 0001 <gen>

Action:

I did something of the sorts, the problem was more complicated then what i showed, but the issue was the same. Anyway, have finally solved it. (No TriggerSleepAction, if thats what you were worried about.)
 
Status
Not open for further replies.
Top