You must be logged in to post messages.
Please login or register

Scenario Design
Moderated by MosheLevi, Mister SCP

Hop to:    
Welcome! You are not logged in. Please Login or Register.No replies
Age of Empires III Heaven » Forums » Scenario Design » Repetitive Triggers Relinquish Request Thread
Bottom
Topic Subject:Repetitive Triggers Relinquish Request Thread
XS_UserAlex
Skirmisher
posted 06-21-18 11:28 PM EDT (US)         
Are you building a scenario? Are you too lazy or frustrated of the mass number of triggers you have to copy and paste for every player in your scenario?

If you answered yes to all those, there could be a smarter way to trigger your scenario!


Let's take a look at a specific scenario for example, such as this Risk New England:



Each trade post socket has its own set of individual checks to see if player 1, 2, 3, 4, or 5 control it, and if so, spawn the unit for them.
If player 1 controls socket
Spawn Units for player 1

If player 2 controls socket
Spawn Units for player 2

...
If player 5 controls socket
Spawn Units for player 5


This is very inefficient code! Because we can code it smarter and instead express this solution as:

For the player that controls this socket
Spawn units for that player



Unfortunately the scenario editor doesn't give you the chance to code it efficiently, however, I can create a trigger for you to use that does it efficiently!

TL;DR If you have a repetitive task in trigger making that you'd like to eliminate, and already have a working single case for it, I'll make you a trigger that eliminates the need for repeating the trigger for every player!

[This message has been edited by XS_UserAlex (edited 06-21-2018 @ 11:31 PM).]

You must be logged in to post messages.
Please login or register

Hop to:    

Age of Empires III Heaven | HeavenGames