the problem is that my trick (if it works) will work for all characters except heretics, so spies, assassins, priests, etc, can also get it
if it works you might want to keep excluding until it works only for X
the problem is that my trick (if it works) will work for all characters except heretics, so spies, assassins, priests, etc, can also get it
if it works you might want to keep excluding until it works only for X
Under the Patronage of the Dreadful cedric37!
Ancs Guide, Emergent Factions , Yes/No Events |L'Outremer for Modders| Swagger's Skymod
![]()
Swagger: You can also do this with the ‘AgentType’ condition:
Spoiler Alert, click show to read:
Spoiler Alert, click show to read:
Spoiler Alert, click show to read:
yes, but gigantus said it doesn't work
AgentType = general
- tests for a captain, needs 'named character'
the game doesn't recognize whichever agent he wants to get it as general :/
Under the Patronage of the Dreadful cedric37!
Ancs Guide, Emergent Factions , Yes/No Events |L'Outremer for Modders| Swagger's Skymod
![]()
Sorry Swagger, what I was trying to say is this. If you use ‘AgentType = general’ it won't work because that only tests for a captain as Gigantus posted. But if you use ‘AgentType > general’ that test works for a captain or any greater agent type, the greater types being a ‘named character’ or ‘family’. That's how it works in a script anyway.![]()
The genral problem here is not the agent type, it is the condition that requires an army attached to that character. Unfortunatley none of the events that I could use export an army.
Hence my thought that this was originally only for the battle scripts.
The trigger(s) as described in the first post work to my satisfaction and without side effects - I am just pedantic when it comes to my log. There shouldn't be any errors in it from a normal running, only when there are real problems. The same annoyance I feel when I have a script with Germanicus' AI 'stockade' part in it. It puts out errors, but works perfectly.
Maybe we just have to live with this: it is already an achievement to have elephants jump through hoops, shouldn't moan when they leave some droppings behind.
Oh I see, you're saying it works fine and you have no problem... Yes you are being pointlessly fussy![]()
If I may contribute some findings - not a solution - regarding exactly when the error message appears.
For me it only seems to be when two or more named characters (NCs) are in the same army (I'm ignoring those in settlements or at sea).
Using this in campaign script, playing as Scotland...
...with an army of units with the "custom_attr" custom attribute and experimenting with giving it named character generals:Spoiler Alert, click show to read:
- Army with no NC: money added, no error.
- Army with 1 NC: money added, no error.
- Army with 2 NCs: no money, error.
- Army with no NC + 2nd army consisting of just 1 NC: money added, no error.
- Army with 1 NC + 2nd army consisting of just 1 NC: money added, no error.
- Army with no NC + 2nd army consisting of just 2 NCs: no money, error.
When an error occurs that's it: that monitor stops working for the rest of the game.
~~~~~~~~~~~~~~~~~
With trait triggers it was similar: only an error when 2 NCs in an army.
These triggers toggle a trait on and off based on whether the NC is the commander of an army with custom units in it (or that's the plan):
Spoiler Alert, click show to read:
Mostly it's fine: despite errors in the log the traits come and go as expected. However, it does break in this situation:
- Army1 contains custom units.
- NC1 is the commander of Army1 (trait=on).
- Army2 is commanded by NC2 who outranks NC1.
- When NC1 is moved into Army2 he is no longer the commander, so he has "no army"; after end of turn he still has the trait on (error in log) and continues to do so until he is made a commander again. (He shouldn't because he is not the commander. He does because the error broke the code and failed to turn off the trait.)
Unlike campaign script, errors here don't break the trigger permanently. (Maybe that's common knowledge to most; news to me).
~~~~~~~~~~~~~~~~~~
In summary:
- IsGeneral just means they can command an army; this includes non named characters (captains).
- For an army with no NC, IsGeneral will be true for the captain. PercentageUnitAttribute works on that captain.
- For an army with 1 NC, IsGeneral will be true for that NC. PercentageUnitAttribute works on that NC.
- For an army with 2+ NCs, IsGeneral will be true for each NC, but PercentageUnitAttribute will only work for the commander.
- For an army of just 1 NC and no other units: PercentageUnitAttribute works as normal.
- IsAdmiral does not mean the character "has an army", despite the Docudemons
Indeed it would be very helpful for some kind of "HasArmy" or "IsCommander" condition.
Last edited by Withwnar; October 04, 2011 at 11:05 PM.
The only solution, to get rid of the message, and possibly to fix the problem, would be to use the HighestAttAdjacentChar condition. You'd need 10(?) versions of the trigger, each one with the conditions:
This way the trigger will only fire if the named_character has the highest command attribute. Note this doesn't work if two generals have the highest command because I don't know how the game breaks the tie.Code:and Attribute = X and HighestAttAdjacentChar command named_character < X
Under the patronage of Roman_Man#3, Patron of Ishan
Click for my tools and tutorials
"Two things are infinite: the universe and human stupidity; and I'm not sure about the universe." -----Albert Einstein
I considered HighestAttSharedChar...
Is the highest attribute rating of any character of the same faction sharing the same tile higher than specified?...but dismissed it because of the "tie" situation.
Still, if it means that 90% of errors are no longer generated (non-ties) then it might be worth pursuing.
Does command max at 10 internally?
Last edited by Withwnar; March 02, 2011 at 03:18 AM.
Does it count characters in the same stack as adjacent? Nice idea if so.
I have no idea which is why I said it might fix the problem.![]()
Under the patronage of Roman_Man#3, Patron of Ishan
Click for my tools and tutorials
"Two things are infinite: the universe and human stupidity; and I'm not sure about the universe." -----Albert Einstein
I checked some traits I know only work with adjacent characters, and that's a condition they use. So unfortunately it looks like that one won't work.
Last edited by Taiji; March 01, 2011 at 04:28 PM.
I have written a tool to filter these errors from a log.
A little tricky because they span four lines but it seems to work.