mjrice
New member
I thought this would be easy but I can not figure it out. I have tried maybe 10 different ways to simply give the player XP when a consumable item is used. I can give xp when a block is destroyed, and I can give xp when a recipe is crafted no problem. But not when an item is used?
Here is an example item for discussion:
Let's say I want to give the player 40XP when they eat a blueberry pie. I have tried putting things like this in the Action0 property group
I have also tried "PlayerExp". And this:
I have also tried putting something in the effect_group like these:
or
But none of those work, either. I even tried doing it through a buff, where using the item applies the buff which then looks something like this:
But alas, no matter what I have tried I can not seem to get it to work. I can't tell you how many blueberry pies I have eaten so far. please help if you can
Here is an example item for discussion:
Code:
<item name="foodBlueberryPie">
<property name="HoldType" value="31"/>
<property name="DisplayType" value="food"/>
<property name="Meshfile" value="Items/Misc/parcelPrefab"/>
<property name="DropMeshfile" value="Items/Misc/sack_droppedPrefab"/>
<property name="Material" value="Morganic"/>
<property name="Stacknumber" value="50"/> <!-- STK food -->
<property name="EconomicValue" value="124"/>
<property class="Action0">
<property name="Class" value="Eat"/>
<property name="Delay" value="1.0"/>
<property name="Use_time" value="..."/>
<property name="Sound_start" value="player_eating"/>
<!-- jar from cooking food <property name="Create_item" value="drinkJarEmpty"/> -->
</property>
<property name="Group" value="Food/Cooking"/>
<effect_group tiered="false">
<triggered_effect trigger="onSelfPrimaryActionEnd" action="ModifyCVar" cvar="$foodAmountAdd" operation="add" value="45"/>
<triggered_effect trigger="onSelfPrimaryActionEnd" action="ModifyCVar" cvar="foodHealthAmount" operation="add" value="22"/>
<triggered_effect trigger="onSelfPrimaryActionEnd" action="AddBuff" target="self" buff="buffProcessConsumables"/>
</effect_group>
</item>
Code:
<property name="PlayerExpGain" operation="add" value="40"/>
Code:
<property name="ActionExp" value="40" />
<property name="ActionExpBonusMultiplier" value="1"/>
Code:
<triggered_effect trigger="onSelfPrimaryActionEnd" action="ModifyCVar" cvar="PlayerExp" operation="add" value="40"/>
Code:
<triggered_effect name="PlayerExpGain" operation="add" value="40" />
Code:
<buff name="eatAPie">
<duration value="0"/>
<effect_group>
<passive_effect name="PlayerExpGain" operation="add" value="40" />
</effect_group>
</buff>