Hi guys, i'm hoping you can help me.

I'm developing quite similar to Lord Baal's Delerium (which basically means i'm making basic samurai recruitable from castles and balancing everything around 12 turns per year - THAT all works fine) but i've run into a serious problem.

Because the Dojos no longer make samurai recruitable i want to turn them into ashigaru training fields (essentially). So for example i want SHO_Yari_1_Drill_Yard to grant + 1 defence, + 1 charge and + 1 morale to yari ashigaru ONLY (this would require 3 entries at each step, one for defence, one for charge and one for morale - this i understand).

The problem is that i simply can't find out which table determines what an effect actually buffs. So i can make a new effect, complete with working ingame description etc, except that nothing is actually granted to the units produced - this is using entirely custom entries in every step of the process. If i use an existing vanilla 'bonus' - such as 'melee_defence_mod' then it works but it is no longer specific to the defined unit - in other words, i can get it working this way but it buffs EVERYTHING, cav, sword infantry, archers, etc.

It doesn't look like i can restrict the buff to a specific unit (because melee_defence_mod is already defined for a whole host of units in vanilla most likely) and in an attempt to get around that, when i create my own bonus it has no 'oomph' - it's just pretty ingame writing, no crash, etc but no applied bonus whatsoever.

This is a list of the tables i've been working with:

1. building_effects_junction_tables/building_effects_junction - this is where you set the building that grants the bonus, the bonus itself (or its internal name rather) and the magnitude of the buff in whole numbers.
2. effect_bonus_value_basic_junction_tables/effect_bonus_value_basic_junction - i thought this is where you define the actual bonus but it only works with existing vanilla entires which as i said are married to a wide range of units or are even global in effect. I just want the dojo to buff melee_defence at a magnitude and for a unit of my choosing - how?!
3. effect_bonus_value_unit_record_junctions_tables/effect_bonus_value_unit_record_junctions - you need the S2C convertor for this file - this is where it appears you can define a certain bonus for a specific unit - but like i said, getting it to actually grant anything in game requires using a vanilla entry in the number 2 file (above) and they are already defined for a huge range of units so any exclusivity is immediately lost - you're just adding your unit the pile.
4. effects_tables/effects - this looks like it only defines what graphic to overlay on unit cards when the bonus is granted - i've not tried NOT filling this in though. I'm crash shy.
5. effects.loc - this is a no brainer text file where you add the in game mouse over information for the building (or whatever) effect.

What seems to be lacking is where i can define a new bonus called, say, 'yari_ashigaru_melee_defence' and then define that it modifies the melee defence only and then once that's done, go through the process above imputing the relevant entries in the appropriate files (including the unit_record_junctions which should then restrict the bonus to only those units defined therein).

At least, if im not completely confused, that i think is the problem. So, am i just missing it somehow (im no coder, just an obsessive dabbler) or is it in fact hard coded and i can only play around with the global, local and categorical buffs already existing in vanilla via PFM?

This has brought my mod to a complete stop as its otherwise really quite polished but without this all the Dojo's are completey worthless - they also can't even add experience to the units produced in the caslte (the ashigaru for example - which is a compromise i considered) because the ashigaru are not built in the dojo but in the fort (with the samurai) - so the experience bonus just doesn't get applied.

Any help on getting new-user-defined-unit-specific-(stat)-bonuses from Dojos would be hugely appreciated.

Thanks.