How to kill a chooser after already choosing with a different command.

aussj4link

New Member
Reaction score
3
ok check this out, in this map there is a hero choosing system that uses a wisp to enter a circle with a hero on it and it will basically create that hero for them and kill the wisp, i wanted to make some special "secret", if u will, heros that could be chosen by typing a chat message, it works but i also want that if you use the chat message it will kill the wisp so that they cant hav 2 hero's ya know, i dont know how to put it in the little window thing you guys put it in so i just copied and pasted text, heres the trigger:


Bebi
Events
Player - Player 1 (Red) types a chat message containing got milk as An exact match
Conditions
((Name of (Triggering player)) Equal to aussj4link) or ((Name of (Triggering player)) Equal to tugboatcapt)
Actions
Camera - Pan camera for Player 1 (Red) to (Center of EndTeam1 <gen>) over 2.00 seconds
Unit - Create 1 Bebi (Evil) for Player 1 (Red) at (Center of EndTeam1 <gen>) facing Default building facing degrees

Ok, what i was thinking was that in the conditions the wisp wud hav to be alive, and in the actions he wud die when the message is typed. but there is no condition like that, or maybe i missed it somwhere, if so please direct me lol. any help at all on this would be greatly appeciated. thx
 

aussj4link

New Member
Reaction score
3
omg... r u serious, i thought that was for checking what kinda unit it was not if its alive... jeez.... i am such an idiot, thank you tho lol.
 

aussj4link

New Member
Reaction score
3
ok wud this b right? it creates the wisp after difficulty has been chosen, so i cant pick the exact unit so im hoping that it would b the last creted unit:

Bebi
Events
Player - Player 1 (Red) types a chat message containing got milk as An exact match
Conditions
True Equal to ((Last created unit) is alive)
((Name of (Triggering player)) Equal to aussj4link) or ((Name of (Triggering player)) Equal to tugboatcapt)
Actions
Unit - Kill (Last created unit)
Camera - Pan camera for Player 1 (Red) to (Center of EndTeam1 <gen>) over 2.00 seconds
Unit - Create 1 Bebi (Evil) for Player 1 (Red) at (Center of EndTeam1 <gen>) facing Default building facing degrees
 

aussj4link

New Member
Reaction score
3
yes just one, but its created after difficulty has been chosen by red, then they move the wisp into the circle of the hero they want, but in this case, the hero is made by typing a message, so i need it to destroy that wisp if they type the message.
 

Sim

Forum Administrator
Staff member
Reaction score
534
> True Equal to ((Last created unit) is alive)

This will sometime be True for no reason because some other unit you created previously will be alive.

When you create the wisps, store them into a unit array variable, 1 being the wisp of player1, 2 being the wisp of player 2... etc. Store them as Last Created Unit each time.

Then check if the unit array (player 1? let's use player1's) is alive.

Something like
Create 1 wisp for Player 1 (Red) at blablabla...
Set Wisp[1] = (Last Created Unit)

**later**

in the above trigger's Conditions, do that :
(Wisp[1] is Alive) Equal to True

blablabla

If you need help because I'm not clear say it now I'll write the trigger.
 

ragingspeedhorn

Is a Banned Asshole
Reaction score
94
So instead of last created unit have unit of type owned by player.

So it picks any units of type wisps owned by whatever player you want and removes it.
 

Sim

Forum Administrator
Staff member
Reaction score
534
There are no such functions in Conditions. You cannot look if the unit is owned by the player. That's why I suggested the unit array variable.

Look, I'll write the trigger hold on.
 

aussj4link

New Member
Reaction score
3
lol i like ragingspeed's fix better lol, malto's sounds alot more complicated lol. hmmm, i hate to make you do more than u need by cud u make that code real fast please?
 

Sim

Forum Administrator
Staff member
Reaction score
534
I understand what you mean for ragingspeed's thingy but here look at mine.

Code:
SetWisps
    Events
    The_Events_Corresponding_With_Your_Difficulty_Choosing
    Conditions
    Whatever
    Actions
        Create 1 <UNIT> for Player1
        Set UNITEXEMPLE[1] = (Last created unit)
        Create 1 <UNIT> for Player1
        Set UNITEXEMPLE[2] = (Last created unit)
        Repeat between each UNITEXEMPLE
        Set UNITEXEMPLE[3] = (Last created unit)
        Set UNITEXEMPLE[4] = (Last created unit)
        Set UNITEXEMPLE[5] = (Last created unit)
        Set UNITEXEMPLE[6] = (Last created unit)
        Set UNITEXEMPLE[7] = (Last created unit)
        Set UNITEXEMPLE[8] = (Last created unit)
        Set UNITEXEMPLE[9] = (Last created unit)
        Set UNITEXEMPLE[10] = (Last created unit)
        Set UNITEXEMPLE[11] = (Last created unit)
        Set UNITEXEMPLE[12] = (Last created unit)

Above trigger is for if you need more than 1 player...

Code:
WispRemoveChat
    Events
        Player - Player 1 (Red) types a chat message containing got milk as An exact match
    Conditions
        ((Name of (Triggering player)) Equal to his_name) or ((Name of (Triggering player)) Equal to Other_Name)
        (UNITEXEMPLE[(Player number of (Triggering player))] is alive) Equal to True
    Actions
        THE_ACTIONS_YOU_WISH

As I told you, if you don't need more than 1 player replace UNITEXEMPLE with a normal unit variable with no array and just look if that variable is ok (in WispRemoveChat trigger) and set it once to (Last Created Unit) in SetWisp trigger.
 

aussj4link

New Member
Reaction score
3
awesome, thank you so much malto. i will put that in and see if it works heh. oh, theres 8 players, 4 teams 2 per team, so i shud b able to figure out how to make em for all that.
 

ragingspeedhorn

Is a Banned Asshole
Reaction score
94
Nice trigger work Malto, I admit your suggestion kinda owned mine (I just made it out of the top of my head, you really did some work) :)
 

Sim

Forum Administrator
Staff member
Reaction score
534
here's the trigger fully remade for it to work perfectly (well, untested but it should)

Replace (Center of (Playable map area)) with your region...

Code:
SetWisps
    Events
        Your_Events! What you could do if it's another trigger (I'm taling about the difficulty choosing one), you could Run it using "Trigger - Run SetWisps <gen>"
    Conditions
        Whatever
    Actions
        Unit - Create 1 Wisp for Player 1 (Red) at (Center of (Playable map area)) facing Default building facing degrees
        Set UNITEXEMPLE[1] = (Last created unit)
        Unit - Create 1 Wisp for Player 2 (Blue) at (Center of (Playable map area)) facing Default building facing degrees
        Set UNITEXEMPLE[2] = (Last created unit)
        Unit - Create 1 Wisp for Player 3 (Teal) at (Center of (Playable map area)) facing Default building facing degrees
        Set UNITEXEMPLE[3] = (Last created unit)
        Unit - Create 1 Wisp for Player 4 (Purple) at (Center of (Playable map area)) facing Default building facing degrees
        Set UNITEXEMPLE[4] = (Last created unit)
        Unit - Create 1 Wisp for Player 5 (Yellow) at (Center of (Playable map area)) facing Default building facing degrees
        Set UNITEXEMPLE[5] = (Last created unit)
        Unit - Create 1 Wisp for Player 6 (Orange) at (Center of (Playable map area)) facing Default building facing degrees
        Set UNITEXEMPLE[6] = (Last created unit)
        Unit - Create 1 Wisp for Player 7 (Green) at (Center of (Playable map area)) facing Default building facing degrees
        Set UNITEXEMPLE[7] = (Last created unit)
        Unit - Create 1 Wisp for Player 8 (Pink) at (Center of (Playable map area)) facing Default building facing degrees
        Set UNITEXEMPLE[8] = (Last created unit)

And the second one...

Code:
CheatedHero
    Events
        Player - Player 1 (Red) types a chat message containing got milk as An exact match
        Player - Player 2 (Blue) types a chat message containing got milk as An exact match
        Player - Player 3 (Teal) types a chat message containing got milk as An exact match
        Player - Player 4 (Purple) types a chat message containing got milk as An exact match
        Player - Player 5 (Yellow) types a chat message containing got milk as An exact match
        Player - Player 6 (Orange) types a chat message containing got milk as An exact match
        Player - Player 7 (Green) types a chat message containing got milk as An exact match
        Player - Player 8 (Pink) types a chat message containing got milk as An exact match
    Conditions
        ((Name of (Triggering player)) Equal to his_name) or ((Name of (Triggering player)) Equal to Other_Name)
        (UNITEXEMPLE[(Player number of (Triggering player))] is alive) Equal to True
    Actions
        THE_ACTIONS !! (l33t)

Here, this should work.
 

aussj4link

New Member
Reaction score
3
jut 2 questions atm, wisps r already being created, so wouldn't this make 2 wisps? and by "UNITEXAMPLE" what exactly do u mean by that? cuz if itsa trigger i cant find it, whats it under.

-Edit: o wait nevermind, i found it, under set variable and then edit variables right? o and what variable type is it?
 

Sim

Forum Administrator
Staff member
Reaction score
534
not edit, Create new variable. Unit variable and check array, set its size to 8.

> jut 2 questions atm, wisps r already being created, so wouldn't this make 2
> wisps? and by "UNITEXAMPLE" what exactly do u mean by that? cuz if itsa
> trigger i cant find it, whats it under.

Well just add, AFTER EACH WISP CREATION, Set UNITEXAMPLE[1] = (Last Created Unit)

and change the 1 to 2, then to 3, then to 4, then to 5 after each wisp creation.
 

aussj4link

New Member
Reaction score
3
will it effect anything if players 4,9,11, and 12 are computers? should the numbers after UNITEXEMPLE be that of the players number? lol if this sounds dumb its because im not sure exactly what all this means.
 

aussj4link

New Member
Reaction score
3
lol I'm actually editing an abondoned map, trying to make it cool again, doin alot of stuff to it really, but im still giving all credit to the original creator, but I'm a noob when it comes to map building, so a friend told me a should take an old map and edit it and play with it a bunch to get better with the editor, so i decided to take this map and add-on a whole buncha stuff im hopes ill learn everything i need to make my own map from scratch.
 

Sim

Forum Administrator
Staff member
Reaction score
534
yea numbers between [ ] are player numbers. Just remove the 4th one.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top