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.13 replies
Age of Mythology Heaven » Forums » Scenario Design » Trigger Question
Bottom
Topic Subject:Trigger Question
Mythic_Freak
Mortal
posted 26 December 2007 01:09 PM EDT (US)         
I was trying to make some sort of heroize trigger today. And I was wondering:

* I assume the trigger selection system is seperated from the actual game selecting system, so how can 2 such commands interact? E.g.:
<Effect name="Heroize2">
<Param name="SrcObject" dispName="$$22421$$Unit" varType="unit">default</Param>
<command>trUnitSelectClear();</command>
<command>trUnitSelectByID(%SrcObject%);</command>
<command>uiTransformSelectedUnit("Swordsman Hero");</command>
</Effect>
(Note that this is the cut down version for testing, the other 1 will first find out what the selected unit type is.)

* I noticed that nottud uses trUnitSelect() instead of ByID, this somehow does not work for me. And I think it should not, because the SrcObject returns the unit ID. I also noticed in the debugger (looking at triggertemp) that my ID was always 0.

So what am I doing wrong here?

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
AuthorReplies:
nottud
Hero
posted 26 December 2007 01:21 PM EDT (US)     1 / 13       
Simple - the transform command transforms the unit YOU have selected, not the trigger. This means you cannot use the command with triggers. This was the exact same problem that occured with Reyk's scale unit trigger.

The select command you have used will do nothing to help you. The only way is to use a command that PROPERLY selects a unit, i.e. camera cut protounit that camera cuts and select a unit. However the problem is that it will select a different unit for each player.

I am afraid it mainly renders the transform command that you are using useless.


Simple terms:Transform select unit transforms the unit you have selected yourself and not the trigger. This means you cannot use the command - well not really online at least.

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.
invent00r
Mortal
posted 26 December 2007 01:38 PM EDT (US)     2 / 13       
First of all, the variable SrcObject will return the unit name of the scenario.
The variable itself is a number so it should be placed like this:

trUnitSelect("%SrcObject%");

Secondly, the Selection you just made only goes for triggers. So only commands starting with tr will have some use for it.
The uiTransformSelectedUnit requires the specific player that has the unit to be transformed, selected. (He needs to click on him). uiFindType(string ProtoName) selects the unit.

Remember to change contexts to avoid OoS.

Aww... Nottud was faster =/.
-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 26 December 2007 01:59 PM EDT (US)     3 / 13       
Oh dear... I was so busy searching in the kb/xs/tr commands to select a unit I forgot the console ones. :-/

Anyway, I noticed already that those 2 selection systems are seperated. You're both acting like I didn't understand that .

But, how can I find "names" with the ui commands? As far as I know it only searches protounits.

And what name does the SrcObject return? The protounit name would be rather useless to invoke commands on say.. 1 unit only. That's why I assumed it returns an ID.

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-26-2007 @ 02:01 PM).]

invent00r
Mortal
posted 26 December 2007 02:30 PM EDT (US)     4 / 13       
There are a unit has a protounit ID; an ID and a Name.
The first one is obvious.
The second and the thrid are related but silitly different: The ID starts at 0 and will end at n, but unlike Names - it will have no missing entry between 0 and n.

So a unit that the Name "5" may have the ID 0. However, a unit with ID 5 indicates that the Name needs to be "5" or higher. This is what my experience tells me. I might be wrong.

Either way, names just shouldn't exist.
-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 26 December 2007 02:35 PM EDT (US)     5 / 13       
So, a "name" is a unique number between quotes (string)?

Okay, and how do I select units (in game) with just the name reference?

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-26-2007 @ 02:35 PM).]

nottud
Hero
posted 26 December 2007 03:11 PM EDT (US)     6 / 13       
You unfortunately can't - the closest one is camera cut object but that is no good.

You will need to change the unit to something obscure like "test object" then go through every player in turn using the convert trigger to convert it to that player and then use camera cut protounit to make that player select it. Then change the unit back to how it was before.

Seriously - there is no decent way. Best stick with change unit type. (Interestingly enough transform unit changes the unit in the same way as the transform trigger)

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-26-2007 @ 03:12 PM).]

MoD_SUN_kirbyfan
Mortal
posted 26 December 2007 06:14 PM EDT (US)     7 / 13       
an ID is a string but it is located in a dll file so you will need resource hacker to see it. i opened xpacklanguage.dll and found every ID in the game. it has the IDs for triggers, dialog, units, and almost all the text in the game. also, just a small thing i found, any trigger makers who want to have an ID for parts of your trigger like for heroize2 it can have a new ID like $$453823$$Heroize2.

I can finally get online in AoM and AoMTT via laptop!!! to get my kriby auto escape goto
http://aom.heavengames.com/downloads/showfile.php?fileid=7153
-----------------------------------------------------------
www.freewebs.com/mod-sun-kirbyfanchat forums downloads and more...
<(*_*)><(*_*< )(>*_*)><(*_*)>(>*_*< )<(^_^)>
nottud
Hero
posted 26 December 2007 07:06 PM EDT (US)     8 / 13       
IDs are not strings but numbers that will often have strings attatched to them. For exmaple every unit in the game has an ID. For exmaple hawk has an ID of 0 while bella has an ID of 800.
* I noticed that nottud uses trUnitSelect() instead of ByID, this somehow does not work for me. And I think it should not, because the SrcObject returns the unit ID. I also noticed in the debugger (looking at triggertemp) that my ID was always 0.
First unit placed on map always has an ID of 0.

trUnitSelect() - selects unit by unit name. Whta can be confusing is the names are actually numbers which can fool you into thinking they are IDs when they are not. For trCommands use the normal unit select while kb commands tend to use unit IDs so use trUnitSelectByID() instead. Console commands tend to use currently selected unit or IDs. If it is for currently selected units then they are almost useless as triggers.

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.
angryzor
Mortal
posted 27 December 2007 07:46 AM EDT (US)     9 / 13       
What kirby is talking about are the String ID's.
They are used all over AoM and have nothing to do with units. It's the $${number}$$ you see in the triggers included with AoM. It's the ID of the string that should be there and is used for localization. For example French ppl will have a xpacklanguage.dll file where all the ID's correspond to French versions of the text in the game. The text behind the $${number}$$ is probably a fallback text.

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-27-2007 @ 07:47 AM).]

Mythic_Freak
Mortal
posted 27 December 2007 08:30 AM EDT (US)     10 / 13       
Uh... when did we get to the xpacklanguage.dll file? That's a totally different matter.

But I really don't understand why ES made:
* unit in-game names
* unit editor/proto names
* unit proto IDs
* unit names
* unit game IDs
* ...

Thats list could easily be cut down to 3 items...

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
angryzor
Mortal
posted 27 December 2007 08:49 AM EDT (US)     11 / 13       
Uh... when did we get to the xpacklanguage.dll file? That's a totally different matter.
That's in short terms what I was saying.
But I really don't understand why ES made:
* unit in-game names
* unit editor/proto names
* unit proto IDs
* unit names
* unit game IDs
* ...
Me neither...
I don't see the difference between these two though: unit in-game names; unit names
Or do you, by unit in-game names, mean the actual name of the unit that's visible to the player (the one you can change with Change Name)?

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!
MoD_SUN_kirbyfan
Mortal
posted 27 December 2007 10:58 AM EDT (US)     12 / 13       
it was where the unit IDs are too and i just mentioned it just for you to know if you want to have a trigger ID in there

I can finally get online in AoM and AoMTT via laptop!!! to get my kriby auto escape goto
http://aom.heavengames.com/downloads/showfile.php?fileid=7153
-----------------------------------------------------------
www.freewebs.com/mod-sun-kirbyfanchat forums downloads and more...
<(*_*)><(*_*< )(>*_*)><(*_*)>(>*_*< )<(^_^)>
Mythic_Freak
Mortal
posted 28 December 2007 07:53 AM EDT (US)     13 / 13       
I don't see the difference between these two though: unit in-game names; unit names
Well, thats what they said up there. With the in-game name I mean the scenario name or even the default case, say 'murmillo'.

But invent00r said that there is another "unit name" that's actually a number too. (beats me... :s)

Lets see: e.g.
* unit in-game names: murmillo
* unit editor/proto names: swordsman
* unit proto IDs:
* unit names:
* unit game IDs
* ...

Thats how I understand it now.

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 @ 07:56 AM).]

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

Hop to:    

Age of Mythology Heaven | HeavenGames