Object Has Action - Train

Hello people.

I spent a lot of time on the editor of the Age of Kings when I was in middle school (I had much fun re-creating the William Wallace campaign using the official voices) and here I am again with the DE.

I want a trigger to react when a unit is being trained in a building (I’m having fun re-creating a tutorial campaign on AoE II DE: RoR). To take the simplest example: when the player clicks the villager button, I want effects to happen.
So I tried to use the condition “Object Has Action”.

Trigger “Villager Creation”:

  • Condition “Object Has Action”:
    I clicked on “Set Object”, then clicked on the Town Center. For “Unit AI Action”, I selected “Train”. So I expect the condition to trigger when the player adds a Villager to the Town Center’s queue and thus making it being in the “Train” state (I don’t know how precisely it is coded so don’t hesitate to correct me for the vocabulary and all).
  • Effect “Display Instruction”, saying something like “Well done, you’re so great! Oh my God, let’s make a party to celebrate that”.

But nothing happens when I test and click on “Create a Villager”. My other triggers work fine.

Is it because I put nothing for “Next Object”? But the condition turned green so I guess it’s not needed.

I search on the internet and on this forum, and I found nobody talking specifically about the “Train” action for Object Has Action. And it seems it could work even without selecting any unit (by using the “Object List/Group/Type” selection lists) but only using scripts (it goes red until with select a unit for the “Set Object”), based on that website: Functions - AoE2DE UGC Guide.

EDIT:
I tested other Actions with the Town Center and the Villager and some worked (Move, Hunt), other didn’t (Enter and Unload, for example). I’m not sure how the Actions Enter, Train and Unload should be used (maybe it works only on transport ships for the latter).

I tested something and I conclude it’s a bug specific to the Return of Rome DLC of AoE II DE.

I tried the “Object Has Action” Condition in AoE II and I eventually made it work. This is what I observed:

  • the Object that has the Action has to be selected with the “Set Object” button and can be defined only that way (like every other “Object […]” Condition);
  • the “Next Object” button can be used to define the potential target of the Action;
  • the combo boxes are another way to indirectly define the potential targets of the Action;

On AoE II, I clicked “Set Object” then clicked the Town Center, chose “Villager” into the “Object List” combo box (there is also “Villager (female)” and “Villager (male)” but I haven’t tested yet), and chose “Train” into the “Unit AI Action” combo box.
Then I tested, clicked “Create Villager”, and the Effect “Display Instructions” worked.

Then I tried the same in Return of Rome (AoE II DE version), but there are no “Villager” Object name. So I tried with “Villager (female)” and with “Villager (male)” and none of them worked.


EDIT:

I returned to AoE II to test something else, but apparently I hadn’t saved my test. I made the Trigger “Object Has Action - Train Villager” again by doing the exact same thing, but now it doesn’t work anymore, also in AoE II.
I don’t understand what’s wrong, I’m confused :sob:


EDIT 2:

OK, that’s really weird. On AoE II, I selected “Villager (female)” instead of “Villager” and it doesn’t work… most of the time.
Sometimes when I cancel one among several queued Villagers, sometimes when I click “Create Villager”. But it rarely works and it seems random, where I expected it to work at the first queued female Villager.