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!
Ok, I'll cut right to the chase, I need to figure out how to spawn a unit. But it's not that simple.
I can type "-1" to spawn one type of guy.
"-2" to spawn a differn't type of guy.
And "-3" to spawn another type of guy.
I'm pretty sure I can do THAT little part, but my problem is that I should only be able to have ONE guy on the map at all times.
That means in the begining of the game, I'd type:
"- (Then a 1, 2, or 3.)"
And if I happen to die, I can spawn a new guy. But only if my previous or current character is dead.
Thanks in advance.
First, make a random intiger variable, just call it "random" or something.
Next, on the initial spawn trigger make this action:
set variable- Set "random"= (random intiger bewtween 1 and 3)
if/then/else
If (random intiger) is equal to 1
Then Unit- creat (unit type 1) for (whatever player) at (whatever location)
else- do nothing
If (random intiger) is equal to 2
Then Unit- creat (unit type 2) for (whatever player) at (whatever location)
else- do nothing
If (random intiger) is equal to 3
Then Unit- creat (unit type 3) for (whatever player) at (whatever location)
else- do nothing
Then a second trigger with these same action under a "unit owned by player dies" event, so it does this every time a unit from a certain player is killed
umm ok my solution: (everything put into 1 trigger!)
Code:
[events]
Player 1 types.. containing "-1" as exact ..
Player 1 types.. containing "-2" as exact ..
Player 1 types.. containing "-3" as exact ..
Player 2 types.. containing "-1" as exact ..
Player 2 types.. containing "-2" as exact ..
Player 2 types.. containing "-3" as exact ..
[for all players, copy and paste work, everything into 1 trigger]
ok now 3 conditions, it should look like this:
Code:
[conditions]
- ((Units owned by (Triggering player) matching (((Unit-type of (Matching unit)) is Equal to [UNIT TYPE 1]) and (((Matching unit) is alive) is Equal to True))) is empty) is Equal to True
- ((Units owned by (Triggering player) matching (((Unit-type of (Matching unit)) is Equal to [UNIT TYPE 2]) and (((Matching unit) is alive) is Equal to True))) is empty) is Equal to True
- ((Units owned by (Triggering player) matching (((Unit-type of (Matching unit)) is Equal to [UNIT TYPE 3]) and (((Matching unit) is alive) is Equal to True))) is empty) is Equal to True
You can get there by doing this:
- New condition > boolean comparision > unit group is empty
- [unit group] > units owned by player matching condition
- [player] > event response - triggering player
- [condition] > and
- [condition 1] > boolean comparision > unit is alive > matching unit (is alive)
- [condition 2] > unit type comparision > unit type of unit > [unit] > machting unit
- is equal [your unit type 1]
ok thats the most important thing, now copy and paste this trigger 2 times and change the unit types for each unit type you have. of course we could put all stuff into one single condition by stuffing all 3 unit types into the unit group, but this will be enough.
so now you can do something like, just as you want it. you now should only check what chat string exactly was entered and which player entered the chat string. so it could look like:
Code:
[actions]
IF entered chat string is "-1" THEN create 1 [unit type 1] for [triggering player] at [wherever] facing [whatever]
Thanks, I had been considering doing something similar to that (Much less effective though, I would assume) But I figured that somebody might have a shorter way.
Meh. Beggers can't be choosers, eh?
hey what do you want more? all you want packed into 1 trigger, no variables, short code xD of course we could make it even shorter, but nobody could hardly reproduce it then
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.