• 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.

Part 2 of removing a players units :)

Status
Not open for further replies.
Level 5
Joined
Mar 12, 2005
Messages
117
Hi my next question is i have set a dialog to create units n stuff

however after the last unit is created i wanted the map to remove all the unused slots that did play in the begging this is my trigger

event - dialog: button click for last dialog

conditions: ((Random player from (all players matching((((Matching player)controller)equal to User)and(((matching player)slot status)Equal to is unused))))slot status)Equal to is unused.

Action: unit group: pick everyunits (units own by (triggering player)) and do actions
loop- unit remove picked unit.

now that trigger will only get rid of player 1 and that is because player 1 is the triggering player cos i click the dilog button.

so i changed the action trigger to

unit group: pick everyunits (units own by (Matching Player)matching(((Matching player)slot status) Equal to unused)) and do actions

loop- unit remove picked unit.

i have the trigger also pop up a message so i know the trigger has been activated but none of the units are removed in the 'unused' slots.

does anyone know where im going wrong in my code? :)
 
Level 4
Joined
May 6, 2006
Messages
79
just delete the condition

it's a common mistake to think random X from Xgroup will refer to every X there is in Xgroup

I don't know if I made myself clear

you want your trigger to ckeck if a player didn't show up so his/her units will be removed

I think this is the right version of your trigger:

event - dialog: button click for DialogX (assign your dialog a variable after creating it... unless it's the only dialog in your map)

Conditions: ............. nop! no conditions

Actions:

Player Group: pick every player in (All players matching(((Matching player)controller) equal to user)and(((Matching Player)slot status)equal to unused)) and do actions

Unit Group - Pick every units (Units owned by (picked player)) and do actions:

Unit - Remove (picked unit)




Ell I hope that's clear enough... tell me if it solved your problem
 
Status
Not open for further replies.
Top