WARNING: Long Post! Need feedback/help with my triggers and leaks!

draist

Active Member
Reaction score
1
This post might be pretty long, since I need alot of feedback on many of my triggers in my map and help with them overall. Especially such triggers that may cause leaks. I haven't finished the leaks guide yet but I will.

First off, I will apologize for not knowing how to use the hide/unhide stuff in the forum and secondly; If you're willing to help, please explain why I should do this or that. Don't just say "HERE I AMDE IT WORKZ 4 U OK". I will never learn then and I'll be stuck asking questions here forever.

After each trigger there will be a short explanation of how the triggers work or atleast how I think they work. That's where You come into the picture, by telling me what works the best way and why I should do this or that instead.


Trigger number one:

Trigger:
  • Mortal
    • Events
      • Unit - A unit enters MortalFlagCapRegion <gen>
    • Conditions
      • (((Owner of (Entering unit)) is an ally of Player 1 (Red)) Equal to True) and (((Entering unit) has an item of type The Flag) Equal to True)
    • Actions
      • Hero - Drop (Item carried by (Entering unit) of type The Flag) from (Entering unit)
      • Set MortalScore = (MortalScore + 1)
      • Leaderboard - Change the value for Neutral Hostile in (Last created leaderboard) to MortalScore
      • Leaderboard - Sort (Last created leaderboard) by Value in Descending order
      • Game - Display to (All players) the text: ((Name of (Owner of (Entering unit))) + of the Mortal team has captured flag!)
      • Item - Remove (Last dropped item)
      • Wait 1.00 seconds
      • Player Group - Pick every player in Mortals and do (Actions)
        • Loop - Actions
          • Player - Add 100 to (Picked player) Current gold
          • Hero - Add 250 experience to (Picked unit), Show level-up graphics
      • Game - Display to (All players) the text: ((Name of (Owner of (Entering unit))) + and his allies was awarded with 100 gold and 250 experience!)
      • Wait 30.00 seconds
      • Item - Create The Flag at (Center of FlagSpawnPoint <gen>)
      • Item - Make (Last created item) Invulnerable
      • Game - Display to (All players) the text: The flag has spawne...


I assume that most of you realize that it is a Capture the Flag game; When the unit carrying the flag enter the scoring region, all items of type "The Flag" is dropped and removed from the game, and the score for the team the player belongs to get 1 point. (There's only 1 item of type The Flag at any one time in the map)

Now, when a unit scores the flag I want it to recieve 100 gold (which it does) and 250 experience points (which it doesn't). I assume that it has something to do with the Player Group - Pick every player in... action, but I can't put my finger on what it is.

Now, everything in this trigger works like a charm, except for the part where it says to grant exp, which it doesn't. I am aware that it may leak and I want additional feedback on how to fix it.

I'm not too sure about leaks and stuff since I first heard about it only a few days ago and haven't read so much about it, that's why your help is needed at the moment. At least until I learn about it myself, but you will surely be able to help with other stuff then. ;)

Now, for my second trigger which is in fact the map initialization. If you could point out leaks and/or stuff I can do better/easier, it would be appreciated. If there is something that can be done better/easier, please explain to me why and how it is better. Otherwise I will never learn.


Trigger number two:

Trigger:
  • Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set MortalScore = 0
      • Set MortalWin = 0
      • Set DemonScore = 0
      • Set DemonWin = 0
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Player - Set (Picked player) Current gold to 250
          • Player - Limit training of Heroes to 1 for (Picked player)
          • Visibility - Create an initially Enabled visibility modifier for (Picked player) emitting Visibility across (Playable map area)
          • Player Group - Add Player 1 (Red) to Mortals
          • Player Group - Add Player 2 (Blue) to Mortals
          • Player Group - Add Player 3 (Teal) to Mortals
          • Player Group - Add Player 4 (Purple) to Mortals
          • Player Group - Add Player 5 (Yellow) to Mortals
          • Player Group - Add Player 6 (Orange) to Mortals
          • Player Group - Add Player 7 (Green) to Demons
          • Player Group - Add Player 8 (Pink) to Demons
          • Player Group - Add Player 9 (Gray) to Demons
          • Player Group - Add Player 10 (Light Blue) to Demons
          • Player Group - Add Player 11 (Dark Green) to Demons
          • Player Group - Add Player 12 (Brown) to Demons
      • Player Group - Pick every player in Mortals and do (Actions)
        • Loop - Actions
          • Camera - Pan camera for (Picked player) to (Center of MortalsTavernCreation <gen>) over 0.00 seconds
          • Player - Make (Picked player) treat Neutral Hostile as an Ally with shared vision
          • Player - Make Neutral Hostile treat (Picked player) as an Ally with shared vision
          • Player - Make (Picked player) treat Neutral Passive as an Enemy
          • Player - Make Neutral Passive treat (Picked player) as an Enemy
          • Player - Make (Picked player) treat Neutral Victim as an Neutral
      • Player Group - Pick every player in Demons and do (Actions)
        • Loop - Actions
          • Camera - Pan camera for (Picked player) to (Center of DemonTavernCreation <gen>) over 0.00 seconds
          • Player - Make (Picked player) treat Neutral Passive as an Ally with shared vision
          • Player - Make Neutral Passive treat (Picked player) as an Ally with shared vision
          • Player - Make (Picked player) treat Neutral Hostile as an Enemy
          • Player - Make Neutral Hostile treat (Picked player) as an Enemy
          • Player - Make (Picked player) treat Neutral Victim as an Neutral
      • Unit - Change ownership of Circle of Power 0026 <gen> to Neutral Victim and Retain color
      • Game - Set game speed to Fastest
      • Game - Lock the game speed
      • Game - Set the time of day to 24.00
      • Game - Display to (All players) the text: You have 1 minute t...
      • Destructible - Make ForceWall 4156 <gen> Invulnerable
      • Destructible - Make ForceWall 4009 <gen> Invulnerable
      • Destructible - Make ForceWall 4010 <gen> Invulnerable
      • Destructible - Make ForceWall 4014 <gen> Invulnerable
      • Wait 60.00 seconds
      • Item - Create The Flag at (Center of FlagSpawnPoint <gen>)
      • Item - Make (Last created item) Invulnerable
      • Unit - Remove Tavern (Human) 0018 <gen> from the game
      • Unit - Remove Tavern (Orc) 0019 <gen> from the game
      • Destructible - Open ForceWall 4014 <gen>
      • Destructible - Open ForceWall 4156 <gen>
      • Destructible - Open ForceWall 4010 <gen>
      • Destructible - Open ForceWall 4009 <gen>


The variables are kind of self explanatory, MortalScore and DemonScore control the score and MortalWin and DemonWin is set to zero because when that variable is increased to 1, one of the team wins. No, it is not random who wins. The first team to score 5 flags wins.

I grant them some gold so they can buy a Hero from the tavern that is already placed in the editor and also limits players to 1 Hero per player. I also add the players into the two teams, and it may get fuzzy for some now, but stay with me;

Team 1 (Mortals) treats neutral hostile as friendly and neutral passive as enemies. That's simply because I didn't want to waste player slots on it. There are no neutral monsters in my map and if I would want some in the future, I just make them Neutral Victim. (Oh, the irony)

Anyways, now there's only boring stuff like locking the game speed, time of day and giving them the message that they have 1 minute to choose a hero. That might not be enough time but, who cares, it's only me playing at the moment.

Then after 60 the flag is created, the tavern is removed, the gates open and the game is on.

The following triggers are a wee bit shorter than the previous ones, but I'm sure they're full of leaks aswell.

Trigger number three:

Trigger:
  • Flag
    • Events
      • Unit - A unit Dies
    • Conditions
      • (((Dying unit) is A Hero) Equal to True) and (((Dying unit) has an item of type The Flag) Equal to True)
    • Actions
      • Hero - Drop (Item carried by (Dying unit) of type The Flag) from (Dying unit)
      • Item - Make (Last dropped item) Invulnerable
      • Cinematic - Ping minimap for (All players) at (Position of (Dying unit)) for 3.00 seconds
      • Game - Display to (All players) the text: ((Name of (Owner of (Dying unit))) + has dropped the flag!)


Well, this is an easy one. If the unit carrying the flag dies the flag will drop from the dying unit. A message will let players know that the flag has been dropped and ping the minimap where it dropped. Also reports who dropped the flag.

Trigger number four:

Trigger:
  • Picked Up
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to The Flag
    • Actions
      • Item - Make (Item being manipulated) Invulnerable
      • Game - Display to (All players) the text: ((Name of (Owner of (Hero manipulating item))) + has picked up the flag!)
      • Cinematic - Ping minimap for (All players) at (Center of (Playable map area)) for 2.00 seconds


I don't suspect there to be any leaks here, but you never know.

Trigger number five:

Trigger:
  • Respawn Mortals
    • Events
      • Unit - A unit Dies
    • Conditions
      • (((Dying unit) is A Hero) Equal to True) and (((Owner of (Dying unit)) is an ally of Neutral Hostile) Equal to True)
    • Actions
      • Game - Display to (All players) the text: (((Name of (Owner of (Dying unit))) + was obliterated by ) + (Name of (Owner of (Killing unit))))
      • Game - Display to (All allies of (Owner of (Dying unit))) the text: (Resurrection in + ((String(((Real((Hero level of (Dying unit)))) + 20.00))) + seconds.))
      • Wait ((Real((Hero level of (Dying unit)))) + 20.00) seconds
      • Hero - Instantly revive (Dying unit) at (Center of MortalsRes <gen>), Show revival graphics


When a Hero of Team 1 (Mortals) dies, it will report who killed that Hero to all players. It will also report to allies how long it will take for the killed Hero to respawn.

Well, I think that's enough for now. I doubt you have the stamina or will to continue reading right now, so I'll just post the rest of it another time. And again, I want to remind you that if you're willing to help, please don't just post something like "HERE U GO DIS WORKS STAKESAUCE!!!". How am I supposed to learn from such gibberish? ;)
 

HydraRancher

Truth begins in lies
Reaction score
197
Trigger:
  • Hero - Add 250 experience to (Picked unit), Show level-up graphics


The reason why it doesn't work is because there is no picked unit. There is only a picked player. You'll have to use a variable to save each hero in an array.

Also, I believe you can remove the item directly from a unit without making it drop it.

Yes there are a few leaks. Any time you use (Center of Region <gen>) or (Position of (Triggering Unit), etc. then it creates a leak. Use a tutorial to figure out how to rid of these leaks.
 
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