Jump to content

[IDEA/WIP] A way to do skills level-as-you-use-them solely through XML


Deceptive Pastry

Recommended Posts

May be able to use a bit of help/brainstorming on this. I just did a bit of testing. It looks like cvars are stored in your save file, eg if you have a cvar changed by ModifyCVar, it will keep that value if you quit/reload. That seems to be how they track recipes learned.

 

<property class="Action0">
<requirement name="CVarCompare" cvar="foodCanHam" operation="Equals" value="0"/>
</property>
<effect_group tiered="false">
<triggered_effect trigger="onSelfPrimaryActionEnd" action="ModifyCVar" cvar="foodCanHam" operation="set" value="1"/>
</effect_group>

 

So I had an iron pickaxe trigger an effect on harvest to modify a cvar. I think something like this can be done:

 

<triggered_effect trigger="onSelfHarvestBlock" action="ModifyCVar" cvar="MiningXP" operation="add" value="10"/>
<triggered_effect trigger="onSelfHarvestBlock" action="ModifyCVar" cvar="MiningLvl2" operation="set" value="1">
<requirement name="CVarCompare" cvar="MiningXP" operation="Equals" value="10000"/>
</triggered_effect>
<triggered_effect trigger="onSelfHarvestBlock" action="ModifyCVar" cvar="MiningLvl3" operation="set" value="1">
<requirement name="CVarCompare" cvar="MiningXP" operation="Equals" value="30000"/>
</triggered_effect>

 

Remaining issues I'm working on are:

1. How to make a new skill/perk outside of the perk point system

2. How to add points to that skill. The only way to add a perk point I could figure out is through quests, but I don't want to add perk points anyway.

 

Could make passive_effects with requirement CVarCompare cvar="MiningLvl2" operation="Equals" value="1". But ideally there'd need to be a way for the player to see what their current level and xp is through the menu. I haven't messed with menu/ui stuff much yet but I imagine there is a way to get it to display a cvar value.

Link to comment
Share on other sites

Update... Can create a new attribute section with new perks that go up to lvl 100. There is a passive_effect PerkLevel which is used by magazines for the temporary buffs. The only issue is having 100 different passive_effects that raise a perk...I wish I could tie a passive_effect and requirement to a range, I think I tried something like that before with numbers like 1,10 and it didn't work. eg.

 

<passive_effect name="PerkLevel" operation="base_add" value="1,100" tags="perkHeavyArmor">

<requirement name="CVarCompare" cvar="MiningXP" operation="GT" value="1,30000"/>

</passive_effect>

 

Otherwise it would require 100 entries of...

 

<passive_effect name="PerkLevel" operation="base_add" value="1" tags="perkHeavyArmor">

<requirement name="CVarCompare" cvar="MiningXP" operation="GT" value="1000"/>

</passive_effect>

<passive_effect name="PerkLevel" operation="base_add" value="1" tags="perkHeavyArmor">

<requirement name="CVarCompare" cvar="MiningXP" operation="GT" value="3000"/>

</passive_effect>

<passive_effect name="PerkLevel" operation="base_add" value="1" tags="perkHeavyArmor">

<requirement name="CVarCompare" cvar="MiningXP" operation="GT" value="5000"/>

</passive_effect>

<passive_effect name="PerkLevel" operation="base_add" value="1" tags="perkHeavyArmor">

<requirement name="CVarCompare" cvar="MiningXP" operation="GT" value="8000"/>

</passive_effect>

 

etc...

Link to comment
Share on other sites

From the looks of how buffs are handled with vanilla perks, you'll need to use 100 entries. I haven't tried it yet, but maybe try using "value" twice in your passive effect:

<passive_effect name="PerkLevel" operation="base_add" value="1,100" cvar="MiningXP" value="1,30000" tags="perkHeavyArmor"/>

It's a long shot and it probably won't work properly with two floats of the same name, but it's worth a try.

 

My advice would be to use Excel (or another spreadsheet program) to handle all the math and output the proper syntax for the XML to a single cell so you can just copy paste it all. I made a quick template for you to play with if you want it. The XP scaling is different than what you want due to it being quickly made and simpler math.

 

https://docs.google.com/spreadsheets/d/1Pdx2DrBRsA581BqifOBtYmTWUBDsyRNlSah0nVGxNQo/edit?usp=sharing

 

I'm interested in doing something like this as well, if I make any headway, I'll drop you a line.

Link to comment
Share on other sites

I was just throwing out numbers as examples. I'll probably just try to emulate the A16 skills at first and use the same exp multiplier per level etc., As well as converting the A17 perks from 1 skill point per level to multiple, plus giving multiple points to spend per player level like A16 so you can choose to add points to supplement action XP. I'm fairly sure all of this is possible, and I'll totally just have hundreds of passive_effects if that's all I can do. Thats kinda how I had to do my exploding zombie head mod (still in the end stages of testing that one). Need to experiment more when I get time later.

Link to comment
Share on other sites

I think I've got it :D no need for hundreds of entries. Here is what I have so far and am currently going into long-term testing, you can see how it works.

 

entityclasses.xml. I have a lvl 1 to trigger setting the base values. I wanted to use OnSelfFirstSpawn but that doesn't seem to trigger on first spawn in a new game nor first spawn on first entering a game. Dunno, may use something else for the first "set". I would have preferred a way to permanently increase the skill rather than using passive_effect PerkLevel which is essentially a "permanent temporary" increase. I can do so with skills_to_gain property on items but don't know how on triggered_effects.

<append xpath="/entity_classes/entity_class[@name='playerMale']">
<effect_group name="Active Skills">
	<passive_effect name="PerkLevel" operation="base_add" value="@ASMiningToolsLvl" tags="perkMiningTools"/>
</effect_group>

<effect_group name="AS Mining Tools Lvl 1">
	<requirement name="CVarCompare" cvar="ASMiningToolsXP" operation="Equals" value="500"/>
		<triggered_effect trigger="onSelfHarvestBlock" action="ModifyCVar" cvar="ASXPMult" operation="set" value="1.2"/>
		<triggered_effect trigger="onSelfHarvestBlock" action="ModifyCVar" cvar="ASMiningToolsXPLvlNextAdd" operation="set" value="600"/>
		<triggered_effect trigger="onSelfHarvestBlock" action="ModifyCVar" cvar="ASMiningToolsXPLvlNextTotal" operation="set" value="1100"/>
		<triggered_effect trigger="onSelfHarvestBlock" action="ModifyCVar" cvar="ASMiningToolsLvl" operation="add" value="1"/>
		<triggered_effect trigger="onSelfHarvestBlock" action="ShowToolbeltMessage" message="Mining Tools level increased"/>
</effect_group>

<effect_group name="AS Mining Tools Lvl Increase">
	<requirement name="CVarCompare" cvar="ASMiningToolsXP" operation="GT" value="500"/>
	<requirement name="CVarCompare" cvar="ASMiningToolsXP" operation="GTE" value="@ASMiningToolsXPLvlNextTotal"/>
	<requirement name="CVarCompare" cvar="ASMiningToolsLvl" operation="LT" value="20"/>
		<triggered_effect trigger="onSelfHarvestBlock" action="ModifyCVar" cvar="ASMiningToolsXPLvlNextAdd" operation="multiply" value="@ASXPMult"/>
		<triggered_effect trigger="onSelfHarvestBlock" action="ModifyCVar" cvar="ASMiningToolsXPLvlNextTotal" operation="add" value="@ASMiningToolsXPLvlNextAdd"/>
		<triggered_effect trigger="onSelfHarvestBlock" action="ModifyCVar" cvar="ASMiningToolsLvl" operation="add" value="1"/>
		<triggered_effect trigger="onSelfHarvestBlock" action="ShowToolbeltMessage" message="Mining Tools level increased"/>
</effect_group>
</append>

 

Items.xml. This will be added to every weapon (CVarLogValues are for testing purposes)

<append xpath="/items/item[@name='meleeToolPickaxeIron']">	
<effect_group name="Action Skills">
	<triggered_effect trigger="onSelfHarvestBlock" action="ModifyCVar" cvar="ASMiningToolsXP" operation="add" value="5"/>
	<triggered_effect trigger="onSelfPrimaryActionStart" action="CVarLogValue" cvar="ASXPMult"/>
	<triggered_effect trigger="onSelfPrimaryActionStart" action="CVarLogValue" cvar="ASMiningToolsXPLvlNextAdd"/>
	<triggered_effect trigger="onSelfPrimaryActionStart" action="CVarLogValue" cvar="ASMiningToolsXPLvlNextTotal"/>
	<triggered_effect trigger="onSelfPrimaryActionStart" action="CVarLogValue" cvar="ASMiningToolsXP"/>
	<triggered_effect trigger="onSelfPrimaryActionStart" action="CVarLogValue" cvar="ASMiningToolsLvl"/>
</effect_group>
</append>

 

And finally progression.xml. This adds a whole new attribute section for the Action Skills. Just have 20 levels in Mining Tools for right now, but given that I don't need 100 passive_effect entries anymore, I don't see any reason why I cant set this to 100. I'll also need to change the XUI a bit to account for 100 entires, instead of 5 per page.

<append xpath="/progression/attributes">
<attribute name="attActionSkills" name_key="Action Skills" desc_key="Action Skills level as you use them" max_level="1" icon="ui_game_symbol_resource"><effect_group/></attribute>
</append>
<append xpath="/progression/skills">
<skill name="skillHarvesting" parent="attActionSkills" name_key="Harvesting" desc_key="Harvesting" icon="ui_game_symbol_resource"><effect_group/></skill>
</append>
<append xpath="/progression/perks">
<perk name="perkMiningTools" parent="skillHarvesting" max_level="20" base_skill_point_cost="2" name_key="Mining Tools" desc_key="+5% Harvest count per level" icon="ui_game_symbol_mother_load">
	<effect_group>
		<passive_effect name="HarvestCount" operation="perc_add" value=".05,1" level="1,20" tags="oreWoodHarvest"/>
	</effect_group>
</perk>
</append>

 

So essentially,

 

 

<requirement name="CVarCompare" cvar="ASMiningToolsXP" operation="GT" value="500"/>

<requirement name="CVarCompare" cvar="ASMiningToolsXP" operation="GTE" value="@ASMiningToolsXPLvlNextTotal"/>

<requirement name="CVarCompare" cvar="ASMiningToolsLvl" operation="LT" value="20"/>

 

Once XP becomes greater than ASMiningToolsXPLvlNextTotal, this triggers and the calculations are performed.

 

cvar="ASMiningToolsXPLvlNextAdd" operation="multiply" value="@ASXPMult"/>

cvar="ASMiningToolsXPLvlNextTotal" operation="add" value="@ASMiningToolsXPLvlNextAdd"/>

cvar="ASMiningToolsLvl" operation="add" value="1"/>

 

XP becomes > 1100

 

600 x 1.2 = 720

1100 + 720 = 1820 XP for next level

Another 1 is added to mining tools level, perk is directly increased by that amount.

 

XP becomes > 1820

 

720 x 1.2 = 864

1820 + 864 = 2684 for next level

Another 1 is added to mining tools level

 

XP becomes > 2684

 

etc.

etc.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...