View Full Version : Character Age, Detecting Settlement Captures
I've been experimenting with a couple of things lately but haven't had much success getting them to work. I wonder if anyone has any ideas:
Character Age
===========
I'd like to be able to assign a trait to a character when he reaches a certain age. The problem is that I don't see any way of determining how old he is. I can imagine keeping track of age with an age trait, but this will only work for characters who enter the game at age 16. Adoptees and sons-in-law can enter the game at just about any age from 16 on up.
Settlement Capture
===============
I'd like to have a background script do something to any settlement that changes ownership. The problem here is determining when a settlement changes hands. There are events which are sometimes triggered when this happens: sacking, enslavement, extermination. But (I think) some of these require a character to be present and not all of them export the settlement name. In addition none of those events apply to a simple capture and occupation. Anyone have an idea as to how this might be done?
nikolai1962
04-12-2006, 18:25
I tried to get an age myself once for a roman career thing but could never see how to do it. Character records are passed to a lot of triggers and age must be one of the attributes a general has but i never managed to get the syntax for it (if it is possible at all).
I don't know much about scripting but i'd suggest d/ling some mods with scripts and seeing what they've done.
Malrubius
04-12-2006, 19:48
I had no luck trying to figure out the age of generals, myself, unless they passed through the CharacterComesOfAge event. If anybody's had any luck, let me know. :wall:
nikolai1962
04-15-2006, 00:14
Someone on a thread somewhere mentioned they saw a CharacterName being referenced in a CA thing. I can't recall if it was a script or a trait/advice/ancillary trigger. It made me think CharacterAge might be the attribute to check for but i think i tried this way back before i gave up. I didn't really know what i was doing though. So many of the triggers seem to get passed a character record you'd think it would be in there somewhere as an attribute or something.
I appreciate your responses guys, and thought I ought to get back to you.
I tried to get an age myself once for a roman career thing but could never see how to do it.
Yes, exactly what I had in mind. Did you find another way to go about it?
It made me think CharacterAge might be the attribute to check
I fiddled around with this suggestion of yours but had no luck; thanks though.
I had no luck trying to figure out the age of generals, myself, unless they passed through the CharacterComesOfAge event. If anybody's had any luck, let me know.:wall:
I'll do that if I figure something out, but that's not looking very likely right now. I second your :wall:.
I did make some progress on the settlement capture issue, though I don't know if it's of interest to you. It turns out that the GeneralCaptureSettlement event fires even if the stack that captures the settlement is commanded by a captain. So it appears that every time a settlement changes hands there should be a GeneralCaptureSettlement or CityRebels event.
Modding Forum
04-16-2006, 16:37
If it existed then it should be documented in the docudemon files - but I've been through them pretty thoroughly and there's no mention of it.
If it existed then it should be documented in the docudemon files (https://forums.totalwar.org/vb/showthread.php?t=54299) - but I've been through them pretty thoroughly and there's no mention of it.
You are correct RTWMF. I have been through the docudemon files many times also and haven't found what I'm looking for. But, having perpetrated a few of them myself (intentionally and otherwise), I know that there are always backdoors, hacks, and undocumented features.
nikolai1962
04-17-2006, 10:45
Originally Posted by nikolai1962
I tried to get an age myself once for a roman career thing but could never see how to do it.
Yes, exactly what I had in mind. Did you find another way to go about it?
No i gave up as it was too annoying having 60 year old adoptees with "this man has just started out on the cursus honorarum" trait :)
Other people have done more. I think the TFT mod has a very detailed system and i think EB does too. Have a look through their code maybe?
No i gave up as it was too annoying having 60 year old adoptees with "this man has just started out on the cursus honorarum" trait :)
Other people have done more. I think the TFT mod has a very detailed system...
Our (TFT that is) system does not capture age for adoptees - rank is determined for adoptees based on the traits of the adoptive father. So your 60 year old adoptee would gain a social class equivalent to his father.
Avicenna
04-20-2006, 18:12
There should be a way of determining the age though, since the portraits can tell the age: they automatically get older when the character turns 50. If you could that trigger it might be able to do what you want.
nikolai1962
04-21-2006, 04:51
Our (TFT that is) system does not capture age for adoptees - rank is determined for adoptees based on the traits of the adoptive father. So your 60 year old adoptee would gain a social class equivalent to his father.
Clever.
There should be a way of determining the age though
Yes, there should :)
No doubt there's an age variable for each character. Only it's not exported to the scripting system but stays internal.
Just as the portraits btw, which we can't influence either.
To determine character age, use CharacterAge in export_descr_character_traits.txt but not as a trait...
;------------------------------------------
Trigger general_ages1
WhenToTest CharacterTurnStart
Condition AgentType = family
and CharacterAge > 15
and CharacterAge < 40
and Trait AgeingGeneral < 1
Affects AgeingGeneral 1 Chance 100
I've got this working in my bug-fixer 3.36/GAPH Modded RTW :)
You mean there is actually condition CharacterAge in the game?
Great find...
nikolai1962
05-07-2006, 03:57
To determine character age, use CharacterAge in export_descr_character_traits.txt but not as a trait...
;------------------------------------------
Trigger general_ages1
WhenToTest CharacterTurnStart
Condition AgentType = family
and CharacterAge > 15
and CharacterAge < 40
and Trait AgeingGeneral < 1
Affects AgeingGeneral 1 Chance 100
I've got this working in my bug-fixer 3.36/GAPH Modded RTW :)
Argh! When i was trying i tried
"Trait CharacterAge" and "Attribute CharacterAge" but not plain CharacterAge
I bet you can get CharacterName too.
Definitely a great find. Kudos
Marcus Camillus
05-07-2006, 05:57
To determine character age, use CharacterAge in export_descr_character_traits.txt but not as a trait...
;------------------------------------------
Trigger general_ages1
WhenToTest CharacterTurnStart
Condition AgentType = family
and CharacterAge > 15
and CharacterAge < 40
and Trait AgeingGeneral < 1
Affects AgeingGeneral 1 Chance 100
I've got this working in my bug-fixer 3.36/GAPH Modded RTW :)
This is great news indeed. Its just what I have been looking for to use in my current mod so that newly acquired Roman characters can have the experience and ranks appropriate for their age. Now its back to my "Mod Testing Lab" for some new experimenting. Thank you for sharing this!:2thumbsup:
Before you guys get overexcited let me state that this condition doesn't work for me.
When I try to use it, it actually works as if there was no condition at all.
What I tried was a vanilla game with triggers:
Condition CharacterAge > 40 - where it was awarded to all characters
Condition CharacterAge < 15 - where it was again awarded to all characters
Condition not CharacterAge >= 15 - where it, too, was awarded to all characters
Concluding this condition seems to work like TrueCondition (or is not included at all) ;)
To determine character age, use CharacterAge in export_descr_character_traits.txt but not as a trait...
;------------------------------------------
Trigger general_ages1
WhenToTest CharacterTurnStart
Condition AgentType = family
and CharacterAge > 15
and CharacterAge < 40
and Trait AgeingGeneral < 1
Affects AgeingGeneral 1 Chance 100
I've got this working in my bug-fixer 3.36/GAPH Modded RTW :)
I was unable to get this CharacterAge thing to work. It's been my experience that if you add a condition that makes no sense, a trigger will always treat the condition as being true. I thought this might be what happened here, so I tried the following experiment.
I created a trait named ImpossibleTrait:
;------------------------------------------
Trait ImpossibleTrait
Characters family
Level Impossible_Trait
Description Impossible_Trait_desc
EffectsDescription Impossible_Trait_effects_desc
Threshold 1
which is enabled only by the trigger ShouldntSucceed:
;------------------------------------------
Trigger ShouldntSucceed
WhenToTest CharacterTurnStart
Condition CharacterAge > 25
and CharacterAge < 25
Affects ImpossibleTrait 1 Chance 100
Clearly this trigger should never succeed, so no character should ever acquire the trait ImpossibleTrait. However, when I ran the game, all my characters immediately acquired the it.
So, if I haven't screwed up here (and please experiment for yourselves - I'd very much like to be wrong), CharacterAge is meaningless and any condition using it simply evaluates to true by default.
maste1n,
If your trigger works correctly, a character 40 years old or more who doesn't already have the AgeingGeneral trait will never get it. Have you verified this?
Just rechecked this and it looks like Atilius is right.
I've been playing with various age style checks and only CharacterAge seemed to work.
Just changed it back to Age and it does exactly the same.
Really sorry guys, I thought I'd cracked it and wanted to pass it on.
I'll keep looking.
No problem maste1n, the trigger parser should really generate a show_err when it doesn't understand a condition. The fact that it doesn't is an ongoing source of grief.
nikolai1962
05-07-2006, 19:44
:oops:
Marcus Camillus
05-08-2006, 01:31
Darn, I was really hoping this would work. There aught to be some syntax for the age attribute. Well, guess I am stuck for now with my interum workaround. Thanks for trying though.
vBulletin® v3.7.1, Copyright ©2000-2025, Jelsoft Enterprises Ltd.