Author: Swagger
Original Thread: Yes/No Event Tutorial

Yes/No Event Tutorial
Hello,

I haven't seen any tutorial on this so after some study and testing I managed to get a simple, yet complete way to script Yes/No events.
First of all let me credit Boicote for his efforts on simplifying the Yes/No scripts.
I greatly recomend you to take a look at the CA's Docudemon files for making your own script events, conditions and effects.

I'm now showing you how to make a simple yes-no event.
It's turn 1, and you receive a message asking if you want to accept some blood money. You can either accept it, or not.
Accepting it will grant you an extra 5000 denaries, if you don't, you lose 5000 denaries from your treasury (it's just a small example of course).

To create one, open the campaign_script.txt file inside data/world/maps/campaign/imperial_campaign/, you're also required a notepad/.txt editor.

Here's the base script:
Spoiler for The Base Script
;Money Extra Yes/No

declare_counter extra_money_offered

monitor_event FactionTurnStart FactionType egypt
and I_LocalFaction egypt
and I_TurnNumber = 1
and I_CompareCounter extra_money_offered = 0

add_events
event counter extra_money_accepted
event counter extra_money_declined
end_add_events

historic_event extra_money true factions { england, } ;makes event message appear
set_counter extra_money_offered 1

terminate_monitor
end_monitor

;;;;;;;;;;;;;;;;;;;;;;;;; accepts blood money ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

monitor_conditions I_EventCounter extra_money_accepted = 1

add_money England 5000 ;the effect is adding 5000 denaries
historic_event extra_money_accepted factions { england, } ;message appears saying it was accepted

terminate_monitor
end_monitor

;;;;;;;;;;;;;;;;;;;;;;;;; doesn't accepts blood money ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

declare_counter extra_money_rejected

monitor_conditions I_EventCounter extra_money_rejected = 1

increment_kings_purse egypt -5000

set_counter extra_money_rejected 1

terminate_monitor
end_monitor

Be sure to rename all the counters with the same name.

So if you rename this:
;;;;;;;;;;;;;;;;;;;;;;;;; doesn't accepts blood money ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

declare_counter extra_money_rejected
Be sure to also edit all the counter who have,
something_counter x_y_rejected
With the exact same name and so on.

As for the messages it will show, just open historic_events.txt placed in data/text folder and edit accordingly to the text you wish it to be.
historic_events Your wanted text here.
In my case:
{EXTRA_MONEY_BODY} My Lord, we've been asked if we shall accept blood money, press "Accept" to get the money, press "Decline" to refuse the offer
{EXTRA_MONEY_TITLE} Accept Blood Money?

{EXTRA_MONEY_ACCEPTED_BODY} My Lord, we have accepted the money offer, the 5000k denaries have been increased in your royal treasury
{EXTRA_MONEY ACCEPTED_TITLE} Money Accepted

{EXTRA_MONEY_DECLINED_BODY} My Lord, we have refused the money offer, our royal treasury is now shorter by 5000k denaries
{EXTRA_MONEY_DECLINED_TITLE} Money Refused
This is a very simple Yes/No script. You can then add your own commands, conditions and events.
Basically, you can do nearly anything with this.
Personally I love this to add a great RPG style to the mods, as it can simulate a Kingdom Management system. Where the player decisions have impact on the kingdom and sometimes, the world itself.

Again, credits should be given to Boicote, for his work