Xylozi Posted February 18, 2018 Share Posted February 18, 2018 (edited) I've been looking into the game files and it seems that it is possible to add perks fairly easily, and to add new effects for the perks. All the perk effects are controlled in buff.xml. Each perk has a buff that is linked to said perk via perk_buff.xml. 1. To start you want to create a new perk in perk.xml. To do this add a new row. <row icon_id="mule" level="1" metaperk_id="" parent_id="" perk_id="83a8b86b-9ff1-4e2f-a4ba-fc6530dce122" perk_name="test_mod_perk" perk_ui_desc="test_mod_perk_desc" perk_ui_name="test_mod_perk_name" skill_selector="" stat_selector="2" ui_priority="0" visibility="2" /> perk_id must be unique.level controls when the perk can be taken.skill_selector controls which skill the perk belongs to.stat_selector controls which stat the perk belongs to. stat_selector values: stat_selector ids: "" - None 0 - Strength 1 - Agility 2 - Vitality 3 - Speech skill_selector values: "" - None 0 - Stealth 1 - Horsemanship 2 - Fencing 3 - Bard 4 - Lockpicking 5 - Pickpocketing 6 - Alchemy 7 - Cooking 8 - Repairing 9 - Smithing 10 - Fishing 11 - Mining 12 - First Aid 13 - Drinking 14 - Hunting 15 - Defence 16 - Sword 17 - Axe 18 - Bow 19 - Crossbow 20 - Shield 21 - Mace 22 - Dagger 23 - Polearm 24 - Unarmed 25 - Herbalism 26 - Reading 27 - Tailoring 28 - Armourer 29 - Weaponsmithing 30 - Shoemaking 2. You then need to create your new buff in buff.xml. To do this add a new row. <row buff_ai_tag_id="" buff_class_id="4" buff_desc="perk_test_mod_buff_desc" buff_exclusivity_id="1" buff_id="ffabf5f5-0ce4-4c25-aeb6-7c10466221dd" buff_lifetime_id="1" buff_name="perk_test_mod_buff" buff_ui_name="perk_test_mod_buff_name" buff_ui_order="" buff_ui_type_id="4" buff_ui_visibility_id="" duration="-1" icon_id="0" implementation="Cpp:Constant" is_persistent="True" params="cap+100" slot_buff_ui_name="" slot_icon_id="" visual_effect="" /> buff_id must be unique.buff_class_id controls which class of buff the buff belongs to. Found in buff_class.xmlimplementation determines when the buff is applied.params determines what the buff applies as an effect. Implementation points to an internal C++ function that is checked before the params are applied. For example: using Cpp:Bleeding in the implementation field will restrict the buff to only when Henry is bleeding. Params applies modifiers to various pre-defined values. For example, if you wanted the perk to grant +2 Vitality, you'd add vit+2 in the params field. Multiple effects can be added by adding a comma between them. You can use +, -, *, / and = in the params field. For example, wat*1.2 increases Weapon Damage by 20% Implementation values: Script:<script>.lua (in params: {{<var>=<value>}}) # May not work Cpp:Constant # Applies buff constantly. Cpp:BasicTimed # Used for timed buffs (duration contols time) Cpp:AdditionalAttackerCountFading # Applied when out numbered Cpp:AgilityWeaponBuff # Applied if agility weapon is wielded Cpp:Alerted # AI use Cpp:Bleeding # Applies if Henry is Bleeding Cpp:BloodRush # Applied upon killing first enemy in a combat situation Cpp:Caffeine Cpp:CarryingBody # Applied if carrying body Cpp:ChainStrike # Applied if multiple hits are chained Cpp:CombatContextBuff # Applied when in combat Cpp:CountrysideLocation # Applied in countryside Cpp:Curious Cpp:DeathProtection # Applies Death Protection Cpp:DialogSkillCheck # Applies effect in dialog Cpp:DocumentItemBuff # Limits modifier to books Cpp:Drunk # Applies when drunk Cpp:DrunkChecking # Applies if Henry is drunk, and not drunk (<a>,<b>) Cpp:Educated Cpp:EquippableItemWeighted # Used for scaling buffs added to item, based on quality of item Cpp:Exhausted # Applied if exhausted Cpp:Encumbered # Applied if encumbered Cpp:FoodHealth # Used for buffs added via food Cpp:FoodPoisoning # Applied if sick with food poisoning Cpp:ForestLocation # Applied if in Forest Cpp:Haggle # Applies if Henry is haggling Cpp:Hangover # Applied if hungover Cpp:HealthFadingFromLimit # Used for Horse, applies effect when horse health is low Cpp:HealthinessFading # Applied when on low health Cpp:HerbItemBuff # Limits modifier to herbs Cpp:Highborn # Applies when talking to high social class souls Cpp:Horseman Cpp:Infamous # Applies if Infamous is met Cpp:Injured # Applies if Henry is injured Cpp:InjuredTag Cpp:Instant Cpp:ItemHealthChecking # Applies if item was repaired by Henry (used on items) Cpp:JailRecovery # Applied during/after jail term Cpp:KnightInAShiningArmor # Applies when wearing plate armour in the day Cpp:LastGasp # Applies effect for duration upon taking fatal blow Cpp:LocalHero # Applies Local Hero Cpp:LowHealth # Applies when at low health Cpp:ManlyOdourStealth # Applied on stealth use Cpp:ManlyOdourWoman # Applied when in dialog with women Cpp:Monk Cpp:MoraleContext Cpp:Night # Applied at night, and then day (<a>,<b>) Cpp:Overeat # Applied if overeat occurs Cpp:Overread # Applied if overread occurs Cpp:Oversleep # Applied if oversleep occurs Cpp:PerkFlowerPower # Applied if Flower Power is met Cpp:PerkHorsenip # Applied if Horsenip is met Cpp:PotionHealth # Used for potions Cpp:ProperDiet # Applied if Proper Diet is followed Cpp:ReadingCartographer Cpp:ReadingQuality # Applied when Henry is in a good study location Cpp:RiddenHorse Cpp:Sadist # Applied upon seeing opponent bleed Cpp:SettlementLocation # Applied when in town or village Cpp:SharpeningPressure # Applied during sharpening process Cpp:ShieldAndArmorBuff # Applies effect only to Shield and Armour (edm) Cpp:ShortTermFood Cpp:Sick # Applied whilst sick from plague Cpp:Sleep # Applied during sleep Cpp:SleepImproved Cpp:Starvation # Applied whilst starving Cpp:Still # Applies if Henry is stood still Cpp:StillAndHidden # Applied when crouched and not moving Cpp:StomachPain Cpp:StrengthWeaponBuff # Applied only with strength weapons Cpp:TestRealSpeed Cpp:Thunderstorm( true, false ) # Applies first arg when thundering, second arg when not thundering Cpp:TipplerPotion # Applied when taking Hair o' the Dog Cpp:Unconscious Cpp:VersusAnimal # Applies when in combat against animals Cpp:VersusCuman # Applies when in combat against cumans Cpp:VersusDog # Applies when in combat against dogs Cpp:VersusEnemy # Applies when in combat against enemies Cpp:VersusSoldier # Applies when in combat against soldiers Cpp:VersusWoman # Applies when in combat against women Cpp:VersusWomanDialogSkillCheck # Applies when in dialog against women Cpp:Void Cpp:Wanted # Applies if Henry is wanted for crimes Cpp:WeaponHealthIntensity # Increases chance of effect occuring depending on weapon condition Cpp:WellWorn # Applies 0.33 factor to armour weight inworld (not inventory) Cpp:WithPlatingArmor # Applied when wearing Plate armour Cpp:WithoutPlatingArmor # Applied when not wearing Plate armour Cpp:WorldTimeTimed # Used for timed buffs (duration contols time) Params values: # ------ Stats ------ agi : Agility spc : Speech str : Strength vit : Vitality cha : Charisma cap : Carrying Capacity con : Conspicuousness evi : Visibility hea : Hearing noi : Noise vis : Vision ble : Bleeding mst : Total Stamina dig : Total Hunger exh : Total Energy hunger : Current Hunger exhaust : Current Energy health : Current Health rst : Maximum Stamina sra : Stamina Regeneration src : Stamina ??? srg : Stamina Regeneration arr : Armour Effectiveness in Speech cbi : Charisma Bonus from Equipment nbi : Noise Reduction for Armour # ------ Skills ------ fencing : Warfare horse_riding : Horsemanship lockpicking : Lockpicking pickpocketing : Pickpocketing reading : Reading stealth : Stealth weapon_axe : Axe weapon_bow : Bow weapon_crossbow : Crossbow weapon_dagger : Dagger weapon_large : Polearm weapon_mace : Mace weapon_shield : Shield weapon_sword : Sword weapon_unarmed : Unarmed pds : Lockpick Durability lpd : Lockpick Difficulty prc : Lockpick Return Chance lpn : Lockpick Noise rdq : Reading Quality erq : Reading Bonus hgs : Strength XP on Herb Pickup lfu : Chance to instantly open lock # ------ Equipment ------ ade : Total Defence alo : Armour Load defense : Defence # ------ Movement ------ rms : Running Speed asp : All Movement Speed fdm : Fall Damage Modifier Walk : Walk speed Run : Run speed Sprint : Sprint Speed StaminaSprint : Sprint Stamina Cost LimitRun : Limits Running LimitSprint : Limits Sprinting fsm : Footstep Sound Modifier # ------ Combat ------ hlh : Heavy Damage Taken slh : Light Damage Damage Taken aco : Charge Stamina Damage ahm : Mounted Weapon Damage ain : Bleeding Chance bad : Enemy Morale Damage cdw : Clinch Weapon Damage cli : Clinch Strength cow : Charge Health Damage dee : Enemy Equipment Damage dsl : Dodge Effectiveness edm : Equipment Damage eep : Evasion hko : Head OHK chance ibi : Bleedout Rate pac : Poison Chance (from hit) poi : Poisoned : Boolean sls : Block Stamina Cost wac : Weapon Stamina Cost was : Weapon Aim Swing (bow) wat : Weapon Damage wbc : Weapon Poison Application lengh # ------ Horse ------ cou : Horse Shy Reduction hcm : Horse Skittishness hml : Horse May Throw : Boolean pdp : Horse Throw Resistance rtm : Horse Shy modiifer # ------ Food ------ apa : Alcholism Removal # ------ Interactions ------ bma : Merchant Buy Price brm : Bad Reputation Modifier bso : Stolen Goods Agreeability grm : Good Reputation Modifier hac : Haggle Chances : [0,1,+inf] jrm : Jail Recovery Modiifer : Boolean pbm : Self-brewed Potion Sell Price sma : Merchant Sell Price # ------ Perks ------ fae : First Aid Expert : [1,3] iex : Item Expert : [0,3] mkp : Reveal Map : Boolean pos : Pocket Sight : [0,8] rml : Extra Money Loot skp : Stealth Kills : Boolean # ------ Soul ------ apr : Attack Protection : Boolean btw : Animal Perception (against player) ppr : Steal Proection : Boolean cag : Combat Aggression : Boolean coc : Unconsciousness imm : Immortality : Boolean mor : Morale : + means enemies are more afraid of you mut : Mute : Boolean ors : AI Avoidance ran : Robbed Aggression sur : Surrender : Boolean ufo : Unconsciousness : Boolean upr : Force Consciousness : Boolean sle : Sleep : Boolean # ------ Undocumented ------ bar : Barter act : UNKNOWN dbf : Dice dtf : Dice lcs : Steady Hand ?? lpb : Lockpicking ??? lsa : Lockpicking ??? osb : Firm Hand ??? pbs : Shield ??? prb : Perk ??? pt5 : Dice ptl : Dice vib : ??? 3. In the perk_buff.xml, add a new row linking your new perk and new buff. <row buff_id="ffabf5f5-0ce4-4c25-aeb6-7c10466221dd" perk_id="83a8b86b-9ff1-4e2f-a4ba-fc6530dce122" /> Edited February 23, 2018 by Xylozi Link to comment Share on other sites More sharing options...
Ethreon Posted February 18, 2018 Share Posted February 18, 2018 Good stuff. Thanks for sharing :) Link to comment Share on other sites More sharing options...
ImmortalRD Posted February 20, 2018 Share Posted February 20, 2018 This is exceptionally helpful. Out of curiosity though, how do you establish the id's? Link to comment Share on other sites More sharing options...
TETRISOID Posted February 20, 2018 Share Posted February 20, 2018 Is there a way to create buff that will active permanent, without perk. For example it will just hangin in buff list. Link to comment Share on other sites More sharing options...
Xylozi Posted February 20, 2018 Author Share Posted February 20, 2018 (edited) I'm pretty sure its possible to create a perk that is hidden (visibility="0"). This lets you create a buff without a visible perk related to it. You can assign the perk automatically to Henry by adding the perk to the soul2perk.xml. Henry's soul_id is 43144483-f3bb-fab8-9ceb-f77e3020598a Edited February 20, 2018 by Xylozi Link to comment Share on other sites More sharing options...
uchiwaobito Posted February 21, 2018 Share Posted February 21, 2018 Is there a way to change the levels you get perk points for each skill? Link to comment Share on other sites More sharing options...
Xylozi Posted February 21, 2018 Author Share Posted February 21, 2018 Is there a way to change the levels you get perk points for each skill? Not from what I've seen. The distribution is generated from the maximum number of perks and the skill cap (20). Link to comment Share on other sites More sharing options...
Marrv072 Posted February 21, 2018 Share Posted February 21, 2018 Is the maximum number of perks a set number or just a sum value the game calculates from the xml's? Link to comment Share on other sites More sharing options...
Xylozi Posted February 21, 2018 Author Share Posted February 21, 2018 There are a few rpg params that affect the distribution: MaxPerkPoints # total number of perk points player will gain per stat/skill MinPerkPoints # no leftovers if the number of perk points would be <= than this MinLeftoverPerks # preferred number of leftovers Link to comment Share on other sites More sharing options...
uchiwaobito Posted February 21, 2018 Share Posted February 21, 2018 There are a few rpg params that affect the distribution: MaxPerkPoints # total number of perk points player will gain per stat/skill MinPerkPoints # no leftovers if the number of perk points would be <= than this MinLeftoverPerks # preferred number of leftovers Thanks. I will try playing with them and see the results.I wander why some skills have some particular distributions. Link to comment Share on other sites More sharing options...
Recommended Posts