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

Scenario Design and Discussion
Moderated by Sebastien, Mr Wednesday

Hop to:    
loginhomeregisterhelprules
Bottom
Topic Subject: Laws of the Map Editor #8: Accumulate Attribute
posted 02-27-03 04:26 PM CT (US)   
LAWS OF THE MAP EDITOR
Accumulate Attribute

The Laws of the Map Editor series was created by CrystalCrown to help others understand the quirks and unexplained mysteries of the Age of Empires II Map Editor. The author has reached a conclusion on the following subject through logic and inductive reasoning. The author makes no claims on the accuracy of this information and cannot be held accountable for consequences arising from use of such information.


Introduction

One of the most versatile conditions is the "Accumulate Attribute", so it should be no surprise why it is used so often by scenario designers. The reason is because not only can goals for resources, such as food or good, be set, other attributes, such as kills or razings, can be used as well. Most of them are self-explanatory, but clever use can produce amazing results with this simple condition.


Simple Use

This condition is very simple to use. Just pick the player the condition is for, and then pick the type of attribute to use. For the resources, just pick the number the player needs to gather. Villager population is a count of all the player's civilian units, like Villagers; Kings; and Trade Carts, while military population is the count of all the other Units. Kills and Razings will be determined by how many Units and Buildings a player destroys. The Kill Ratio is the difference between the number of kills and the number of losses a player receives, respectively, and technologies will count how many technologies a player has researched.


Cheaters Not Allowed

Another use of the "Accumulate Attribute" condition is the prevention of using cheats. For example, to prevent a player from using the "lumberjack" cheat when the player is not suppose to get any wood, simply create the following trigger:

Display as Objective: No
Trigger Starting State: On
Trigger Looping: Yes

Condition: Accumulate Attribute ( 1000 Wood: Player 1 )
Effect: Tribute ( 1000 Wood: Player 1 » Gaia )

Note that this trigger can be displayed as an objective, and the starting state can be changed. This trigger will tribute 1000 wood from Player 1 to GAIA every time Player 1 gains 1000 wood. Keep in mind, however, that this is only applicable in games where the player cannot get, by regular means, more than 1000 wood. The same can be done with the other three resources as well.


Paid to Kill

Ever wonder how RPG makers allow a player to receive gold continually for every unit the player kills. It is actually quite simple if you understand the trigger:

Display as Objective: No
Trigger Starting State: On
Trigger Looping: Yes

Condition: Accumulate Attribute ( 1 Kill Ratio: Player 1 )
Effect: Tribute ( 10 Gold: GAIA » Player 1 )
Effect: Create Object ( ANY UNIT: ANY AREA )
Effect: Kill Object ( ANY UNIT )

This trigger gives 10 gold to Player 1 every time Player 1 kills a unit, but how does it work? Well, at the beginning, Player 1's kill ratio is at zero. Once he kills a unit, however, his kill ratio becomes ( one minus zero ) one, and GAIA gives Player 1 the gold. However, at that time, another unit is created somewhere else and then immediately killed. Now, Player 1's kill ratio is back at ( one minus one ) zero. This process can then be repeated indefinitely. The reason kills do not work is that the number of kills each player receives is stored as one number during the entire game. If Player 1 kills a unit, his kill count will be one, but if he kills another unit, his kill count will be two. There is no way to reduce a player's kill count. The only way would be to create a trigger manually for every single kill! To be even more professional, replace
Effect: Tribute ( 10 Gold: GAIA » Player 1 )

with
Effect: Tribute ( -10 Gold: Player 1 » GAIA )

This will eliminate the "GAIA paid 10 gold in tribute to you." message.


Previous Issues

  1. Walls and Gates
  2. Walk-through on Cliffs
  3. The Beauty of Bridges
  4. Map Copy and BETA Units
  5. Eye Candy Excellence
  6. Trigger Time
  7. Numerical Manipulation

CRYSTALCROWN

Play OnlineBecause you really can't gloat about beating the computer.
Learn the FlushSo you don't lose every game in under 20 minutes.

It's not a post count; it's making your posts count.

[This message has been edited by CrystalCrown (edited 07-31-2003 @ 05:10 PM).]

Replies:
posted 02-27-03 04:27 PM CT (US)     1 / 2  
Took a while, but the next issue is finally out. Thanks for reading LoTME and enjoy.

Don't forget to support DGDN by reading other fine articles, and also be sure to visit the forums.


CRYSTALCROWN

Play OnlineBecause you really can't gloat about beating the computer.
Learn the FlushSo you don't lose every game in under 20 minutes.

It's not a post count; it's making your posts count.

[This message has been edited by CrystalCrown (edited 02-27-2003 @ 04:31 PM).]

posted 02-27-03 07:08 PM CT (US)     2 / 2  
Neat!
One of the problems is that it takes extra time to do a trigger that fires if, say, you have less than 10 gold. You need two triggers plus one for each attribute you need less than a certain amount; that is, if you have to have less than 20 gold and less than 5 kills, you would need 4 triggers, like thus:
Trigger 1 (looping)
Effect: Activate Trigger (Trigger 4)

Trigger 2 (looping)
Condition: Accumulate Attribute (Player 1) 20 Gold
Effect: Deactivate Trigger (Trigger 4)

Trigger 3 (looping)
Condition: Accumulate Attribute (Player 1) 5 Kills
Effect: Deactivate Trigger (Trigger 4)

Trigger 4 (off)
Conditions: whatever
Effects: whatever

So if you have less than 20 gold and less than 5 kills, trigger 4 will fire.


FrogdudeTM
Math Expert
Avid Player of The Awesomest Game Ever
Age of Kings Heaven » Forums » Scenario Design and Discussion » Laws of the Map Editor #8: Accumulate Attribute
Top
You must be logged in to post messages.
Please login or register
Hop to:    
Age of Kings Heaven | HeavenGames