• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[Trigger] Why does it not work?

Status
Not open for further replies.
Level 17
Joined
Jun 12, 2007
Messages
1,261
  • jl
    • Events
      • Time - Every 0.20 seconds of game time
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Unit Group - Pick every unit in (Units currently selected by (Picked player)) and do (Actions)
            • Loop - Actions
              • Selection - Remove (Picked unit) from selection for (Picked player)
 
Level 22
Joined
Jun 24, 2008
Messages
3,050
Hmn. At first glance i see no errors.
I guess its cause you pick the player in the last line, but it should work properly.

Did you try with another event? Such as escape?

And you can also try to save the players into a Player variable (Player[]) And then do from integer1-12, and use Player[Loop A] Instead of picked. It might work.
 
Level 17
Joined
Jun 12, 2007
Messages
1,261
Hmn. At first glance i see no errors.
I guess its cause you pick the player in the last line, but it should work properly.

Did you try with another event? Such as escape?

And you can also try to save the players into a Player variable (Player[]) And then do from integer1-12, and use Player[Loop A] Instead of picked. It might work.

Basically I want to deselect certain units when selected by a player.
But it wont do anything! The trigger hates me.. =(
I tried replacing trigger so it would show a message but nothing!

Is there an other way to deselect certain units lets say if the unit is in a unit group called NOSELECTION xD. That's what I want. :p
Or even better, when custom value is 1. =:D
 
Level 17
Joined
Jun 12, 2007
Messages
1,261
can't you simply use:

  • Actions
    • Playergroup - Pick every player in (All players) and do (Actions)
      • Loop - Actions
        • Selection - Clear selection for (Picked player)

Well, I need to check if a unit is in a certain group because not all units are supposed to be unselectable.
So I need to run an if/then/else at a certain point. And without picking units I can't say for example picked unit is in unit group A or something like that.
 
Level 17
Joined
Jun 12, 2007
Messages
1,261
well i made it from the original post, but you want something like that:
a player selects 12 units, and like 4 of them are supposed not to be selectable, and those 4 should be removed from selection?

Yes, basically that's true.
But the trigger I made for that just wont run himself.
I think it's because I create a loop inside a loop. Not sure though..

EDIT: In the trigger I posted in the first post I deleted all the if/then/else mumbo jumbo.
 
Level 12
Joined
Aug 22, 2008
Messages
911
Change the Event:
  • Events
    • Player - Player 1 selects a unit
    • -------- Such event for each player --------
  • Conditions
    • -------- Here you make sure it's the unit-type you want and all --------
  • Actions
    • Selection - Remove (Unit - not sure how to refer) from selection of (Triggering Player - or something)
I know it's kind of fucked up, but I guess you get the idea.
 
Level 17
Joined
Jun 12, 2007
Messages
1,261
Change the Event:
  • Events
    • Player - Player 1 selects a unit
    • -------- Such event for each player --------
  • Conditions
    • -------- Here you make sure it's the unit-type you want and all --------
  • Actions
    • Selection - Remove (Unit - not sure how to refer) from selection of (Triggering Player - or something)
I know it's kind of fucked up, but I guess you get the idea.
Hey there is a selection event, never saw that.
 
Level 1
Joined
Feb 12, 2005
Messages
6
I'm sure there is a problem with the Selection - Remove part
  • jl
    • Events
      • Time - Every 0.20 seconds of game time
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Unit Group - Pick every unit in (Units currently selected by (Picked player)) and do (Actions)
            • Loop - Actions
              • Selection - Remove (Picked unit) from selection for (Picked player)
Maybe the cause of this problem lies in there because it's only for one unit right? So you can't deselect a whole group, I think.

Plz correct me if I'm wrong.
 
Last edited:
Status
Not open for further replies.
Top