part 3:
Advanced event making
So I discussed the build up of the script and the basic events. I’ll now be elaborating on some of the possibilities for those willing to take it to the next level. Remember some of the things mentioned here will only work under a while-looped script build. They are however easily converted and I will be making the tutorial more general.
First up, a bit more insight into how events are triggered.
Let’s recap some things from part II and I
From part II
Code:
if I_CompareCounter FlandersNobNHuge == 1
historic_event FLANDERS_NOB_N_HUGE1 true
end_if
Now like mentioned before this means the event will run when the counter is 1, This counter is activated during the Slave turn One time loop.
However basically this would work,
I’m not elaborating on all extra conditions in TLR, just remember that a check is in place that only triggers events for counties completely under the local players control (FlandersUnited counter )
Code:
if RandomPercent < 6
and I_CompareCounter RandomEventOne == 0
set_counter RandomEventOne 1
end_if
Since the script runs from top to bottom you can just line them up like normal. Be careful however if you are planning on adding a lot of events, you should make some sort of system that prevents over stacking of events. I use this system ( you’ll recognise it in various other places later too)
Code:
set_counter FallTrough 1
if RandomPercent < 34
set_counter RandomEventOne 1
set_counter FallTrough 0
end_if
if RandomPercent < 51
and I_CompareCounter FallTrough == 1
set_counter RandomEventTwo 1
set_counter FallTrough 0
end_if
if I_CompareCounter FallTrough == 1
set_counter RandomEventThree 1
set_counter FallTrough 0
end_if
The idea is simple and revolves around the utility counter: FallTrough, basically if any event is triggered it prevents any others by resetting the FallTrough counter, wich is a requirement.
This particular part of script will have an equal chance of triggering event 1,2 or 3 ( but will always trigger one) it will however never trigger 2 of them at the same time.
Now in general I try to keep the triggering in the slave turn as simple and uniform as possible.(having a 105 counties this makes the script read easier). This is however subject to change depending on how many events you wish to insert etc.
There are however a lot of options that sprout from this part:
Code:
if I_CompareCounter FlandersNobNHuge == 1
historic_event FLANDERS_NOB_N_HUGE1 true
end_if
Now at the moment it’s all very linear and proper, But we could use “if” statements to make a lot of interesting changes. say:
Code:
if I_CompareCounter FlandersNobNHuge == 1
if (any possible condition/ combination of conditions)
historic_event FLANDERS_EVENT_ONE true
set_counter FlandersNobNHuge 2
end_if
if (any possible condition/ combination of conditions)
historic_event FLANDERS_EVENT_TWO true
set_counter FlandersNobNHuge 3
end_if
end_if
Now instead of the single Loop we’d have to have 2 loops following it,
e.g.
Code:
While I_CompareCounter FlandersNobNHuge == 2
( insert the 2 options for the FLANDERS_EVENT_ONE here exactly as explained in part II)
end_while
While I_CompareCounter FlandersNobNHuge == 3
( insert the 2 options for the FLANDERS_EVENT_TWO here exactly as explained in part II)
end_while
Now it’s time to get creative, I’ll be showing some options based on our earlier example from part II.
All in all I’m quite happy with my event, but it could be better. Firstly I think I’ll make it run over several turns. With different effects depending on what I choose.
Multi Turn Events
This is one of the more invasive alterations, but once you get the hang of how the script works you’ll see it’s not that difficult and you can make it as easy or as complex as you want really.
So lets look at our famine in more detail shall we? What did actually cause it ? how could the situation evolve? This asks for some creative thinking.
Lets say it all started with us needing a lot of troops ( never could have enough of those if you were a medieval ruler it seems)
We’ll be including a new event,
Event 1: Breton nobles can’t afford to send more troops:
options:
A) Pshh, nonsense, if they can’t afford it they should just increase he taxes, and their are plenty of able bodied men on the fields.
B) Okay, we’ll find the support elsewhere, we've been fighting so long perhaps now is a time for peace and rebuilding.
Without further explanation:
-I left out the effect lines for convenience they’ll be added once they become relevant again.-
Code:
if I_CompareCounter EventTriggerCounter == 1
historic_event BRITTANY_EVENT_1 true
- usual effect go here-
;Brittany nobles cannot afford more troops
end_if
while I_CompareCounter EventTriggerCounter == 1
monitor_event ButtonPressed ButtonPressed hud_select_prev_item_cycle
;Pss if they can’t afford it maybe they should raise the taxes.
-The usual effects go here-
set_counter EventTriggerCounter 2
Now this is important, instead of setting the counter to 0 I set it to 2,
both end the loop as it only runs for I_CompareCounter EventTriggerCounter == 1
you’ll see why in the next step
end_monitor
monitor_event ButtonPressed ButtonPressed hud_select_next_item_cycle
;Yes we have asked toomuch of them already, give them time to recuperate
-The usual effects go here-
set_counter EventTriggerCounter 0
end_monitor
end_while
So the event ran we picked a choice ( the first ) and the EventTriggerCounter = 2 now,
At this point we’ll be adding our famine event we made earlier, with a few small changes.
An important thing to remember here is that the script is read only once at the start of the local players turn and from the top to the bottom.
The way it’s put written here does the following,
The event triggers during the slave turn
I pick A
turn ends
turn start.
My decision causes a famine event
If you put the “famine loop” below the “nobles can’t afford troops loop” both events will run in the same turn.
Code:
if I_CompareCounter EventTriggerCounter == 1
historic_event BRITTANY_EVENT_1 true
- usual effect go here-
;Brittany nobles cannot afford more troops
end_if
if I_CompareCounter EventTriggerCounter == 2
historic_event BRITTANY_EVENT_2 true
-Initial famine effects go here-
end_if
while I_CompareCounter EventTriggerCounter == 2
monitor_event ButtonPressed ButtonPressed hud_select_prev_item_cycle
;significantly lower the taxes for the farmers,
-The usual famine effects go here-
set_counter EventTriggerCounter 0
end_monitor
monitor_event ButtonPressed ButtonPressed hud_select_next_item_cycle
;Bastards, god himself granted me the right to rule these lands,
-The usual famine effects go here-
set_counter EventTriggerCounter 0
end_monitor
end_while
while I_CompareCounter EventTriggerCounter == 1
monitor_event ButtonPressed ButtonPressed hud_select_prev_item_cycle
;Pss if they can’t afford it maybe they should raise the taxes.
-The usual effects go here-
set_counter EventTriggerCounter 2
end_monitor
monitor_event ButtonPressed ButtonPressed hud_select_next_item_cycle
;Yes we have asked toomuch of them already, give them time to recuperate
-The usual effects go here-
set_counter EventTriggerCounter 0
end_monitor
end_while
Important notes:
If you are going to make events multi turn you need to add a ‘safety’ in the event triggering lines: to prevent the same event interfering with itself ( unlikely but possible).
Code:
if RandomPercent < 6
Code:
and I_CompareCounter EventTriggerCounter == 0
set_counter RandomEventOne 1
end_if
I now have a multi turn event, but I still have some things I want to add,
Expanded conditionals
These come in all shapes and sizes really and can be used to flavor pretty much everything and anything. Some examples, using the event we just wrote.
Well lets say I only want my famine event to run in the winter
TLR has a counter named Quarter that keeps track of the season,
Quarter == 1 : summer
Quarter == 2 : winter
So I just add this line:
Code:
if I_CompareCounter EventTriggerCounter == 2
and I CompareCounter Quarter == 2
historic_event BRITTANY_EVENT_2 true
-Initial famine effects go here-
end_if
Simple as that! Now instead of running the turn after I forced the nobles to extort the farmers it runs the next winter.
Another kind of conditional effect, is basically an “if” statement ( being scripting most things boil down to this really), some examples:
I was thinking; Maybe it’s a bit odd that picking option A causes a famine every time, I think I’ll make it give you 1 in 3 chance of causing famines:
Again a few simple lines to add:
Code:
monitor_event ButtonPressed ButtonPressed hud_select_prev_item_cycle
;Pss if they can’t afford it maybe they should raise the taxes.
-The usual effects go here-
set_counter EventTriggerCounter 0
This will end the event without a famine resulting from it next winter however:
if RandomPercent < 34
set_counter EventTriggerCounter 2
end_if
This will end the event with a famine following after it next winter, ( see above) ,
remember the order of things is important!!
The script runs from top to bottom!!
if you put this part above the “set_counter EventTriggerCounter 0”
you’ll never get a famine as it will reset your counter!
end_monitor
A list of interesting conditions, see the “docudemons conditions” for more info! pretty much all the I_conditions work I restricted myself to the ones I find interesting.
Some of these are nation specific, which means either you’ll have to make a work around (see below) or you can only use them for nation specific events ( where you already know which faction you need)
This can obviously be used everywhere in your events, so a creative person can make no end of cool events with this.
Some examples:
A Noble asks you to back him up in some large struggle for land with the local bishop, in return he will give you is support however the bishop mustn't find out! and he might also just fail in his endeavour! just put some “ RandomPercent” in the effects.
-I assume everyone gets the event basics by now so I’m not going to be repeating everything-
Code:
monitor_event ButtonPressed ButtonPressed hud_select_prev_item_cycle
;support him
set_counter EventTriggerCounter 0
set_counter FallTrough 1
effects
if RandomPercent < 67
;Yay he did it !
set_counter FallTrough 0
effects
if RandomPercent < 26
;Bishop found out, not so yay!
effects
end_if
end_if
if RandomPercent < 51
and I_CompareCounter FallTrough == 1
;he failed and the bishop found out about your support :/ I geuss it’s just not your day
effects
end_if
end_monitor
So there are a few things in here, Firstly there are 3 if statements, creating 4 possible scenario’s if you wish to support him:
he succeeds bishop doesn’t find out
he succeeds bishop finds out
he fails bishop doesn’t find out
he fails bishop finds out
Secondly as you can see the “FallTrough” counter is back,
it just makes sure that if he succeeds the bisshop can only find out in the first if statement.
The second one is in case he fails only, as you can see the chance of the bishop finding out if he fails are larger.
Events and the EDB
Now we’ve explored the options of the campaign script itself, we’ll be going into how this can all link to the other files, first up the EDB! I’m not going to explain the entire EDB here there are plenty of good tutorials on it out there I suggest you read one of those ^^.
I’ll be showing 2 things:
1. Events and building effects
The campaign script doesn’t have a lot of ways it can connect with the other files. in fact in only has one!
The “set_event_counter” command, this event counter can than be referred to in other files,
An example:
The merchants are asking for an expansion of the harbor so they can maintain more trade fleets.
part of the event:
Code:
monitor_event ButtonPressed ButtonPressed hud_select_prev_item_cycle
;yes a fantastic idea
set_counter EventTriggerCounter 0
set_event_counter MORE_FLEETS 1
other effects
end_monitor
EDB:
Code:
trade_fleet bonus 3 requires factions { all, } and event_counter MORE_FLEETS 1 ( followed by the hidden resources of the city in question )
Simple enough, however there is a catch.
What happens if this event runs twice, obviously it won’t add any fleets the second time.
So we need to add this as well:
Code:
if I_CompareCounter EventTriggerCounter == 1
if I_EventCounter MORE_FLEETS == 0
historic_event HARBOR_EXPANSION true
end_if
if I_EventCounter MORE_FLEETS == 1
set_counter FallTrough 1
if RandomPercent < 51
set_counter FallTrough 1
set_counter EventTriggerCounter 2
historic_event TRADE_BOOMS true
end_if
if I_CompareCounter FallTrough == 1
set_counter FallTrough 0
set_counter EventTriggerCounter 3
historic_event PIRATES true
end_if
end_if
end_if
So I decided to go a bit creative, say the port expansion hasn’t been built yet and the event triggers:
You’ll get the event asking you or you want to build it so thats fine,
Say you’ve already built the harbor expansion and the event triggers again, now this time there are 2 options, with a 50/50 chance between them ( again with the FallTrough system).
1: The trade booms
2: Pirates appear to prey on the poor sailors
Note both have their own effects loop! As is to be expected of course as they are essentially 3 different events.
This way of adding building effects can be used for any of the building effects in M2TW as well as for the adding of recruitable units. Full lists of the building effects can be found in one of the many EDB docudemons found on this website.
2. Creating entire buildings
This is a bit of a mixed bag, on one hand most things can be represented by just adding building effects which is easier and less work on the other hand creating real buildings is fancier and makes it more obvious for the player where things are located.
An important thing to remember when using an event to create buildings is that the game just creates the building without any form of checks. You’d think that is the general idea but this means it is possible to have multiples of the same building in a city. Therefore I’d advice against the use of the campaign script to create buildings that you can build normally as well. This also makes it impossible to use the campaign script to upgrade a building etc.
You could potentially make a monitor to check or the building already exists but you always run the risk that the building is queued up at the moment the event triggers. Which will again result in having the same building twice.
Buildings that you can’t build normally are however great candidates and can lead to some fine events. It all revolves around this: console_command create_building
create_building <settlement_name> <building_level_id> : creates a building of the specified type in a settlement; for building level id's see export_descr_building.txt
An event example from an earlier TLR version:
Flanders (Antwerp and Bruges ) was historically very well known for it’s trade in fleece and lace, so why not make a Fleece Fair building, Now I could just add this building to the buildings you can normally build in Flanders but I decided to make it a bit more special.
Fairs of all kinds required the permission of a feudal lord to be held and several rules applied but the revenues were often considerable.
Firstly we’ll need to add a new building to the EDB, in this case the fleece fair:
I gave it 3 levels just for kicks and giggles really, As you can see the first level can’t be build thanks to a conveniently named event counter that will never be 1 , The upgrades however are not since you can’t use the script to upgrade it.
I did add another event counter to them this is to keep them hidden in the building browser until the first one appears, no need to spoil the surprise.
The bonus itself is only granted in summer, as it’s an annual event more than a real building.
Code:
building hinterland_fleece_fair
{
levels small_fleece_fair, large_fleece_fair, huge_fleece_fair
{
small_fleece_fair requires factions { all, } and event_counter NOT_BUILDABLE 1
{
capability
{
trade_level_bonus bonus 20 requires factions { all, } and event_counter SUMMER 1
agent_limit merchant 1
}
material wooden
construction 1
cost 1
settlement_min village
upgrades
{
large_fleece_fair
}
}
large_fleece_fair requires factions { all, } and event_counter FLEECE_FAIRS 1
{
capability
{
trade_level_bonus bonus 40 requires factions { all, } and event_counter SUMMER 1
agent_limit merchant 1
}
material wooden
construction 1
cost 1
settlement_min large_town
upgrades
{
huge_fleece_fair
}
}
huge_fleece_fair requires factions { all, } and event_counter FLEECE_FAIRS 1
{
capability
{
trade_level_bonus bonus 60 requires factions { all, } and event_counter SUMMER 1
agent_limit merchant 1
}
material wooden
construction 1
cost 1
settlement_min huge_city
upgrades
{
}
plugins
{
}
}
Now the actual events
Basically the same build up as the others:
Flemish fleece fair
Flanders is fast becoming a centre of trade for wool, fleece and textile from all over Europe and many of the local merchants are now asking for the right to hold annual fairs. Tough the permission to hold a small fair can be granted by the local feudal lords. This fair is based in their large cities and will grant them considerable bonuses in income and trade and will make Flanders one of the indisputable authorities on the main land.
Code:
monitor_event ButtonPressed ButtonPressed hud_select_prev_item_cycle
;yes a fantastic idea
set_counter EventTriggerCounter 0
console_command create_building Antwerp small_fleece_fair
other effects
end_monitor
Now I have a number of things that I have to change, and a number of things I want to change in this event to make it more interesting this being the advanced tutorial and all.
1. I have to make sure this event is not repeated as it will lead to multiples of the same building
2. I want the player to be able to chose to build the fair in Bruges or in Antwerp,
3. I want their to be a limit on the total of fleece fairs number in Northern Europe, certain other counties will be able to build them as well.
4. I want to have the starting of a fleece fair to have an effect on the other regions with one.
So this is how it would look and why:
1.I have to make sure this event is not repeated as it will lead to multiples of the same building
very easy, the idea is similar to the one we used for the trade fleet, but this time we use a normal counter.
The counter is named FlandersFleeceFairs, it’s values are 0 and 1
0 means there are still possibilities for extra fairs
1 meaning it’s full
The counters for the other counties work in a similar fashion.
2. This is similar to the multi turn event, but this time I want the second event to run immediately after the first, not the next turn as earlier, also if I already have a fleece fair in either of the cities this event becomes redundant and I don’t want it to run. this is the FLANDERS_CHOICEFLEECEFAIR event.
2 extra counters are also included, to keep track of which city already has a fair;
AntwerpFleeceFair
BrugeFleeceFair
3. yet another counter, this one keeps track of the total number of fleece fairs out there, if it hits a certain number I skip the fleece fair event entirely
NE_FleeceFairs;
4. this will be achieved by a series of ”if“ statements nested in the event effects.
each one checking whether or not one of the counties has a fleece fair and reducing its prosperity if it has.
All counters have to be declared again for them to work
Code:
if I_CompareCounter EventTriggerCounter == 1
set_counter FallTrough 1
if I_CompareCounter NE_FleeceFairs < 3
Since I only ever want 3 large fleece fairs in Northern Europe it’s value has to remain <= 3
and I_CompareCounter FlandersFleeceFairs == 0
if there are still opertunities for an extra fleece fair in Flanders I want the event to run, if not I want it to be skipped
historic_event FLANDERS_FLEECE_FAIR true
;the merchants ask for the fair
set_counter FallTrough 0
end_if
if I_CompareCounter FallTrough == 1
historic_event FLANDERS_FINE_WOOL_YEAR true
if I_CompareCounter BrugesFleeceFair == 1
inc_counter FlandersHappy 30
end_if
if I_CompareCounter AntwerpFleeceFair == 1
inc_counter FlandersHappy 30
end_if
Having one or more fairs means that a good year for the wool is a good year for Flanders
if I_CompareCounter FlandersFleeceFairs = 1
Having 2 of the 3 fairs in Northern Europe an extra boost is in order when wool trade booms.
inc_counter FlandersHappy 15
end_if
set_counter EventTriggerCounter 0
set_counter FallTrough 0
end_if
This event isn’t a choice event, because I didn’t see the need for it to be, it’s just a normal historic event. even tough it does change some behind the scenes counters. obviously extra effects could be added.
end_if
while I_CompareCounter EventTriggerCounter == 1
monitor_event ButtonPressed ButtonPressed hud_select_prev_item_cycle
;sure the money is more than welcome
set_counter EventTriggerCounter 2
if I_CompareCounter BrugesFleeceFair == 1
inc_counter FlandersHappy 15
end_if
if I_CompareCounter AntwerpFleeceFair == 1
inc_counter FlandersHappy 15
end_if
Flanders already has 1 fleece fair, so getting a second one will mean they have a very strong grasps on the wool trade which will increase it’s prosperity !
if I_CompareCounter BrittanyFleeceFair == 1
inc_counter BrittanyHappy -30
end_if
if I_CompareCounter AquatineAndGasconyFleeceFair == 1
inc_counter AquatineAndGasconyHappy -30
end_if
if I_CompareCounter PoitouAndAnjouFleeceFair == 1
inc_counter PoitouAndAnjouHappy -30
end_if
if I_CompareCounter NormandyFleeceFair == 1
inc_counter NormandyHappy -30
end_if
if I_CompareCounter ChampagneFleeceFair == 1
inc_counter ChampagneHappy -30
end_if
if I_CompareCounter IsleDeFranceFleeceFair == 1
inc_counter IsleDeFranceHappy -30
end_if
if I_CompareCounter MarseilleFleeceFair == 1
inc_counter MarseilleHappy -30
end_if
if I_CompareCounter DijonFleeceFair == 1
inc_counter DijonHappy -30
end_if
if I_CompareCounter LondonFleeceFair == 1
inc_counter EnglandHappy -30
end_if
if I_CompareCounter ExeterFleeceFair == 1
inc_counter EnglandHappy -30
end_if
if I_CompareCounter ScotlandFleeceFair == 1
inc_counter ScotlandHappy -30
end_if
if I_CompareCounter BrugesFleeceFair == 1
Bruges already has a fleece fair so the next one is automatically placed in Antwerp
console_command create_building Antwerp small_fleece_fair
set_counter FlandersFleeceFair 1
Both cities in Flanders now have a fleece fair so this counter needs to be set to 1
inc_counter NE_FleeceFairs 1
A fleece fair has been build in NE so this counter needs to be increased
end_if
if I_CompareCounter AntwerpFleeceFair == 1
Antwerp already has a fleece fair so the next one is automatically placed in Bruges
console_command create_building Bruges small_fleece_fair
set_counter FlandersFleeceFair 1
Both cities in Flanders now have a fleece fair so this counter needs to be set to 1
inc_counter NE_FleeceFairs 1
A fleece fair has been build in NE so this counter needs to be increased
end_if
if I_CompareCounter BrugesFleeceFair == 0
and I_CompareCounter AntwerpFleeceFair == 0
Neither of the Cities in Flanders has a fair yet, so I get to choose
historic_event FLANDERS_CHOICEFLEECEFAIR true
set_counter EventTriggerCounter 2
Sets the counter so the next loop activates
end_if
end_monitor
monitor_event ButtonPressed ButtonPressed hud_select_next_item_cycle
;no I don’t want a fair
-The usual effects go here-
set_counter EventTriggerCounter 0
end_monitor
end_while
while I_CompareCounter EventTriggerCounter == 2
monitor_event ButtonPressed ButtonPressed hud_select_prev_item_cycle
;put it in Antwerp
set_counter AntwerpFleeceFair 1
Antwerp now has a fair
set_counter EventTriggerCounter 0
inc_counter NE_FleeceFairs 1
A fleece fair has been build in NE so this counter needs to be increased
console_command create_building Antwerp small_fleece_fair
end_monitor
monitor_event ButtonPressed ButtonPressed hud_select_next_item_cycle
;put it in Bruges
set_counter BrugesFleeceFair 1
Bruges now has a fair
set_counter EventTriggerCounter 0
inc_counter NE_FleeceFairs 1
A fleece fair has been build in NE so this counter needs to be increased
console_command create_building Bruges small_fleece_fair
set_counter EventTriggerCounter 0
end_monitor
end_while
There you have it,
One last thing to note is that these events only run for the local player, which in turn would mean that only regions under his control would ever get one of these fairs. Since this hardly seems fair I added one final monitor to the script to finish this event of for Flanders. ( a similar one is obviously also included for Bruges )
Code:
monitor_event SettlementTurnEnd Not SettlementIsLocal
and I_CompareCounter NE_FleeceFairs < 3
and I_CompareCounter AntwerpFleeceFair == 0
and SettlementName Antwerp
and RandomPercent < 2
set_counter AntwerpFleeceFair 1
inc_counter NE_FleeceFairs 1
inc_counter FlandersHappy 30
console_command create_building Antwerp small_fleece_fair
if I_CompareCounter BrugesFleeceFair == 1
set_counter FlandersFleeceFairs 1
inc_counter FlandersHappy 15
end_if
if I_CompareCounter BrittanyFleeceFair == 1
inc_counter BrittanyHappy -30
end_if
if I_CompareCounter AquatineAndGasconyFleeceFair == 1
inc_counter AquatineAndGasconyHappy -30
end_if
if I_CompareCounter PoitouAndAnjouFleeceFair == 1
inc_counter PoitouAndAnjouHappy -30
end_if
if I_CompareCounter NormandyFleeceFair == 1
inc_counter NormandyHappy -30
end_if
if I_CompareCounter ChampagneFleeceFair == 1
inc_counter ChampagneHappy -30
end_if
if I_CompareCounter IsleDeFranceFleeceFair == 1
inc_counter IsleDeFranceHappy -30
end_if
if I_CompareCounter MarseilleFleeceFair == 1
inc_counter MarseilleHappy -30
end_if
if I_CompareCounter DijonFleeceFair == 1
inc_counter DijonHappy -30
end_if
if I_CompareCounter LondonFleeceFair == 1
inc_counter EnglandHappy -30
end_if
if I_CompareCounter ExeterFleeceFair == 1
inc_counter EnglandHappy -30
end_if
if I_CompareCounter ScotlandFleeceFair == 1
inc_counter ScotlandHappy -30
end_if
end_monitor
Some Final notes on creating buildings trough script:
A very interesting part of scripted buildings is that you don’t need the “lowest level” building to be at the start of a chain.
For example say I want a scripted event building that represents some or other expansion of the roads, say royal guard posts or something like that:
This has 2 main advantages:
1) you don’t burn trough building slots like crazy, with the ability to add up to 9 scripted buildings to a single chain, not that I ever heard of anyone ever having reached the max allowed number of buildings ( tough I would have with TLR if I had put every regional town centre in a different building chain)
2) which is a lot more important, if you look in the building browser the “royal guard posts” will be listed under the same title as the roads, which prevents an seemingly endless stream of building chains and looks a lot cleaner in general, the game is even as kind as to sort it by the size of building needed to build and not linear based on the upgrade sequence.
Not very important in this case, but if you had a building like say “Expanded warehouses” with 4 levels as part of your market chain, it would be nice to have the sorted that way.
Code:
building hinterland_roads
{
convert_to hinterland_castle_roads
levels roads paved_roads guard_posts
{
roads city requires factions { northern_european, middle_eastern, eastern_european, greek, southern_european, }
{
convert_to 0
capability
{
road_level 0
}
material wooden
construction 1
cost 400
settlement_min town
upgrades
{
paved_roads
}
}
paved_roads city requires factions { northern_european, middle_eastern, eastern_european, greek, southern_european, }
{
convert_to 1
capability
{
road_level 1
}
material wooden
construction 3
cost 1200
settlement_min city
upgrades
{
guard_posts
}
guard_posts city requires factions { northern_european, middle_eastern, eastern_european, greek, southern_european, } and event_counter NOT_BUILDABLE 1
{
convert_to 2
capability
{
trade_level_bonus bonus 6
}
material wooden
construction 3
cost 1200
settlement_min city
upgrades
}
}
plugins
{
}
}
Well then, this concludes my tutorial on event making, I hope you enjoyed it!
I may add an extra chapters on the EDA and EDCT later.
Until then any questions are suggestions are welcome. or of you are working on events for your own mod and would like some input/help be sure to let me know. I’d be glad to help.
I'll be working on making these tutorials more general, as the intitial plan was to make a tutorial for people helping with TLR, it isn't really what you'd expect from a tutorial