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

Trigger Help {checking if player has unit of <type>}

Status
Not open for further replies.
Level 5
Joined
Nov 14, 2008
Messages
119
Hey,how can i make a trigger only available for 1 personal as in like a person type -male and another -female,supposingly only 1 female and 1 male and 3 childs as it is 5v5,if the person with a male or female unit types -child the childs born,how do i make the trigger check if the person typing has a male or female,because i only want 1 male 1 female and 3 childs.

Help will be greatly appreciated.
 
Last edited:
Level 18
Joined
Mar 7, 2005
Messages
824
Uhm.. i don't get you.. please tell me more, do you want to make a 5on5 map? and the 5 players are randomly male, female or one of the 3 children? (yeah plural is children not childs :p) or do you just want to check wether the player got a male or female or both as a unit and only if it's true he can get a child by typing something??

If you have the ingame unit, then just do this..

- Player X enters string "-child"
-- pick all units owned by "player X"
-->If unit-type of picked unit equalt to "male" or "female"
-->then do create 1 child for owner of picked unit at Positon XY...

something like this, pretty simple.. if you want to have some male or female sorted players from the beginning i suggest you to rename the Teams to "Male, Female, 3x Children" or something like that and use player positions, like player1 is male, player 2 female, other 3 players are children.. or else.. more information would be helpfull
 
Level 5
Joined
Nov 14, 2008
Messages
119
I want the players to type -male at start and another player to type -female at start too,the others without a male or female must type -child to get the child unit,but i dont want the player with the male or female unit to have a child,how do i check if they have a male or female unit?+rep Tr!KzZ
 
Level 18
Joined
Mar 7, 2005
Messages
824
just use some variables for it..
some kinda boolean value.. like "male" with array according to the number of players
do the same with female..
Also add another variable based on Integer value, that counts the allowed amount of Female or Male units (FA or MA)

Now you only have to check it..

Event: A Player enters "-male"
Condition: none
Actions:
If MA is less than 2 (or any other number you want to use)
> if male[player number of triggering player] equal to "false"
> then create 1 "male" for triggering player at position xy
> set male[player number of triggering player] to true
> set MA = MA + 1
else show a text message here that the limit of male units is reached or the player already got a male unit.. just type here what you want into the textmessage shown to this player
 
Status
Not open for further replies.
Top