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.17 replies
Age of Mythology Heaven » Forums » Scenario Design » PHTC Updated: 28/12/2007
Bottom
Topic Subject:PHTC Updated: 28/12/2007
angryzor
Mortal
posted 27 December 2007 09:02 PM EDT (US)         
So... I have updated my PHTC trigger pack again!

This is what's updated:

Invoke in matrix on complete map - updatedNow actually works!!! Thanks to nottud for pointing that out
For All of Criteria - updatedHas been completely revised. Now, one can
- check if a condition is true for all units found by a FAoC trigger
- do something for all found units (like before), but with the option to nest your FAoC effects. This makes it possible to use Archaeopterix' AntiGravity triggers with FAoC.
- do something for all found units that make one or more conditions true
- port his/her own triggers to FAoC
The possibilities are... well.. not endless, but quite big anyway
Now also includes an editor mod that adds a panel (can be opened from menu) to the editor containing a list of all abstract unit types, states, actions, ...
Clock trigger - addedAdd a clock to your scenario by adding just one effect. Condition based on the time of the clock included. Possibility to pause/(re)start the clock. Thanks to TartarianCerberus and Keron Cyst for giving me this idea by publishing a guide on clock systems recently.
Wait triggerDunno for sure if this already exists, but if it doesn't, it does now . Instead of having to fire a new trigger with a timer condition, this effect pauses the execution of your effects for a defined time.
Attention: the other triggers continue to run!
Do x timesDo a series of effects multiple times. Nestable. Made this one today so decided to add it to the pack anyway.
aLiveWell, it already works, but it's by far not realistic enough. These triggers are supposed to simulate a town by making units walk around and meet up with each other, etc.


== AntiGravity (AG) triggers made by Archaeopterix. Ported with permission.




Download







Things I may be working on next:

- Updating SIMSTools, making it easier to use and possibility of having more than one avatar.
- Updating Angry Levels, since the lousy code of my first trigger pack stings in my eye
- Triggers for Camera Movement using mathematical expressions and/or based on unit position. (once i get what all these vector components do )
- (Maybe) Chess for AoM
- Dunno yet or have forgotten becuz it's so late...

Even though these have been tested, it isn't impossible that there is a bug somewhere in these triggers. If you find one, please tell me

LOL i use a lot of smileys....

[EDIT]The FAoC triggers now also work correctly with the "use unit's position" param in "invoke gp FAoC". I think they didn't before


Minor updates (if you downloaded before the times shown here, download again to have the latest version)
- 28/12/07 5:11 am: FAoC triggers slightly sped up
- 28/12/07 6:00 am: Clock Reset effect added
- 28/12/07 9:15 am: nottud updated his editor, so i have to update too... (otherwise his updates would be rolled back when you installed this)

[EDIT]Ohhhh, rriiighttt... EDT

Angry Levels|SIMSTools|PHTC|TriggersToOne Trigger Anti Edit Utility
Triggers coming up quite soon: Camera Master!!!!! (Have complete control over your camera. Make Camera tracks based on unit positions, aim the camera based on mathematical expressions. Multiple levels of advancedness!

[This message has been edited by angryzor (edited 12-28-2007 @ 09:16 AM).]

AuthorReplies:
invent00r
Mortal
posted 28 December 2007 01:38 AM EDT (US)     1 / 17       
Awww. I was going to be making a Clock trigger . [I still might do it so it works on Vanilla.]

The FAoC triggers look like they will cause plenty of lagg if used extensivly. =/.
-invent00r

My Work: 1 2 3 4 5 6 7 8 9 10

WIP: Master XS Battle Micro AI
Paused: AI (%4.247)
Os segredos são de quem os souber guardar.
angryzor
Mortal
posted 28 December 2007 03:26 AM EDT (US)     2 / 17       
Awww. I was going to be making a Clock trigger . [I still might do it so it works on Vanilla.]
It works on vanilla! One only needs your Quest Var triggers to make it work on Vanilla
I use qv's becuase i made some triggers with global vars before, and then someone told me "it doesn't work" and it turned out he added the triggers that use the global vars before the triggers that make them, so he probably had to delete all triggers he made afterwards to repair it.
The FAoC triggers look like they will cause plenty of lagg if used extensivly. =/.
They're basically kb queries. It depends on how they are used. You have to make the Criteria as narrow as possible. It's indeed probably not a good idea to go check every single unit a player owns, as it will indeed probably create lag (well haven't tested this, because i have no online here, and don't have a crowded map. might test it this evening. i do know that doing this (using it on all units, not using the triggers) creates lag when used with an intensive effect like invoke gp and i assume it will cause lag on maps with population caps of 300 and such...). It's also not a very good idea to go put them in high priority triggers or smthng. However when you check smaller amounts of units (selected by the criteria), it shouldn't create any lag. I try to optimize my triggers as much as possible.
(what would cancel away some large searches too is to let the player select some unit's position as "center position", however i've only got one problem with this: it would require me to add an extra parameter (or even 2) to the trigger and there is only room for 7. Otherwise i would have to divide the START effects and conditions in 2 parts, and that would be too confusing...

Angry Levels|SIMSTools|PHTC|TriggersToOne Trigger Anti Edit Utility
Triggers coming up quite soon: Camera Master!!!!! (Have complete control over your camera. Make Camera tracks based on unit positions, aim the camera based on mathematical expressions. Multiple levels of advancedness!

[This message has been edited by angryzor (edited 12-28-2007 @ 03:40 AM).]

invent00r
Mortal
posted 28 December 2007 04:09 AM EDT (US)     3 / 17       
Quoted from angryzor:
It works on vanilla! One only needs your Quest Var triggers to make it work on Vanilla
I use qv's becuase i made some triggers with global vars before, an then someone told me "it doesn't work"
Well.. I guess it does work that way.. But my clock will be better!

As nottud once said, you can use variables created by a loop more than once. And now I only create variables this way:
for(oldPlayer=0;>1){}
The code runs faster (since it doesn't use a function to return the value), you increment just with ++; and it looks much cleaner.
Quoted from angryzor:
They're basically kb queries. It depends on how they are used.
Well, you certaintly like to use kbLookAtAllUnitsOnMap() - the slowest call in the game. Which is only required to retrieve position values of a unit or a army, and to look at all the other players units, and since Set Context Player does the last part you won't be needing it that much. If you want to get the position of a unit which you know the name of kbGetBlockPosition() will always give you the right result.

And finally, using
while(kbUnitQueryNumberResults(trQuestVarGet("Angry_PHTC_queryid")) > trQuestVarGet("PHTC_ForAll_j"))
Means that kbUnitQueryNumberResults function will execute kbUnitQueryNumberResults times. Just create a new variable when you are executing the query. (It will also return the amount of results).
Quoted from angryzor:
I try to optimize my triggers as much as possible.
So do I.
-invent00r

My Work: 1 2 3 4 5 6 7 8 9 10

WIP: Master XS Battle Micro AI
Paused: AI (%4.247)
Os segredos são de quem os souber guardar.
angryzor
Mortal
posted 28 December 2007 05:05 AM EDT (US)     4 / 17       
Thank you for your suggestions
As nottud once said, you can use variables created by a loop more than once. And now I only create variables this way:

for(oldPlayer=0;>1){}

The code runs faster (since it doesn't use a function to return the value), you increment just with ++; and it looks much cleaner.
I know.
However:

In the clock triggers, it still doesn't stop the triggers from crashing when someone uses a condition before the "make" trigger...
The FAoC triggers, I want to be nestable, and therefore the previous values are stored in a stack of some sorts...
But if i would use that for() trick, it would Or cause the triggers to crash (if i try to store the var in the stack before calling it), Or erase the value by re-initing it to 0...
kbLookAtAllUnitsOnMap() - the slowest call in the game.
Hmm didn't know that... Though it sounds reasonable... kbLookAtAllUnitsOnMap... *Slaps forehead*
[EDIT]The FAoC triggers now also work correctly with the "use unit's position" param in "invoke gp FAoC". I think they didn't before
Actually i did it to achieve that ^...
kbGetBlockPosition needs the Name, and as you said before in another thread (EDIT: oops, that was Mythic_Freak), I really don't get why they (ES) made a name and an id for a unit... GetResult returns the unit ID... I could store them all (the names), like in the (-) triggers, but that's likely to run even slower than kbLookAtAllUnitsOnMap...
Will have to think on this one.
And finally, using

while(kbUnitQueryNumberResults(trQuestVarGet("Angry_PHTC_queryid")) > trQuestVarGet("PHTC_ForAll_j"))
Means that kbUnitQueryNumberResults function will execute kbUnitQueryNumberResults times. Just create a new variable when you are executing the query. (It will also return the amount of results).
True. Fixed

[EDIT]btw, do you happen to know for 100% if the unit names are sorted in respect to the unit id's? (in that case i could speed up the (-) triggers by using a binary or ternary search...)

Angry Levels|SIMSTools|PHTC|TriggersToOne Trigger Anti Edit Utility
Triggers coming up quite soon: Camera Master!!!!! (Have complete control over your camera. Make Camera tracks based on unit positions, aim the camera based on mathematical expressions. Multiple levels of advancedness!

[This message has been edited by angryzor (edited 12-28-2007 @ 08:04 AM).]

Godyssey
Mortal
(id: Two_ace_u)
posted 28 December 2007 05:29 AM EDT (US)     5 / 17       
Add a clock to your scenario by adding just one effect. Condition based on the time of the clock included. Possibility to pause/(re)start the clock. Thanks to TartarianCerberus for giving me this idea by publishing a guide on clock systems recently.
Don't I also get credited for this?
His guide was just a improvement off mine.

[This message has been edited by Keron Cyst (edited 12-28-2007 @ 05:30 AM).]

angryzor
Mortal
posted 28 December 2007 05:52 AM EDT (US)     6 / 17       
Oops srry. Fixed

Angry Levels|SIMSTools|PHTC|TriggersToOne Trigger Anti Edit Utility
Triggers coming up quite soon: Camera Master!!!!! (Have complete control over your camera. Make Camera tracks based on unit positions, aim the camera based on mathematical expressions. Multiple levels of advancedness!
Weed Basket
Carrier-pigeon of bad news
(id: Baske)
posted 28 December 2007 05:55 AM EDT (US)     7 / 17       
My reply won't be so large like the others... All I can say is Thank You! These triggers will be very useful!

“Si vis pacem, para bellum”
invent00r
Mortal
posted 28 December 2007 07:08 AM EDT (US)     8 / 17       
You can look at my clock when I am done then.
Quoted from angryzor:
btw, do you happen to know for 100% if the unit names are sorted in respect to the unit id's? (in that case i could speed up the (-) triggers by using a binary or ternary search...)
Yes. Unit names inside the unit id most certaintly. (Thats the principle of a Object-Orient game). But as no command will offer us the unit name...
You could figure the unit ID out by using kbGetBlockID and also knowing the name has to be higher or equal than the ID. Which may not be true if the map was edited by AoMEd!
It's faster - or atleast safer - to leave names alone and use the kbLookAtAllUnits call. But only use it when you really have to.

-invent00r

My Work: 1 2 3 4 5 6 7 8 9 10

WIP: Master XS Battle Micro AI
Paused: AI (%4.247)
Os segredos são de quem os souber guardar.
Mythic_Freak
Mortal
posted 28 December 2007 08:07 AM EDT (US)     9 / 17       
*ugh*

Seems like I have alot to learn still...
I did understand most you said, I just wouldn't think of it myself.

If we knew what it was we were doing, it would not be called research, would it? - Einstein, A.
Master XS - AoM Code Reference - Trigger Loader - Trigger Requests - Chess

Wow, I never thought that I would actually know something before nottud did... it's actually not all that satisfying ~ Steak

[This message has been edited by Mythic_Freak (edited 12-28-2007 @ 08:08 AM).]

nottud
Hero
posted 28 December 2007 09:06 AM EDT (US)     10 / 17       
Nice - I will definately redownload for this.

I think all of use trigger creators should combine and create one ultimate trigger pack!



Anway - is there a way of looking at all the units on the map including ones that change in area does not pick up and then doing certain things to them. E.g. if a unit is an arrow and is player 1 then it will become a house of player 2?

Hey - I have done some editor superpack updates so things will need a little changing around. There needs to be like a universal editor which people can have so they will get everything.

The boy with the mad imagination
Prepare for the ultimate duel!
Learn to use all my triggers and what you can do with them. Visit here.
Find out and download the transform trigger here.
Play some minigames I have created outside AOM including some 3D games here.

[This message has been edited by nottud (edited 12-28-2007 @ 09:11 AM).]

angryzor
Mortal
posted 28 December 2007 09:22 AM EDT (US)     11 / 17       
Anway - is there a way of looking at all the units on the map including ones that change in area does not pick up and then doing certain things to them. E.g. if a unit is an arrow and is player 1 then it will become a house of player 2?
unfortunately, your transform trigger is the only trigger i know of that can change projectiles
There needs to be like a universal editor which people can have so they will get everything.
Yeeess! like some project on an SVN server that sends its updates to AoMH every 2 weeks or so!!
Definitely gonna look into that

Angry Levels|SIMSTools|PHTC|TriggersToOne Trigger Anti Edit Utility
Triggers coming up quite soon: Camera Master!!!!! (Have complete control over your camera. Make Camera tracks based on unit positions, aim the camera based on mathematical expressions. Multiple levels of advancedness!

[This message has been edited by angryzor (edited 12-28-2007 @ 09:35 AM).]

nottud
Hero
posted 28 December 2007 09:44 AM EDT (US)     12 / 17       
unfortunately, your transform trigger is the only trigger i know of that can change projectiles
I actually found another way! But it lags on large maps. I made the game search every unit - even ones that don't exist and test to see if it matched the conditions, if it did it would change. I asked because this version laggs on large maps or maps with a lot of units:
   <Effect name="Change All protounits of player on map">
<Param name="Max" dispName="Max N. units on map" VarType="long">9999</Param>
<Param name="Player" dispName="From player" varType="player">1</Param>
<Param name="Player2" dispName="To player" varType="player">2</Param>
<Param name="UnitType" dispName="Change units from" VarType="protounit">Anubite</Param>
<Param name="ProtoUnit" dispName="Change units to" VarType="protounit">Axeman</Param>
<Command>trQuestVarSet("hi", 0);</Command>
<Command>while(%Max%>=trQuestVarGet("hi")){</Command>
<Command>trUnitSelectClear();</Command>
<Command>trUnitSelectByID(1*trQuestVarGet("hi"));</Command>
<Command>if(trUnitIsOwnedBy(%Player%)){</Command>
<Command>if(kbGetUnitBaseTypeID(1*trQuestVarGet("hi")) == kbGetProtoUnitID("%UnitType%")){</Command>
<Command>trUnitChangeProtoUnit("%ProtoUnit%");</Command>
<Command>trUnitConvert(%Player2%);}}</Command>
<Command>trQuestVarSet("hi", trQuestVarGet("hi")+1);}</Command>
</Effect>
I was wondering if there was a decent way of doing it so it knows what the maximun number of units there are on the map to change. I was thinking of using some sort of army deploy, look at army id and then kill army to find out what the highest id is on the map.

Just going to do some research into that pahaps and if it works then I might do it.

The boy with the mad imagination
Prepare for the ultimate duel!
Learn to use all my triggers and what you can do with them. Visit here.
Find out and download the transform trigger here.
Play some minigames I have created outside AOM including some 3D games here.

[This message has been edited by nottud (edited 12-28-2007 @ 09:49 AM).]

angryzor
Mortal
posted 28 December 2007 10:01 AM EDT (US)     13 / 17       
lol ignore, I was wrong

[EDIT]No I wasn't wrong!
Look at this scenario: http://home.scarlet.be/~rt022830/AoM/UnitIDProblem.scx. Keep the unit AI debug info open and see what happens with the newly summoned anubites after a few have died. They get tremendously high ID's, in the 200000-300000 range. With your approach, you would Or have to run through all these (probably half a minute of still image ) or it would just not work as wanted.

Angry Levels|SIMSTools|PHTC|TriggersToOne Trigger Anti Edit Utility
Triggers coming up quite soon: Camera Master!!!!! (Have complete control over your camera. Make Camera tracks based on unit positions, aim the camera based on mathematical expressions. Multiple levels of advancedness!

[This message has been edited by angryzor (edited 12-28-2007 @ 10:34 AM).]

invent00r
Mortal
posted 28 December 2007 10:45 AM EDT (US)     14 / 17       
Just use the Queries.
-invent00r

My Work: 1 2 3 4 5 6 7 8 9 10

WIP: Master XS Battle Micro AI
Paused: AI (%4.247)
Os segredos são de quem os souber guardar.
angryzor
Mortal
posted 28 December 2007 10:46 AM EDT (US)     15 / 17       
Yes but the queries can't find units like SFX units, projectiles etc. Thats what he wants.

Angry Levels|SIMSTools|PHTC|TriggersToOne Trigger Anti Edit Utility
Triggers coming up quite soon: Camera Master!!!!! (Have complete control over your camera. Make Camera tracks based on unit positions, aim the camera based on mathematical expressions. Multiple levels of advancedness!
nottud
Hero
posted 28 December 2007 04:06 PM EDT (US)     16 / 17       
lol ignore, I was wrong

[EDIT]No I wasn't wrong!
Look at this scenario: http://home.scarlet.be/~rt022830/AoM/UnitIDProblem.scx. Keep the unit AI debug info open and see what happens with the newly summoned anubites after a few have died. They get tremendously high ID's, in the 200000-300000 range. With your approach, you would Or have to run through all these (probably half a minute of still image ) or it would just not work as wanted.
Yes - it is an unfortunate problem I have. Well I supose you win from that point of view then.

The boy with the mad imagination
Prepare for the ultimate duel!
Learn to use all my triggers and what you can do with them. Visit here.
Find out and download the transform trigger here.
Play some minigames I have created outside AOM including some 3D games here.
Mephiles
Mortal
(id: Titan602)
posted 28 December 2007 04:10 PM EDT (US)     17 / 17       
Great triggers I like the wait trigger.

MEPH
[Insert amazingly witty signature here.]

Me and Yeebaagooon's scenarios | Download The Corruptor
You must be logged in to post messages.
Please login or register

Hop to:    

Age of Mythology Heaven | HeavenGames