• If you have a mod, tool or prefab, please use the Resources section. Click Mods at the top of the forums.

Bonus skill points at certain levels

jdm311

New member
Hi All,

I'm looking for a way to mod additional skill points at certain levels. Let's say something like every 5 levels an additional skill point: <level> % 5 == 0 => +1 skill point.

I know you can increase the number of skills you get per level, that is not what I'm asking.

Any assistance would be greatly appreciated!

 
Last edited by a moderator:
You can do something like the following code:

There are 3 'functions' in 2 files.

- buffPlayerLevelTracker: this buff tracks the players level and sets up the extra point when the player reaches the level AND the skill point for that level has bnot already been given.

- Append some code into buffStatusCheck01 to register the buffPlayerLevelTracker buff so that it runws in the background

-Add a game event example_give_skillpoint that gives the player the extra skill point.

Cheers

Code:
/////buffs.xml code//////
<append xpath="/buffs">	
	<!--buff is hidden from player and doesn't drop on death
		Tracks the player level for specific milestones (5 and 10 in the example)-->
	<buff name="buffPlayerLevelTracker" hidden="true" remove_on_death="false">
		<stack_type value="ignore"/>
		<duration value="0"/>
	
		<effect_group>
			<!--if player level ==5 AND not already given additional point for level 5-->
			<requirement name="PlayerLevel" operation="Equals" value="5"/>
			<!--The var LevelFivePointGiven will initialise to 0 - dont have to define or initialise it, just use it-->
			<requirement name="CVarCompare" cvar="LevelFivePointGiven" operation="LTE" value="0"/>
				<triggered_effect trigger="onSelfBuffUpdate" action="ModifyCVar" cvar="LevelFivePointGiven" operation="set" value="1"/>
				<triggered_effect trigger="onSelfBuffUpdate" action="CallGameEvent" event="example_give_skillpoint"/>
				<triggered_effect trigger="onSelfBuffUpdate" action="ShowToolbeltMessage" message="Level Five: Free Skill Point!"/>
		</effect_group>
		<!--repeat the above code but change the level number-->
		<effect_group>
			<!--player level==10 AND not already given additional point for level 10 -->
			<requirement name="PlayerLevel" operation="Equals" value="10"/>
			<requirement name="CVarCompare" cvar="LevelTenPointGiven" operation="LTE" value="0"/>
				<triggered_effect trigger="onSelfBuffUpdate" action="ModifyCVar" cvar="LevelTenPointGiven" operation="set" value="1"/>
				<triggered_effect trigger="onSelfBuffUpdate" action="CallGameEvent" event="example_give_skillpoint"/>
				<triggered_effect trigger="onSelfBuffUpdate" action="ShowToolbeltMessage" message="Level Ten: Free Skill Point!"/>
		</effect_group>
	</buff>
</append>

<!--This will add the buffPlayerLevelTracker buff to the system by adding a line to the default buff buffStatusCheck01.
	When the player enters the game it adds the buff if it doesnt already exist-->
<append xpath="/buffs/buff[@name='buffStatusCheck01']">
	<effect_group>
		<requirement name="!HasBuff" buff="buffPlayerLevelTracker"/>
			<triggered_effect trigger="onSelfEnteredGame" action="AddBuff" buff="buffPlayerLevelTracker"/>
	</effect_group>
</append>		
/////END buffs.xml code//////

//////gameevents.xml code //////
<!--give a skill point to player -->
<action_sequence name="example_give_skillpoint">
	<action class="AddSkillPoints">
		<property name="skill_points" value="1" />
	</action>
	<!--see gameevents.xml for other sounds-->
	<action class="PlaySound">
		<property name="sound" value="quest_restore_power_complete" />
	</action>
</action_sequence>
//////END gameevents.xml code //////
 
You can also maybe simplify this to more what you asked:

Here the player level is auto incremented based of the previous level and a level increase:

The upside is that its simple and extensible, downside of this method is your message to the player doesnt include the actual level number (which is a small issue)

In the code two variables are intialised to the values mentioned in your post (level five and increases by 5 each time).

Cheers

Code:
/////buffs.xml code//////
<append xpath="/buffs">	
	<!--buff is hidden from player and doesn't drop on death-->
	<buff name="buffPlayerLevelTracker" hidden="true" remove_on_death="false">
		<stack_type value="replace"/>
		<duration value="0"/>
	
		<effect_group>
			<!--if player level == exampleLevelCount -->
			<requirement name="PlayerLevel" operation="Equals" value="@exampleLevelCount"/>
          	<!--increment the players level to get the next bonus point-->
				<triggered_effect trigger="onSelfBuffUpdate" action="ModifyCVar" cvar="exampleLevelCount" operation="add" value="@exampleLevelIncrease"/>
				<triggered_effect trigger="onSelfBuffUpdate" action="CallGameEvent" event="example_give_skillpoint"/>
				<triggered_effect trigger="onSelfBuffUpdate" action="ShowToolbeltMessage" message="Free Skill Point!"/>
		</effect_group>
	</buff>
</append>

<!--This will add the buffPlayerLevelTracker buff to the system by adding a line to the default buff buffStatusCheck01.
	When the player enters the game it adds the buff if it doesnt already exist-->
<append xpath="/buffs/buff[@name='buffStatusCheck01']">
	<effect_group>
		<requirement name="!HasBuff" buff="buffPlayerLevelTracker"/>
			<triggered_effect trigger="onSelfEnteredGame" action="AddBuff" buff="buffPlayerLevelTracker"/>
	</effect_group>
	
	<effect_group>
		<!--intialise level counting variable to start at 5 but only if its 0-->
		<triggered_effect trigger="onSelfEnteredGame" action="ModifyCVar" cvar="exampleLevelCount" operation="set" value="5">
			<requirement name="CVarCompare" cvar="exampleLevelCount" operation="LTE" value="0"/>
		</triggered_effect>		
		<!--intialise level increase to 5, but only if its 0 -->
		<triggered_effect trigger="onSelfEnteredGame" action="ModifyCVar" cvar="exampleLevelIncrease" operation="set" value="5"> 
			<requirement name="CVarCompare" cvar="exampleLevelIncrease" operation="LTE" value="0"/>
		</triggered_effect>
	</effect_group>		
</append>		
/////END buffs.xml code//////

///gamevents.xml code ////
<!--give a skill point to player -->
<action_sequence name="example_give_skillpoint">
	<action class="AddSkillPoints">
		<property name="skill_points" value="1" />
	</action>
	<!--see gameevents.xml for other sounds-->
	<action class="PlaySound">
		<property name="sound" value="quest_restore_power_complete" />
	</action>
</action_sequence>
//////END gameevents.xml code //////
 
Last edited by a moderator:
I wanted to add something that I forgot to include in the previous posts.

In the first post example above you can change the Level growth curve by simply editing the player level var in the code:

<requirement name="PlayerLevel" operation="Equals" value="5"/>
<requirement name="PlayerLevel" operation="Equals" value="12"/>
<requirement name="PlayerLevel" operation="Equals" value="16"/>






In the second post example its using the

exampleLevelIncrease


variable to set the growth (the mod%5 being linear) and you can change the curve by modifying this variable.

Example increasing the level requirement by one each time a skill point is given, up to a max of 10 levels per skill point:

<append xpath="/buffs">
<!--buff is hidden from player and doesn't drop on death-->
<buff name="buffPlayerLevelTracker" hidden="true" remove_on_death="false">
<stack_type value="replace"/>
<duration value="0"/>

<effect_group>
<!--if player level == exampleLevelCount -->
<requirement name="PlayerLevel" operation="Equals" value="@exampleLevelCount"/>
<!--increment the amount of levels required for the next skill point-->
<triggered_effect trigger="onSelfBuffUpdate" action="ModifyCVar" cvar="exampleLevelIncrease" operation="add" value="1">
<requirement name="exampleLevelIncrease" operation="LT" value="10"/>
</triggered_effect>
<!--increment the players level to get the next bonus point-->
<triggered_effect trigger="onSelfBuffUpdate" action="ModifyCVar" cvar="exampleLevelCount" operation="add" value="@exampleLevelIncrease"/>
<triggered_effect trigger="onSelfBuffUpdate" action="CallGameEvent" event="example_give_skillpoint"/>
<triggered_effect trigger="onSelfBuffUpdate" action="ShowToolbeltMessage" message="Free Skill Point!"/>
</effect_group>
</buff>
</append>




or maybe start with 10 levels required for a free skill point and then at player level 50 reduce it to 5 needed per skill point (because the game's levelling curve is steep after level 50 and skill points are harder to get).

<append xpath="/buffs">
<!--buff is hidden from player and doesn't drop on death-->
<buff name="buffPlayerLevelTracker" hidden="true" remove_on_death="false">
<stack_type value="replace"/>
<duration value="0"/>

<effect_group>
<!--if player level == exampleLevelCount -->
<requirement name="PlayerLevel" operation="Equals" value="@exampleLevelCount"/>
<!--exampleLevelIncrease is intialised to 10, see intialisation code below this buff
Reduce level requirements for the next skill point by 5 at play level 50 -->
<triggered_effect trigger="onSelfBuffUpdate" action="ModifyCVar" cvar="exampleLevelIncrease" operation="add" value="-5"> <!--same as operation="subtract"-->
<requirement name="PlayerLevel" operation="EQ" value="50"/>
</triggered_effect>
<!--increment the players level to get the next bonus point-->
<triggered_effect trigger="onSelfBuffUpdate" action="ModifyCVar" cvar="exampleLevelCount" operation="add" value="@exampleLevelIncrease"/>
<triggered_effect trigger="onSelfBuffUpdate" action="CallGameEvent" event="example_give_skillpoint"/>
<triggered_effect trigger="onSelfBuffUpdate" action="ShowToolbeltMessage" message="Free Skill Point!"/>
</effect_group>
</buff>
</append>

<append xpath="/buffs/buff[@name='buffStatusCheck01']">
<effect_group>
<requirement name="!HasBuff" buff="buffPlayerLevelTracker"/>
<triggered_effect trigger="onSelfEnteredGame" action="AddBuff" buff="buffPlayerLevelTracker"/>
</effect_group>

<effect_group>
<!--intialise level counting variable to start at 10 but only if its 0-->
<triggered_effect trigger="onSelfEnteredGame" action="ModifyCVar" cvar="exampleLevelCount" operation="set" value="10">
<requirement name="CVarCompare" cvar="exampleLevelCount" operation="LTE" value="0"/>
</triggered_effect>
<!--intialise level increase to 10, but only if its 0 -->
<triggered_effect trigger="onSelfEnteredGame" action="ModifyCVar" cvar="exampleLevelIncrease" operation="set" value="10">
<requirement name="CVarCompare" cvar="exampleLevelIncrease" operation="LTE" value="0"/>
</triggered_effect>
</effect_group>
</append>




Just some thoughts.

Cheers

 
Last edited by a moderator:
Back
Top