Has anyone found a way to use these to control unit recruitment as this would mean an aor could easily be created.
Has anyone found a way to use these to control unit recruitment as this would mean an aor could easily be created.
Proud member of the Patria Libera team.
Use hidden resources for unit AOR. There's no known way to link plugins to anything in EDB.
Under the patronage of Roman_Man#3, Patron of Ishan
Click for my tools and tutorials
"Two things are infinite: the universe and human stupidity; and I'm not sure about the universe." -----Albert Einstein
Yes, I see what you mean. Oh well. Thanks.
I am a little confused by this comment:
Does this mean destroy the entire building tree (across the faction) that contains this plugin and replace with buildings from a different tree that contains the new plugin?
Or is there some way to destroy/remove individual plugins?
Last edited by Withwnar; May 27, 2011 at 12:54 PM. Reason: merge
(delete)
Last edited by Withwnar; May 27, 2011 at 12:55 PM.
I would be extremely beneficial if someone would explain this tutorial a little better with some direct applications in the EDB and in the EDCT. Then we could see an association between what is written as a plugin in the export_descr_buildings to set up the plugin, and then see the way that it is recognized and triggered in the export_descr_character_traits. That would be a much superior tutorial since it would explain the process.
It looks like we can have special triggers to give traits to units based on them being somewhere, but I don't fathom how that is different then say going to Rome in the EDCT. Maybe it's as described if a character goes anywhere within a kingdom, a trigger could fire, has been to England versus has been to London.
If that's so, then it might be possible to give all named characters from an entire kingdom special traits using this, but I think that's already possible. I'm just not seeing the potential at all, but I can tell it must be huge based on the posts here. I think shedding a little more light would greatly facilitate using it.
I haven't used them yet so I'll skip the EDB part in case I do it wrong. But I can answer the last part: using them for traits. Perhaps someone else can expand on this for a full example.
Say we have an "english" plugin attached to wall buildings. In descr_strat we could give this plugin to the three England settlements: London, Nottingham and York.
In EDCT we could have a trigger such as:
So if he's a governor of an English settlement then there's a chance of going insane.Code:Trigger plugin_trigger_1 WhenToTest CharacterTurnEnd Condition GovernorPlugInExists = english Affects Insane 1 Chance 40
Without plugins the only way to do this otherwise would be to have one trigger for each of the three settlements:
(GovernorTaxLevel is there just to ensure that this character is a governor, as there is no IsGovernor condition.)Code:;------------------------------------------ Trigger plugin_trigger_1 WhenToTest CharacterTurnEnd Condition GovernorTaxLevel >= tax_low and SettlementName London Affects Insane 1 Chance 40 ;------------------------------------------ Trigger plugin_trigger_2 WhenToTest CharacterTurnEnd Condition GovernorTaxLevel >= tax_low and SettlementName Nottingham Affects Insane 1 Chance 40 ;------------------------------------------ Trigger plugin_trigger_3 WhenToTest CharacterTurnEnd Condition GovernorTaxLevel >= tax_low and SettlementName York Affects Insane 1 Chance 40
It's a trivial example but it already helps things by reducing the number of triggers (3 to 1) and conditions (2 to 1). Plus, plugins can be built dynamically via script. So as the English empire expands script could build the plugin in some specific newly-conquered settlements and that single trigger will automatically work for them.
But apparently GovernorPlugInExists is the only means of getting the information 'out'. So plugins can only be used for giving traits/ancillaries to governors, not other generals or other character types. And using a plugin as script monitor condition will only work if the settlement has a governor.
The other thing it can be used for is using resources and hidden_resources outside of EDB without plugins there is no way to know resource information in EDCT/EDA/scripts/etc.
Under the patronage of Roman_Man#3, Patron of Ishan
Click for my tools and tutorials
"Two things are infinite: the universe and human stupidity; and I'm not sure about the universe." -----Albert Einstein
Read the first post where it quotes my RTW tutorial it tells you how to do it.
Under the patronage of Roman_Man#3, Patron of Ishan
Click for my tools and tutorials
"Two things are infinite: the universe and human stupidity; and I'm not sure about the universe." -----Albert Einstein
This is great, if I understand correctly.
I would like to create a technology system based on creating a building randomly assigned to a settlement in campaign script using:If these plugin buildings give an ancillary to a governor, could this ancillary then be used to enable a new building in the EDB, perhaps using an event counter with FactionwideAncillaryExists?Code:console_command construct_building *building* *plugin*
If so then could a spy or another agent be given an ancillary from a plugin?
..or is there a simpler method to use the plugin this way without creating an event counter in the script?
I believe so but the counter is global, not specific to that settlement or faction, meaning that any settlement will now have the ability to build the new building. In which case you might be better off just bypassing the plugin and anc parts altogether and just randomly set the counter directly.
Unless you particularly want to have the anc of course. But ancs have a limit of 8 per character so there's the risk that the governor will never get this new one. You could use a trait instead.
Agents: no, only a governor can be used for this because the only plugin events are GovernorXXX ones.
Damnbelieve so but the counter is global, not specific to that settlement or faction, meaning that any settlement will now have the ability to build the new building. In which case you might be better off just bypassing the plugin and anc parts altogether and just randomly set the counter directly.I suppose it would be better just to set the counter directly.
My idea was also to have characters spreading technology using ancillaries or traits, I wanted to know if these could be linked somehow to the EDB.
Is there any simple way that a character with a specific trait or ancillary - lets say 'advanced metalworking knowledge' - can enable a building in a non-specific settlement where the character ends their turn.
Dabbling with plugins I have a few findings...
building_min seems to have no effect. It must be a level within the same tree as the plugin but using a level that is higher than what is currently in the settlement does not prevent the plugin from being built. This applies to both descr_strat (DS) and campaign_script (CS).
Similarly for settlement_min. The plugin may be built regardless of the settlement's current size and the settlement_min value.
When I do it with CS the plugin is being built automatically when I don't specify one. DS works as expected (no plugin present unless a "plugin" line is added).
For example, I added a flagpole plugin to the city_hall tree...
Then in CS...Code:plugins flagpole { flagpole { levels flagpole { flagpole requires factions { england, } { building_min town_hall construction 2 cost 2500 settlement_min village upgrades { } } } } }
The historic event (HE) is just for simplicity; I tried it with trait triggers too.Code:monitor_event FactionTurnStart TrueCondition console_command create_building London town_hall terminate_monitor end_monitor monitor_event CharacterTurnStart GovernorPlugInExists = flagpole historic_event first_windmill end_monitor
At the start of turn 2 I got the HE even though I have not told it to build the flagpole plugin. And the HE does not appear if I don't build the hall, so it's not a problem with the "show HE" logic.
By rights I should only get the HE if the script was saying this:
I was wondering if it is built automatically if the plugin's building_min and settlement_min conditions are being met. But when I changed them to something higher than what the settlement has it behaved the same way.Code:monitor_event FactionTurnStart TrueCondition console_command create_building London town_hall flagpole terminate_monitor end_monitor
I haven't tried it with having more than one plugin in the tree (which one would get built?).
Also the OP says to use construct_building which I took to be a typo. It isn't recognised by the parser (log error). So I'm wondering if there is indeed a separate command (to create_building) for which plugins do work as intended.
When you look for create_building in kingdoms.exe, you'll find this:
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
In Docudemons create_building is console command, so it will work only as console_command create_building.
Thanks, I realise that: I am using "console_command create_building" in my example.
I am wondering if create_building does in fact take a "plugin" argument, as the OP says:
Again, assuming that "construct_" was a typo and should have been "create_".The create_building console command can be extended to place a plugin into a settlement using the following sytax:
console_command construct_building practice_field bowyerI just realised that this doesn't mention a settlement name either.
Also, the fact that the docudemons don't mention the plugin argument suggests that there is no plugin argument. This could simply be an oversight by the demons' author. But if the .EXE doesn't mention it internally either (is that what you meant?) then it looks like it isn't there.
EDIT: oh, wait. The original plugin tutorial was for RTW. Was construct_building a valid RTW command? Hmm, in that case maybe this plugin argument only exists in RTW, not M2TW's create_building.
EDIT: ah yes, the original original tutorial (org) has been corrected to "create_building".
Additionally, it's discussion thread mentions that plugins cannot be destroyed by script. I was tinkering with this myself: using destroy_building will destroy the building tree and its plugins but there is no way to just destroy the plugin (as far as I know).
I have added a few more plugins to see what happens...
The city_hall tree has three plugins, one of which (office) is an upgrade of another (flagpole). The other one (latrine) is in its own plugin 'tree'.
Monitors to show different historic events:Code:plugins hall_plugins hall_plugins2 { hall_plugins { levels flagpole office { flagpole requires factions { england, } { building_min town_hall construction 2 cost 2500 settlement_min village upgrades { office } } office requires factions { england, } { building_min town_hall construction 2 cost 2500 settlement_min village upgrades { } } } } hall_plugins2 { levels latrine { latrine requires factions { england, } { building_min town_hall construction 2 cost 2500 settlement_min village upgrades { } } } } }
If I do this...Code:monitor_event CharacterTurnStart GovernorPlugInExists = flagpole historic_event first_windmill end_monitor monitor_event CharacterTurnStart GovernorPlugInExists = office historic_event earthquake_in_aleppo end_monitor monitor_event CharacterTurnStart GovernorPlugInExists = latrine historic_event science_alchemy_book end_monitor
... then the flagpole and latrine HEs are seen. Putting any of the three plugins after the "town_hall" in this command made no difference.Code:console_command create_building London town_hall
i.e. It would seem that create_building always auto-builds the first level of all plugins in the building's tree. There is no way to prevent it and no way to build higher levels (upgrades) with script.
But I was able to build just the office with DS using:
Here are the export_buildings entries in case anyone wants to try this themselves:Code:building { type city_hall town_hall plugin hall_plugins office }
Spoiler Alert, click show to read:
Last edited by Withwnar; October 14, 2011 at 04:23 AM.
So, if my understanding of the is thread is correct, I could use plugins do something like:
1) make a plugin in EDB for core buildings , e.g. "camels"
2) put that plugin in each region with with trade resource camels in DS
3) make a trait "hates the smell of camels" in EDCT or an ancillary "camel breeder" in EDA
4) trigger these using the condition GovernorPluginExists so that a general in a settlement in regions with camels could acquire them
Is this correct?
Yep.
Find original thread at .org and posted in EDB Guide thread on TWC before met this one.
So now we know that event_counters could be settlement specific, not only factionwide.
Another idea - read here that plugin's first level automatically built with main building construction. What if we set condition for plugin building possibility? So this could give us possibility to choose if plugin will be constructed or not.