I was wondering if there is any way to test if an army or character is in a certain region or to return the region that the army or character is in.
I was wondering if there is any way to test if an army or character is in a certain region or to return the region that the army or character is in.
The IsRegionOneOf condition will test whether this character is in a specific region or in one of a selection of regions.
e.g. In campaign script...
(No idea of those region names are correct. Just an example.)Code:monitor_event CharacterTurnStart IsRegionOneOf London_Province York_Province ;this character is in London or York region... do something... end_monitor
You could add other conditions to restrict it to a certain faction, character type, etc.
Thank you that is just what I was looking for!
On a related note, is there a condition to test if a character is inside of a certain country's borders? (like it will return true if the specified character is in a region that belong's to a faction)
Thanks again.
You're welcome.
Not easily. Possibly something like this...
...which only handles one faction (France) being in one other faction's (Engand's) borders, and even then will be lengthy if you want to include all regions on the map. I haven't used IsGeneral much; not sure if it includes regular "generals" (captains), i.e. armies without named character commanders.Code:declare_counter french_within_english_borders monitor_event PreFactionTurnStart FactionType france set_counter french_within_english_borders 0 end_monitor monitor_event CharacterTurnStart FactionType france and IsGeneral and IsRegionOneOf London_Province and I_SettlementOwner London england set_counter french_within_english_borders 1 end_monitor monitor_event CharacterTurnStart FactionType france and IsGeneral and IsRegionOneOf York_Province and I_SettlementOwner York england set_counter french_within_english_borders 1 end_monitor ... and so on for every region that you want to include...
Last edited by Withwnar; March 13, 2012 at 11:05 PM.
Nope, Is_General only works for Generals aka named characters with a character_record.
A captain does not qualify for any of this.
Ah and afaik PreFactionTurnStart only works in the 0 round = when you start a campaign - I might be mistaken in that one though![]()
It seems that it does work - I just tried it....
When I put a milan army led by a captain in this region then the historic event fires. Also when led by a named character. But it didn't fire for a spy.Code:monitor_event CharacterTurnStart FactionType milan and IsRegionOneOf Nan-Curunir_Province and IsGeneral historic_event nazgul end_monitor
Perhaps you are thinking of traits/ancillaries there Aikanar. IsGeneral would appear not to work on captains in those triggers but that is due to them not being able to have traits/ancs.
Yes, every turn, once per faction, before all other xxxTurnStart events for that faction. Living factions only (I think?).
To my knowledge this is only possible for characters or agents or factions.
Try this:
declare_counter PFTS
monitor_event PreFactionTurnStart I_TurnNumber > 0
inc_counter PFTS 1
end_monitor
And you'll know how many times it fires for all factions in round 2 by checking the (trace) log for the counter![]()
Once per living faction.![]()
See, nice to know and you never stop learning
That's with "read it somewhere" with regards to PreFactionTurnStart
@IsGeneral:
Interesting, that means that captains do have a character_record, thus I was liable to a missconception of how character_record works![]()
They have a character record that's ready to be used for 'man of the hour'. So they can gain traits from the previous battle.