[Advice] Optimizing triggers in my map

Malice-

Endlessly Known
Reaction score
34
So, I'm making a hero arena type map. Its in very early alpha stages, right now you basically just pick a hero and its an all out FFA, with some custom rune Power-Ups across the map and environmental features. But eventually I want the environmental features, runes, etc to be more in depth.

Right now, I just keep running into more bugs every time I add a new feature or new trigger. Mainly because I'm not so experienced with the world editor and I'm trying to learn as I make this map.

I have triggers out the ass and variables everywhere, and I'm sure a lot of it is conflicting as I've just been making shit as I think of it. So I was wondering if the community here at TheHelper can give me any tips on optimizing the map, without JASS (I'm not quite ready for that yet)?

A few consistent problems I run into are with the triggers I have to slow units movement speed only when they are in a certain region of the map, the win conditions, and conditions involving tracking kills, and leaderboard position. The slowing in the snowy region is not consistent... the win conditions almost never work, and something always seems to fuck up with hero kills.

For the snowy-slow-down region, there are frost runes that are supposed to make you run at normal speed in the snowy area for the duration of the rune. This works, sometimes...

The win conditions are just all a mess.

And as far as hero kills go, they seem to track right for the most part, except I want a system where the person in last place in the game to get a gold bonus periodically, for example, and this almost NEVER works, unless the game remains full the entire time. (someone always leaves, because I have to host public alphas since I don't have the people to just test full games all the time)

So I'll post the triggers pertaining to all of this, and if anyone feels like they can offer some advice, feel free.

For the snowy slowing region:

Slowing the units as they enter...
Code:
Slow Units1
    [B]Events[/B]
        Unit - A unit enters Snowy1 <gen>
    [B]Conditions[/B]
        FrostRune[(Player number of (Owner of (Entering unit)))] Equal to False - [COLOR="Red"]If someone has a frost rune, this will be true, so hopefully they wont be slowed[/COLOR]
        SpeedoftheWolf[(Player number of (Owner of (Entering unit)))] Equal to False - [COLOR="Red"]This is a hero ability that increases movement speed, if they have this ability active I dont want them slowed by the snow[/COLOR]
        InStartArea[(Player number of (Owner of (Entering unit)))] Equal to False - [COLOR="Red"]This is true if people are in the shop/invulnerable area, which happens to be located in the middle of the snowy area[/COLOR]
    [B]Actions[/B]
        Unit - Set (Entering unit) movement speed to ((Current movement speed of (Entering unit)) - 170.00)
        Animation - Change (Entering unit)'s vertex coloring to (50.00%, 50.00%, 100.00%) with 0.00% transparency

Unslowing them as they leave...
Code:
UnSlow Units1
    [B]Events[/B]
        Unit - A unit leaves Snowy1 <gen>
    [B]Conditions[/B]
        FrostRune[(Player number of (Owner of (Entering unit)))] Equal to False
        SpeedoftheWolf[(Player number of (Owner of (Leaving unit)))] Equal to False
    [B]Actions[/B]
        Unit - Set (Leaving unit) movement speed to (Default movement speed of (Leaving unit))
        Animation - Change (Leaving unit)'s vertex coloring to (100.00%, 100.00%, 100.00%) with 0.00% transparency

The frost rune trigger...
Code:
Frozen Wrath Effect
    [B]Events[/B]
        Unit - A unit Acquires an item
    [B]Conditions[/B]
        (Item-type of (Item being manipulated)) Equal to Rune of Frozen Wrath
        FrostRune[(Player number of (Owner of (Hero manipulating item)))] Equal to False - [COLOR="Red"]This, and "Firerune" below checks if people already have a rune effect on them so the trigger doesn't run if they do.[/COLOR]
        FireRune[(Player number of (Owner of (Hero manipulating item)))] Equal to False
    [B]Actions[/B]
        Set FrostRune[(Player number of (Owner of (Hero manipulating item)))] = True
        Animation - Change (Hero manipulating item)'s vertex coloring to (50.00%, 70.00%, 100.00%) with 0.00% transparency
        Unit - Set (Hero manipulating item) movement speed to (Default movement speed of (Hero manipulating item))
        Unit - Add Melee Cold Damage Bonus to (Hero manipulating item)
        Unit - Add FROZEN WRATH!  to (Hero manipulating item)
        Game - Display to (All players) the text: (PlayerNames[(Player number of (Owner of (Hero manipulating item)))] +  |cff1E90FFhas aquired a FROST RUNE!  He has a freezing attack and can run at normal speed in the snow!  Watch out!|r)
        Wait 20.00 seconds
        Set FrostRune[(Player number of (Owner of (Hero manipulating item)))] = False
        [B]If (All Conditions are True) then do (Then Actions) else do (Else Actions)[/B] - [COLOR="Red"]This if/then/else decides how to set their movement speed when the effect wears off, depending on if they are in the snowy area or not...***[/COLOR]
            [B]If - Conditions[/B]
                (Snowy1 <gen> contains (Hero manipulating item)) Equal to True
            [B]Then - Actions[/B]
                Unit - Set (Hero manipulating item) movement speed to ((Current movement speed of (Entering unit)) - 170.00)
                Animation - Change (Hero manipulating item)'s vertex coloring to (50.00%, 50.00%, 100.00%) with 0.00% transparency
                Unit - Remove Melee Cold Damage Bonus from (Hero manipulating item)
                Unit - Remove FROZEN WRATH!  from (Hero manipulating item)
            [B]Else - Actions[/B]
                Unit - Set (Hero manipulating item) movement speed to (Default movement speed of (Hero manipulating item))
                Animation - Change (Hero manipulating item)'s vertex coloring to (100.00%, 100.00%, 100.00%) with 0.00% transparency
                Unit - Remove Melee Cold Damage Bonus from (Hero manipulating item)
                Unit - Remove FROZEN WRATH!  from (Hero manipulating item)
*** Does "Default movement speed" mean the base movement speed of the hero? Or the base movement speed of the hero, including all item upgrades?


Now, for the win conditions...

Basically what I WANT to happen, is when a player reaches 25 kills, the game ends after 15 seconds or so, and players are forced to exit out of the map. It never works... I have 3 triggers based around trying to achieve SOMETHING like this, so its a mess:

The main victory trigger:
Code:
Victory
    [B]Events[/B]
        Unit - A unit Dies
    [B]Conditions[/B]
    [B]Actions[/B]
        [B]If (All Conditions are True) then do (Then Actions) else do (Else Actions)[/B]
            [B]If - Conditions[/B]
                Player_Kills[(Player number of (Owner of (Killing unit)))] Equal to 25 - Checks for the 25 kills
           [B] Then - Actions[/B]
                Set Gameover = True
                Set Winner = (Owner of (Killing unit))
                Player Group - Add (Owner of (Killing unit)) to Winners
                Set Winner_S = (Name of (Owner of (Killing unit)))
                Wait 2.00 seconds
                Game - Display to (All players matching (((Picked player) is in Winners) Equal to False)) the text: (Winner_S +  has defeated you all!)
                Wait 1.00 seconds
                Game - Victory (Owner of (Killing unit)) (Show dialogs, Show scores)
                Wait 1.00 seconds
                Game - Display to (All players) the text: Thank you for playi...
                Unit Group - Pick every unit in (Units in (Playable map area) matching (((Owner of (Picked unit)) is in Winners) Equal to False)) and do (Unit - Explode (Matching unit))
                Wait 15.00 seconds
                Unit - Pause all units
                Game - Display to (All players) the text: Game is over, please leave the game...
            [B]Else - Actions[/B]
                Skip remaining actions
As you can see, that trigger is a mess...

This is just to make sure that if a hero is currently on a revive timer and about to revive (since i cant just cancel the actions of the revive trigger once its already started) they are removed upon reviving...
Code:
Hero Revives at gameover
    [B]Events[/B]
        Unit - A unit Finishes reviving
    [B]Conditions[/B]
        Gameover Equal to True
    [B]Actions[/B]
        Unit - Remove (Reviving Hero) from the game

And this is an attempt to reinforce the other trigger and force players out, if it doesn't work...
Code:
Victory Reinforcement
    [B]Events[/B]
        Player - Player 1 (Red) leaves the game with a victory
        Player - Player 2 (Blue) leaves the game with a victory
        Player - Player 3 (Teal) leaves the game with a victory
        Player - Player 4 (Purple) leaves the game with a victory
        Player - Player 5 (Yellow) leaves the game with a victory
        Player - Player 6 (Orange) leaves the game with a victory
        Player - Player 7 (Green) leaves the game with a victory
        Player - Player 8 (Pink) leaves the game with a victory
    [B]Conditions[/B]
        Gameover Equal to True
    [B]Actions[/B]
        Wait 20.00 seconds
        Player Group - Pick every player in (All players) and do (Game - Defeat (Picked player) with the message: Defeat!)

The following is supposed to add 500 gold to the player in last place on the board eveary 485 seconds. The main problem with this is I cant make it "position 8" because if someone leaves, position 8 doesnt exist. So I tried creating a variable which basically is equal to the "number of players" in the game (thats what "Players_Playing" is, because I figured if the number of players left playing is 5, then that would be position 5 in the board, and it would work. But, if the "number of players" function just means the number that joined initially, this is useless...
Code:
Player Losing
    [B]Events[/B]
        Time - Every 485.00 seconds of game time
    [B]Conditions[/B]
    [B]Actions[/B]
        Game - Display to (All players) the text: (PlayerNames[(Player number of (Player in position Players_Playing of (Last created leaderboard)))] +  is no threat to anyone...  Attacking him will award only 25 gold.)
        Game - Display to (All allies of (Player in position Players_Playing of (Last created leaderboard))) the text: |c00ff0303Here's 50...
        Player - Add 500 to (Player in position "Players_Playing" of (Last created leaderboard)) Current gold


There are plenty more confusing, ridiculous triggers like this in my map, these are just the really annoying ones. I can tell just by the fact that I hate looking at my triggers that there must be an easier way to do all of this...

Thats a hell of a lot to read, and this isn't really anyone here's problem so I will not be mad if nobody responds... but, I'd greatly appreciate it if someone does. :)

Thanks,

Malice-
 

duyen

New Member
Reaction score
214
Code:
UnSlow Units1
    Events
        Unit - A unit leaves Snowy1 <gen>
    Conditions
        FrostRune[(Player number of (Owner of (Entering unit)))] Equal to False
        SpeedoftheWolf[(Player number of (Owner of (Triggering unit)))] Equal to False
    Actions
        Unit - Set [B](Triggering unit)[/B] movement speed to (Default movement speed of [B](Triggering unit)[/B])
        Animation - Change [B](Triggering unit)'s[/B] vertex coloring to (100.00%, 100.00%, 100.00%) with 0.00% transparency

Do everything I bolded and,

Code:
FrostRune[(Player number of (Owner of (Entering unit)))] Equal to False
There is no Entering Unit, so that won't work. NOTE: Always use triggering unit except when it's unavoidable.
_______________________________________________________________

Code:
Event:
   Player - Player leaves the game.
Conditions:
Actions:
    Set - Playing_Players = ((Playing_Players) - 1)

Try this will calculate it.

Code:
Events:
   Time - Every 485 seconds of game time.
Conditions:
Actions:
    Add 500 gold to Player in position (Playing_Players) of the <Your Leaderboard>

Then something like that should give the gold.
 

Malice-

Endlessly Known
Reaction score
34
Thanks for the response. I'll test that in a sec, but it looks like it would definitely work. Something I overlooked. I didnt know triggering unit worked for most every event.
 

Malice-

Endlessly Known
Reaction score
34
So

Code:
Slow Units
    Events
        Unit - A unit enters Snowy1 <gen>
    Conditions
        FrostRune[(Player number of (Owner of (Triggering unit)))] Equal to False
        SpeedoftheWolf[(Player number of (Owner of (Triggering unit)))] Equal to False
    Actions
        Unit - Set (Triggering unit) movement speed to ((Current movement speed of (Triggering unit)) - 170.00)
        Animation - Change (Triggering unit)'s vertex coloring to (50.00%, 70.00%, 100.00%) with 0.00% transparency
Code:
Unslow Units
    Events
        Unit - A unit leaves Snowy1 <gen>
    Conditions
        FrostRune[(Player number of (Owner of (Triggering unit)))] Equal to False
        SpeedoftheWolf[(Player number of (Owner of (Triggering unit)))] Equal to False
    Actions
        Unit - Set (Triggering unit) movement speed to ((Current movement speed of (Triggering unit)) + 170.00)
        Animation - Change (Triggering unit)'s vertex coloring to (100.00%, 100.00%, 100.00%) with 0.00% transparency

Shouldn't have any problems there, eh?

And you don't think it would cause any weird conflicting problems with this...?:
Code:
Frozen Wrath Effect
    Events
        Unit - A unit Acquires an item
    Conditions
        (Item-type of (Item being manipulated)) Equal to Rune of Frozen Wrath
        FrostRune[(Player number of (Owner of (Hero manipulating item)))] Equal to False
        FireRune[(Player number of (Owner of (Hero manipulating item)))] Equal to False
    Actions
        Set FrostRune[(Player number of (Owner of (Hero manipulating item)))] = True
        Animation - Change (Hero manipulating item)'s vertex coloring to (50.00%, 70.00%, 100.00%) with 0.00% transparency
        Unit - Set (Hero manipulating item) movement speed to ((Current movement speed of (Hero manipulating item)) + 170.00)
        Unit - Add Melee Cold Damage Bonus to (Hero manipulating item)
        Unit - Add FROZEN WRATH!  to (Hero manipulating item)
        Game - Display to (All players) the text: (PlayerNames[(Player number of (Owner of (Hero manipulating item)))] +  |cff1E90FFhas aquired a FROST RUNE!  He has a freezing attack and can run at normal speed in the snow!  Watch out!|r)
        Wait 20.00 seconds
        Set FrostRune[(Player number of (Owner of (Hero manipulating item)))] = False
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Snowy1 <gen> contains (Hero manipulating item)) Equal to True
            Then - Actions
                Unit - Set (Hero manipulating item) movement speed to ((Current movement speed of (Hero manipulating item)) - 170.00)
                Animation - Change (Hero manipulating item)'s vertex coloring to (50.00%, 50.00%, 100.00%) with 0.00% transparency
                Unit - Remove Melee Cold Damage Bonus from (Hero manipulating item)
                Unit - Remove FROZEN WRATH!  from (Hero manipulating item)
            Else - Actions
                Animation - Change (Hero manipulating item)'s vertex coloring to (100.00%, 100.00%, 100.00%) with 0.00% transparency
                Unit - Remove Melee Cold Damage Bonus from (Hero manipulating item)
                Unit - Remove FROZEN WRATH!  from (Hero manipulating item)

Also, see where "Hero manipulating item" is there. Could I use triggering unit in place of "Hero manipulating item" ?



This configuration is working better... but, theres still a somewhat different bug. Im noticing that somehow im acquiring a maxed out speed, after running around and testing just running around picking up runes, consistently. If everything there is working as intended, this shouldn't happen...
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top