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

Scenario Design
Moderated by Yeebaagooon, TAG, nottud

Hop to:    
Welcome! You are not logged in. Please Login or Register.10 replies
Age of Mythology Heaven » Forums » Scenario Design » The double function of the Units In Area condition.
Bottom
Topic Subject:The double function of the Units In Area condition.
kan_apo
Mortal
posted 05 March 2003 02:15 PM EDT (US)         
The common function of the Units In Area condition as we all know is a simple as its name.It is usually used to fire an effect when a certain number of units is in a specified area.
I.e.if you want a trigger that converts ulfsarks from player 1 to player 2 when they are near a temple,the Units In Area is the appropriate condition to use.

Now,what might not be known is that with a very simple "trick" the Units In Area condition can be used as Player Owns Units/Buildings condition.All you have to do is set an unkillable unit/object as a center unit and put a very big number in the radius box.
This means that the specified area will cover the whole map,so the effect will fire whenever the number of the specified by the designer units exist on the map.

An example would be the best way to describe this...
Say you want a trigger that alerts player 2 when player 1 has built a siege camp,so that say the first will then start a counderattack.You should then use the Units In Area Condition like this:

Condition=Units In Area
Player=1
Center Unit=i.e. a rock or a cinematic block
Unit=Siege camp
Radius=i.e. 1000000
Operator= == or >=
Count=1

Effect
Anything you want...

With this condition the effect will be fired whenever player 1 owns a siege camp on any spot of the map.

P.S.If you have problems understanding the Units In Area condition,check this usefull thread: http://aom.heavengames.com/cgi-bin/forums/display.cgi?action=ct&f=13,10294,0,10


AuthorReplies:
TwentyOneScore
Mortal
posted 05 March 2003 04:20 PM EDT (US)     1 / 10       
This is essentially the same as the Player Unit Count trigger - which counts all the units a player owns of the type specified on the entire map...

rms snippet:

rmAddTriggerCondition("Player Unit Count");
rmSetTriggerConditionParam("ProtoUnit", "Siege Camp");
rmSetTriggerConditionParamInt("PlayerID", 1);
rmSetTriggerConditionParam("Op", ">");
rmSetTriggerConditionParamInt("Count", 0);

(Woohoo! 4:20 Post)


"Just invite him over for dinner. Turn him from an enemy into a friend. Then when he's least expecting, BAM! The old fork in the eye!" - M.S.
--
Member Tsunami Studios <<< Play TOS Maps - 9 Maps - Avg Rating: 4.67! >>>

[This message has been edited by TwentyOneScore (edited 03-05-2003 @ 04:42 PM).]

LicensedDevil
Mortal
posted 05 March 2003 05:18 PM EDT (US)     2 / 10       
lol there you go kan, you invented a condition that already existed, ul m8, nice work though, could have other uses...
*thinks*
*thinks some more*
*has a lie down*
*thinks some more*

ummmmm...


Licensed Devil
I'm here to kill your self belief
-=[SCN Punk Network]=-
-=[WebMaster]=-
SCN Punk Empires Editor Guide (or here)
kan_apo
Mortal
posted 05 March 2003 05:28 PM EDT (US)     3 / 10       
Uhh ...yeah...ok
*feels stupid*
So,there as unit count condition,eh?
So,that post was a complete waste of time...
Lol,i hate you twentyonescore
Shut up LD,you don't seem to know the editor any better than that .
LicensedDevil
Mortal
posted 05 March 2003 05:46 PM EDT (US)     4 / 10       
:'( hmmmmmm... :'(

Licensed Devil
I'm here to kill your self belief
-=[SCN Punk Network]=-
-=[WebMaster]=-
SCN Punk Empires Editor Guide (or here)
kan_apo
Mortal
posted 05 March 2003 06:09 PM EDT (US)     5 / 10       
Hmmmm?
Lol,don't take it too seriously LD,i have to joke about my, as it was prooved,stupid post .
Alexandergreat3
Mortal
posted 05 March 2003 09:37 PM EDT (US)     6 / 10       

Quote:

lol there you go kan, you invented a condition that already existed, ul m8, nice work though, could have other uses...

Hehe =). The one thing that I see different between the two is that with the "Unit in Area" trigger, the radius can be changed, whereas with the "Unit own" trigger, that can't be done.

TwentyOneScore
Mortal
posted 06 March 2003 06:39 PM EDT (US)     7 / 10       
Ok, now you got me thinking, and you are right! There is another use for this function. I looked at the trigger xml and there is a MAJOR difference:

The "Player Unit Count" function uses ProtoType units.

<Param name="ProtoUnit" dispName="$$19160$$Unit" VarType="protounit">default</Param>

The Units In Area condition uses the UnitType units.

<Param name="UnitType" dispName="$$22302$$Unit Type" VarType="string">Unit</Param>

That means that using the Play Unit Count trigger only lets you count the number of a SPECIFIC unit type - i.e. "Portable Ram". While the Units In Area trigger lets you count the TYPES of units - i.e. "AbstractSiegeWeapon".

In my latest RMS, I was able to replace 5 individual "Player Unit Count" conditions with a single "Units In Area" condition. I was counting the number of walls and needed "Wall Long", "Wall Short", "Wall Medium", "Gate", "Wall Connector" - now I am using "AbstractWall" to catch them all.

Thanks Kan_Apo! You stumbled into something there....


"Just invite him over for dinner. Turn him from an enemy into a friend. Then when he's least expecting, BAM! The old fork in the eye!" - M.S.
--
Member Tsunami Studios <<< Play TOS Maps - 9 Maps - Avg Rating: 4.67! >>>
kan_apo
Mortal
posted 11 March 2003 02:18 PM EDT (US)     8 / 10       

Quoted from kan_apo:

Lol,i hate you twentyonescore .

Lol,i love you twentyonescore .
Seriously now,i'm glad something good came up after all .
Do you know perhaps what are the names of other types of units?I.e. i got the trigger to work with some obvious types of units like infantry,archers,cavalry and monuments,but i could make it count i.e the heros.In other words "abstracthero" or "abstractheronorse" aren't the right key words.

TwentyOneScore
Mortal
posted 11 March 2003 03:23 PM EDT (US)     9 / 10       
There are 780+ defined unit types. See them all here:
http://www.beerinhand.com/aom/unittype.txt

which was taken from this file:
http://www.beerinhand.com/aom/reference.txt

(which came from the latest AI doc by Capt Kidd - which has all the correct Tech Id's; i.e. you don't have to subtract 1 from some).

you are looking for heroes, in the file you'll see:

const int cUnitTypeHero=640;
const int cUnitTypeHeroNorse=431;

I've found the portion of the string after cUnitType to be the value that should be used in the trigger - so the above should be

Hero - catch all for any type of hero
HeroNorse - Hersir

there is no abstracthero type, but I think "Hero" is what you are looking for.

Funny, I see a type called HeroBoar and HeroBoar2 - anyone know what these are?


"Just invite him over for dinner. Turn him from an enemy into a friend. Then when he's least expecting, BAM! The old fork in the eye!" - M.S.
--
Member Tsunami Studios <<< Play TOS Maps - 9 Maps - Avg Rating: 4.67! >>>
kan_apo
Mortal
posted 12 March 2003 11:17 AM EDT (US)     10 / 10       
Aaahh,thanks .Loads of unit types there.
There is even a unit type named EartquakeAttack,so it probably means that with the Units In Area condition you can cause an effect to fire when an eartquake godpower has been cast by a player.Nice.
The heroboars should be the boars that Arkantos and Ajax where turned into by Circe in a scn of the game's campaign.
You must be logged in to post messages.
Please login or register

Hop to:    

Age of Mythology Heaven | HeavenGames