Deathmatch triggers

Knatten

New Member
Reaction score
7
Hi, im gonna add a deathmatch system to my map and I want to get some advice. But first, how I want it to work.

There is 2 teams of 5 players from the start. If red types -normal or doesn't type anything in 30 sec of the game, normal 5v5 mode will be enabled. Ive got this part.

Now the DM mode, it's similar (sp?) to Pudge Wars exept it's FFA.

Red types -dm xx or -deathmatch xx, and the DM mode is enabled. The XX is the number of lives win. All players get unallied with eachother and cant ally again.

First question here. If I unally players with eachother, can they ally eachother again in the F11 window? Im using this action.
Code:
Deathmatch
    Events
        Player - Player 1 (Red) types a chat message containing -dm as An exact match
        Player - Player 1 (Red) types a chat message containing -deathmatch as An exact match
    Conditions
    Actions
        Player Group - Pick every player in (All players) and do (Actions)
            Loop - Actions
                Player - Make (Picked player) treat (Picked player) as an Enemy

Second question.

I want to detect what number ''XX'' is, and I have no idea how to do that.

Third question.

What kind of Variable should I use to set the lifes for each player? I'm thinking of using Integer for each player and setting it to XX, and reducing it by 1 each time a hero dies, set Integer -(minus) 1 for that player. Can i use Integer with array of 10?

P.S maybe someone knows an unprotected map with similar system, so i can learn from it ?
I think that was all for now, i will update this thread incase i got some problems.
 

Flare

Stops copies me!
Reaction score
662
thatll make each player treat him/herself as an ally. add an integer loop (1 to max player count) within that player group loop. then get Picked Player to unally Player (Integer A).

to stop them allying, theres a checkbox in player settings or something (under the Scenario tab at top of main wc3 window). I think its called fixed player settings

2) convert string to integer (substring (entered chat string, 4, length of entered chat string))

thatll get any number typed after that as your lives integer i.e.

-dm 50
- is 1st part
d is 2nd
m is 3rd
spaces wont cause an issue with string 2 integer
5 is 4th
0 is 5th

thatll take number 4 and 5, and put them together to give you 50 :). hopefully that made sense
 

Zedzy

ℑΣÐℑΨ
Reaction score
41
Was Bored

Made the triggers that you could use, hopefully this is what you wanted.

Code:
Initialization
    Events
        Map initialization
    Conditions
    Actions
        Set Heroes[0] = Blademaster
        Set Heroes[1] = Tauren Chieftain
        Set Heroes[2] = Paladin
        Set Heroes[3] = Archmage
        Set Heroes[4] = Death Knight
        Set Heroes[5] = Dreadlord
        Set Heroes[6] = Priestess of the Moon
        Set Heroes[7] = Demon Hunter
        Set Heroes[8] = Pandaren Brewmaster
        Set Heroes[9] = Naga Sea Witch

Code:
Turn On DM
    Events
        Player - Player 1 (Red) types a chat message containing -dm as A substring
    Conditions
    Actions
        Set KillsNeeded = (Integer((Substring((Entered chat string), 4, (Length of (Entered chat string))))))
        Player Group - Make (All players) treat (All players) as an Enemy
        Trigger - Turn on KillCountNVictory <gen>
        Trigger - Run Give Heroes <gen> (ignoring conditions)
        Trigger - Turn off (This trigger)

Code:
Give Heroes
    Events
    Conditions
    Actions
        Player Group - Pick every player in (All players) and do (Actions)
            Loop - Actions
                Unit - Create 1 Heroes[(Random integer number between 0 and 9)] for (Picked player) at (Random point in (Playable map area)) facing (Random real number between 0.00 and 360.00) degrees

This is initially off.
Code:
KillCountNVictory
    Events
        Unit - A unit Dies
    Conditions
        ((Triggering unit) is A Hero) Equal to True
    Actions
        Set KillCount[((Player number of (Owner of (Killing unit))) - 1)] = (KillCount[((Player number of (Owner of (Killing unit))) - 1)] + 1)
        Game - Display to (All players) the text: (((Name of (Triggering player)) + (( has been killed by  + (Name of (Owner of (Killing unit)))) +  and will revive in )) + ((String(((Hero level of (Triggering unit)) x 3))) + ( seconds. + <Empty String>)))
        Game - Display to (All players) the text: (<Empty String> + (<Empty String> + (<Empty String> + ((Name of (Owner of (Killing unit))) + ( has  + ((String(KillCount[((Player number of (Owner of (Killing unit))) - 1)])) +  kills.))))))
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                KillCount[((Player number of (Owner of (Killing unit))) - 1)] Equal to KillsNeeded
            Then - Actions
                Game - Victory (Owner of (Killing unit)) (Show dialogs, Show scores)
                Player Group - Pick every player in (All enemies of (Owner of (Killing unit))) and do (Actions)
                    Loop - Actions
                        Game - Defeat (Picked player) with the message: ((Name of (Owner of (Killing unit))) +  won!)
            Else - Actions
                Do nothing
        Wait ((Real((Hero level of (Triggering unit)))) x 3.00) game-time seconds
        Hero - Instantly revive (Triggering unit) at (Random point in (Playable map area)), Show revival graphics

I also have the quick map I made for your viewing pleasure. :D

Edit: Guess Flare has it covered. Oh well.

Edit 2: Whoops, when I copied KillCountNVictory it didn't show all of the text that was supposed to be displayed :nuts: so I just made 2 actions so you can see the whole thing.
 

Attachments

  • DeathmatchTest.w3x
    14.7 KB · Views: 88
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top