Hello, I have a problem that I need help solving with an educational scenario I am trying to build for some friends and I. I am trying to institute a rule that checks how many villagers a player has, and uses that to gatekeep access to Imperial Age if a player does not have enough villagers. Problem is, the triggers I’m using to try and stop this from happening aren’t working how I want them to. Either Imperial Age is always available, or never available, regardless of how many villagers a player has. I have tried a host of different permutations on what I think accomplishes the goal, only for it to result in one of the two previous results.
Here are my goals for the triggers to accomplish:
- Imperial Age is disabled/unavailable/cannot be clicked while player has <100 villagers
- A check for if a player owns greater than or equal to 100 villagers
- Imperial Age becomes enabled/available to players who meet the check. (Players MUST click-up to Imperial Age, it cannot be queued or researched for them.)
Here is what I’ve tried:
- Disabling Imp. under options, then using triggers to try and re-enable Imp.
- Disabling Imp. using triggers, then using triggers to try and re-enable Imp.
- Disabling Imp. using individual triggers for each player, then using different triggers to disable aforementioned triggers and activate the triggers that try and re-enable Imp.
- Permutations of the previous three experimenting with different conditionals and tweaking effects
I’m frustrated that I can’t seem to make this simple idea work, and I don’t want to have to resort to some weird hacky workaround, so if you have a solution doable with triggers, or have valuable insight that would force me to concede on how I allow players to Imperial Age, sharing it would be much appreciated. Thank you.
Your first attempt sounds like it should work (assuming you have a trigger to enable it for each player), and the part that’s tripping you up is actually most likely to be your condition to unlock imp. There’s a lot of different variants of the Villager in the game, which actually have different IDs, so if you have a condition “OwnObjects P1 Villager 100” that would be checking specifically against only one of those many types of vill (I believe it’d be the male “true villager”, that gets swapped to when told to attack something or created without a task). If you instead select no unit, but the object class “Civilian” (use object class rather than object type, as the object class civilian includes all villager variants, whereas the object type civilian includes vills and other economic units, and then some), it should work. So the condition would instead be “OwnObjects P1 Civilian (class) 100” to check that player 1 owns at least 100 vills. Hopefully that helps fix your problem.
1 Like
Thank you, your suggestion has worked! I was using OwnObjects P1 Villager 100, but I guess I never tried switching it to ‘none’ and relying on the ‘civilian’ class instead for the condition. I thought that “Villager” would cover both the male and female variants (as in the dropdown menu it does specify between male and female, so one would assume that the option labeled ‘Villager’ with no further specification would logically cover both cases.) but apparently that is wrong?! I’ll keep that in mind when working on future projects.
Once again, thank you!
No problem, glad it works. If you want a more comprehensive explanation, this screenshot from the DAT file might help to understand it:
The “C 4,” search that I have is for class 4 (the civilian class), and it contains all of the villager variants you would expect to have been included with your previous setup, as the villager actually transforms into a completely different unit depending on the task you assign to it. The actual “Villager” you selected previously in the dropdown one of the specific IDs for 83 (male default vill) or 293 (female default vill). I believe it’d be 83, as that’s first in the list. Because vills don’t tend to just stand around in their default form or attack something though (in addition to typically being split roughly 50/50 between the vill genders), it’d be extremely unlikely to actually get 100 copies of unit 83 on the map at a time, hence why using the class civilian works properly for what you’re trying to achieve.