Level Editor: What are the possible values that can be supplied to UnitHasRequisite function?

  • We have updated our Community Code of Conduct. Please read through the new rules for the forum that are an integral part of Paradox Interactive’s User Agreement.

jett_way

Recruit
Jan 9, 2023
1
0
In the (totally fantastic) map that I am making, I want to react to (randomly selected) Leaders having a certain class. The UnitHasRequisite function seems like my only option, but the documentation says nothing about what I would need to supply as the second argument; only that its type is UnitRequisite. I tried various sensible strings (e.g. "ARCHDRUID", "ANIMIST") and even cracked open the mod editor and found an ID such as "#0000014D000006BA", but none of those worked. Please help.

int UnitHasRequisite(unitAlias : string, requisite : UnitRequisite)

While we're at it, according to the Programming in Lua book, "Lua considers both zero and the empty string as true in conditional tests," so is the return value for this function really a Boolean, not an int?
 
Don't know if that function looks for that, but there's a unit's requisite entry within the resource editor. Perhaps this helps.
The different requisite types are defined in the "AoW_UnitPorperties.rpk", if ResourceIDs are needed for the function. I doubt that those are called on with integers.

1676036117162.png
 
Last edited: