HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Need help with kick trigger

10-16-2002, 10:46 AM#1
Guest
I am trying to make this tower defence map, where you can kick people (well, duh!), any I want to make it so that when they are kicked all their buildings and units are sold and that players total cash (including the amount given from the sold buildings/units) is divided amoung the remaining players. I had it working, but I had other problems and now it doesn't work, however I think the new system i have is better (even if it doesn't work now).

Here is my triggers (why doesn't it work)

Trigger ONE:

Events: None
Condtions: None
Actions: Player Group - Pick every player in (All Players matching ((Picked Player) slot status) Equal to has left the game)) and do (Leaderboard - Change the label for (Picked Player) in (last created leaderboard) to -Disconnected-)

If (BlueKicked Equal to True) then do (Unit Group - Pick every unit in (Units owned by Player 2 (Blue)) and do (Player - Add (Point-value of (Picked Unit)) to Player 2 (Blue) current Gold)) else (Do nothing)

If (BlueKicked Equal to True) then do (Set GoldTemp = Player 2 (Blue) current Gold) else (Do Nothing)

"Repeat for all players..."

Trigger - Run Gold Distribution <gen> (checking condtions)

TRIGGER TWO:

Events: None
Conditions: None
Actions: Player Group - Pick ever player in (All Players matching (((Picked Player) slot status) Equal to is playing)) and do (Player Group - Add (Picked Player) to Player Group)

Set NumPlayersPlayerGroup = (Number of players in PlayerGroup)

Player Group - Pick every player in (All players matching (((Picked Player) slot status) Equal to is playing)) and do (Player - Add (GoldTemp/NumPlayersPlayerGroup) to Picked Player Current gold)

Wait 1.00 seconds

If (BlueKicked Equal to True) then do (Unit Group - Remove all units of (Units owned by Player 2 (Blue)) from (Units in Playable map area))) else do (Do Nothing)

If (BlueKicked Equal to True) then do (Player - Set Player 2 (Blue) Current gold to 0) else do (Do Nothing)

If (BlueKicked Equal to True) then do (Set BlueKicked = False) else do (Do Nothing)

"Repeat for all players..."

Set GoldTemp = 0

End of all triggers "PHEW!" :P

If anyone can see what is wrong with this then could they please tell me or if you need I can send you my map. Thanx and hope you can help :P
10-16-2002, 10:53 AM#2
xttocs
Dont make another TD map....
10-16-2002, 12:10 PM#3
Guest
hehe....the guy above me is right...but anyway, I'll try to help you.

I didn't even bother reading through most of your code, because I see a mistake already. There is no event. If there's no event, that trigger will never be triggered. Try using Event - Every 5 Seconds of Game Time or something. After you do that, it should be working properly as long as your code is right...
10-17-2002, 12:31 AM#4
Guest
woops sorry...

yeh the trigger does actually run!

it is run when a player is kicked

when that happens then that trigger runs the first one

The trigger when a player is kicked is

Event: Player 1 (Red) types a chat message containing kick 02 as An exact match

Condtions: None

Actions: Game - Defeat Player 2 (Blue) with the message: blah
Set BlueKicked = True
Trigger - Run (my first trigger I talked about at the top of my previous post)

I have triggers like this for all the other players and they all link to the first trigger I posted.

Sorry I thought I said that and could someone please help me!
10-17-2002, 01:11 AM#5
ChronOmega
Quote:
Pick every player in (All Players matching (Picked Player))


thats what wrong if you pick all players matching picked player than it wont pick anyone

tell it to pick all players
10-17-2002, 01:24 AM#6
ph33rb0
Quote:
Originally posted by BeerGut

Event: Player 1 (Red) types a chat message containing kick 02 as An exact match

Sooo much easier if you make the event kick as a substring and then use a substring function to get the number and convert to integer.