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

Easy "-ally" trigger?(+rep)

Status
Not open for further replies.
Level 4
Joined
Aug 30, 2008
Messages
82
just wondering is there an easy way to do a -ally "color" trigger. without having to create several different triggers for several different players.

thanks...

ill +rep you for trying to help.
 
Level 9
Joined
Apr 3, 2008
Messages
700
You can't give green rep if your rep is <1.

To make such ally system you need to make a trigger with several events.
Also you can check entered chat string with string comparison.
And to optimize it you can use global array string variable & loop.
 
Level 3
Joined
Dec 21, 2008
Messages
26
Here :
Code:
Colour Init
    Events
        Map initialization
    Conditions
    Actions
        Set Player_Colour[1] = red
        Set Player_Colour[2] = blue
        Set Player_Colour[3] = teal
        Set Player_Colour[4] = purple
        -------- E.T.C : Keep adding to max players --------
        For each (Integer A) from 1 to 4, do (Actions)
            Loop - Actions
                Trigger - Add to Ally Trig <gen> the event (Player - (Player((Integer A))) types a chat message containing -ally  as A substring)
Code:
Ally Trig
    Events
    Conditions
        (Substring((Entered chat string), 1, 6)) Equal to -ally 
    Actions
        For each (Integer A) from 1 to 4, do (Actions)
            Loop - Actions
                Game - Display to (All players) the text: (Is the player ?  + ( Player :  + ((String((Integer A))) +  ?)))
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Substring((Entered chat string), 7, (Length of (Entered chat string)))) Equal to Player_Colour[(Integer A)]
                        (Integer A) Not equal to (Player number of (Triggering player))
                    Then - Actions
                        Player - Make (Triggering player) treat (Player((Integer A))) as an Ally
                        Game - Display to (All players) for 10.00 seconds the text: ((Name of (Triggering player)) + ( just allied  + (Name of (Player((Integer A))))))
                        Skip remaining actions
                    Else - Actions
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                (Substring((Entered chat string), 7, (Length of (Entered chat string)))) Equal to Player_Colour[(Player number of (Triggering player))]
                            Then - Actions
                                Game - Display to (All players) for 10.00 seconds the text: ((Name of (Triggering player)) +  tried to ally himself LOL.)
                                Skip remaining actions
                            Else - Actions

There we go :) It works for me :D
 
Status
Not open for further replies.
Top