PDA

View Full Version : Triggering - beyond traits and ancillaries



Dol Guldur
07-23-2005, 21:13
I have been looking over the Traits and Ancillaries and wonder if there is a way that these can provide a way to indirectly affect or open up the creation of units and/or buildings.

Can these triggers have a more direct effect?

Epistolary Richard
07-25-2005, 09:47
No, those files can only effect traits and ancillaries. The same events, conditionals and commands however can be used in scripts which can simulate the creation of buildings and units.
.

Dol Guldur
07-25-2005, 17:54
Show Me scripts are of no use, but there must be a way to make units and buildings be built or accessible through such code as is found in the ancillaries/traits files.

How does Rome bestow (say) wardogs upon your capital when you complete a mission in vanilla?

How does it recognise which settlement is capital as well? How does it create the unit?

Epistolary Richard
07-25-2005, 18:00
The Senate and the method by which it grants its rewards are all hard-coded. The only thing we have access to is in descr_senate.

Dol Guldur
07-25-2005, 18:14
I see.

What about "spawn_army"?

What about adoption and successful bribery effects (i.e. the creation of units)?

Epistolary Richard
07-25-2005, 18:19
We've had no success getting spawn_army to work, spawn_character works but only for agents - captains and generals appear without their bodyguards and cannot move or interact with others. The mechanism by which adoptions occur and bribery works are both hard-coded (as far as I'm aware). All we can do with bribery is change which factions the unit will actually fight for when bribed.

Dol Guldur
07-25-2005, 19:39
Pity,

Have you got I_SettlementOwner [settlement name] = [faction name]

to work? Does this work for your own faction as well as AI ones?

I have not got it to work from my own faction. What does the I stand for anyway? Seems ot have something to do with the factions that are Ai controlled.

Epistolary Richard
07-25-2005, 19:49
That works, it's a conditional which returns true when the settlement specified is controlled by the specified faction.

Dol Guldur
07-25-2005, 20:23
It seems to be a conditional that returns true whatever faction name or settlement you stick in it! :(

I even put "and not" and it still returned true.

Have you an example of its coding in a trigger block?

Epistolary Richard
07-25-2005, 21:05
Not in a trigger block, no. In the prologue campaign script though:

while I_SettlementOwner Tarquinii = greek_cities
end_while

Simetrical and Malrubius are two people who know a lot about triggers for traits, hopefully one of them will share their experience.

Malrubius
07-28-2005, 18:55
It seemed to work properly for me:

I used



and not I_SettlementOwner XXX = greek_cities


Where XXX was a settlement not owned by the greeks, and that line returned True.

and I used


and I_SettlementOwner XXX = greek_cities


With XXX not owned by the greeks and it returned False.

Dol Guldur
07-28-2005, 21:58
I am not getting that result. In your examples above, what happens when you are playing as the greek_cities?

EDIT: What I am trying to achieve (among other things and general research) is for a general who takes a certain city to be given a unique ancillary. Of course, I want the same to happen if the AI takes the city instead (given that it is not excluded from obtaining that ancillary).

How does assignation of ancillaries work anyway? Which general is chosen? What happens if you don't have isGeneral?

Malrubius
07-28-2005, 23:59
I was playing the greek_cities in that example.

IsGeneral is the one who's in charge of the army, the way I understand it. He'll get all the traits from battles, etc.

This is how I'd do it:

edct:

Trigger GeneralCapturesRome
WhenToTest GeneralCaptureSettlement

Condition SettlementName Rome

Affects GiveGeneralTrait 1 Chance 100


eda:


;------------------------------------------
Trigger trigger_someancillary
WhenToTest CharacterTurnEnd
Condition EndedInSettlement
and SettlementName Rome
and IsGeneral

AcquireAncillary someancillary chance 100


This will give a trait to the general who captures Rome, and give the ancillary to any general who ends his turn in Rome. You could add
and Trait GiveGeneralTrait > 0 to the ancillary trigger to make sure only the conqueror gets the trait, and not just any general who sits in the city.