View Full Version : Ancillary triggers
Makanyane
09-02-2007, 22:54
does anyone know for sure if
WhenToTest PostBattle
Condition WonBattle
and PercentageEnemyKilled >= 40
type triggers work when battles are autoresolved? I'm running game on yearjump script to see what AI generals are ending up with and they don't seem to be getting anything with that sort of trigger (unless i just messed something else up :embarassed: )
EDIT: nvm, I think its just that I've got battle odds and success level conditions associated with them that the AI won't tend to get a result on. Testing as human player with anc. conditions reduced does get them on autoresolve. I've got a human player trait set for the campaigns so I'll probably make an easier trigger if "Trait human_player = 0", that should fix it.
Makanyane
09-05-2007, 08:34
might as well use this thread - answered above question by testing^, triggers do fire its just AI on autoresolve doesn't get the necessary sort of against the odds battle results.....
So.... what I want to do is get AI to acquire certain ancillaries according roughly to who's better general in faction, by command star of something similar, have found you can have multiple triggers for same ancillary (which original game doesn't normally) but it doesn't seem to do anything logical with them in terms of order eg trying descending run of triggers
Trigger trigger_fstestcccc
WhenToTest CharacterTurnEnd
Condition FactionType alemanni
and not FactionwideAncillaryExists first_sword
and Attribute Command = 5
and not IsFactionLeader
and not IsFactionHeir
AcquireAncillary first_sword chance 100
;--
Trigger trigger_fstestbbbb
WhenToTest CharacterTurnEnd
Condition FactionType alemanni
and not FactionwideAncillaryExists first_sword
and Attribute Command = 4
and not IsFactionLeader
and not IsFactionHeir
AcquireAncillary first_sword chance 100
down to 3, 2, 1 command, normally seems to just give it to first general in the army display list, have fiddled with missing out some attribute levels and it then seems to give it to lowest one, have fiddled with order and that doesn't work either.... any ideas anyone? How I can get a comparitive 'best leader' trigger? (btw I really actually need the four best just to complicate things a bit)
EDIT: to answer the obvious question I do have way of making trigger AI only as its for provincial campaign where one faction only is playable, so that faction will have disabling "Human_Player" trait.
Maybe it is too late, but I have an idea: you can use different turn conditions for each command value.
Trigger trigger_1
WhenToTest CharacterTurnStart
Condition FactionType alemanni
and I_TurnNumber = 1
and not FactionwideAncillaryExists first_sword
and Attribute Command = 5
AcquireAncillary first_sword chance 100
;--
Trigger trigger_2
WhenToTest CharacterTurnEnd
Condition FactionType alemanni
and I_TurnNumber = 1
and not FactionwideAncillaryExists first_sword
and Attribute Command = 4
AcquireAncillary first_sword chance 100
;--
Trigger trigger_3
WhenToTest CharacterTurnStart
Condition FactionType alemanni
and I_TurnNumber = 2
and not FactionwideAncillaryExists first_sword
and Attribute Command = 3
AcquireAncillary first_sword chance 100
;--
Trigger trigger_4
WhenToTest CharacterTurnEnd
Condition FactionType alemanni
and I_TurnNumber = 2
and not FactionwideAncillaryExists first_sword
and Attribute Command = 2
AcquireAncillary first_sword chance 100
This way you can check all possible 4 command values along 2 turns.
I didn't test it but I think it could work. Tell me if it helps.
Makanyane
09-13-2007, 18:03
ah that's an excellent idea (I just need to convince myself to go off and re-write all the triggers again!) - I'd about given up on that and just made it go to any 2* plus AI general on turn after loss, but I'm sure your solution must work and sounds a lot better :2thumbsup:
Your better bet, might be to add this into the prologue script itself, because then the tests can be done each turn, and completely in one turn.
Makanyane
09-13-2007, 22:52
Your better bet, might be to add this into the prologue script itself, because then the tests can be done each turn, and completely in one turn.
I think I'm about to look very dumb - but the mod isn't 'scripted' as in having a background script running after re-load.
What did you mean by prologue script? Is there something you can set that effects the way triggers are handled... or are you just assuming mods scipted???
My bad, I misread, provincial campaign as prologue campaign which I thought has to have a script of some sort.
Either way if you add a script or add it to a script, the advantage is that the script runs top to bottom, so any checks before using the give_ancillary command will be done in order unlike in the ancillary triggers as you've described above. This might make it easier and certainly you wouldn't need triggers for every turn, as one set of monitors that trigger each turn should do the trick, I'd think.
vBulletin® v3.7.1, Copyright ©2000-2025, Jelsoft Enterprises Ltd.