HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Why doesn't this action work?

10-24-2003, 06:35 AM#1
AllPainful
I created a trigger that runs 1 second into the game. But this action doesn't seem to work:

Player Group - Pick every player in (All players matching (((Matching player) slot status) Equal to Is unused)) and do (Unit Group - Pick every unit in (Units owned by (Picked player)) and do (Unit - Remove (Picked unit) from the game))

The reason I have this trigger is because I have "Starting" units already placed for the players, but I need to remove the units for the players that aren't in the game. Anyone know why it isn't working?
10-24-2003, 06:53 AM#2
Grater
try "... not equal to (is playing)"
10-24-2003, 07:19 AM#3
AllPainful
Thanx, I'll try that.

Do you know why it doesn't work the way it is now though?
10-24-2003, 08:21 AM#4
Grater
Wanted to know why too huh?
My guess is that "not used" means it's set to no player in the world editor settings... not "set to user but no-one joined"

Also theres no particular reason to have "not is playing" when you can just use "not equal to is playing"
10-24-2003, 09:22 AM#5
AllPainful
Didn't work...

Here's the deal, I have BUILDINGS (maybe thats why it wont remove em?) that are preplaced for all players (4 players possible) an I want them to be removed if the player is not in the game. Maybe you can make me a trigger that WILL work?
10-24-2003, 09:46 AM#6
Cacodemon
Try this construction:

Pick units in (playable map area) matching condition: (OwnerOf(PickedUnit) player slot status is (not equal to (playing))) and remove (picked unit)

And you've chosen event wastes your resources! Execute this action only if any player has left the game!
10-24-2003, 10:08 AM#7
AllPainful
First off, its not an event that wastes my resources because it a NEEDED event that runs LOTS if init stuff for my map. AND I needed those units removed at the beginning.

Second off, THANK YOU - THANK YOU - THANK YOU... for some reason reorganising the action like you stated worked...

Thirdly.. You wouldn't happen to know WHY it didn't work the other way would you? seems how both ways are exactly the same just picking units instead of picking players..
10-24-2003, 07:18 PM#8
Cacodemon
Ok, you can ask me if you need help next time.

I'm JASS scriptwriter so I've forgot those WE actions. But I guess your trigger doesn't work because of using Picked player instead of Matching. Try this (I'm not sure it works):

Player Group - Pick every player in (All players matching (((Matching player) slot status) Equal to Is unused)) and do (Unit Group - Pick every unit in (Units owned by (Matching player)) and do (Unit - Remove (Picked unit) from the game))

Another reason may be following:

You are using Units owned by Player structure, but using PickEveryUnit in playable map area matching condition seems to be better.

But even if it will work, don't use it because my example is much more optimized.
10-24-2003, 09:13 PM#9
Arohk
I alltime use this triggers,

Event- Every 3 seconds of game time

Conditions- ((Player 1 (Rot) slot status) Gleich has left the game) or ((player 1 (Rot) slot status) Gleich not used)

Action-
Einheitengruppe - Pick every unit in (Units owned by player 1 (Rot)) and do (Einheit - Remove (Picked unit) from the game)
well now you can add a text like: Player1 has left the game!
Turn of (This trigger)


the only thing , you need to make it for every single player, the example only works for player1
but it works :ggani:
10-24-2003, 09:23 PM#10
SourGummiWorm
arohk


you should use a different trigger for that...

event: player 1 (rot) leaves the game....

then it will only run when it needs to not every 3 seconds
10-24-2003, 10:33 PM#11
Cacodemon
See my first reply :) Not second where I've described bugs =)
10-24-2003, 10:34 PM#12
Arohk
If you mean this Event
"Player - Player 1 (Rot) leaves the game with a defeat"
This dont works if the player leave the game, only when he get defeated
10-24-2003, 10:47 PM#13
Grater
I just figured out why the original trigger didn't work, and it's *really* obvious when you think about it.

All Players contains only those players who are actually playing 0_o

To make the original work, you would want to do to use a for loop to select every player by player # then a if/then/else to remove their buildings.

edit: Yes I did test the All Players thing, it includes only human and computer players, not neutral players.