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

Need help adding displayed stats on a consumable item.

dajokaman759

New member
Hello, I was making a silly little mod for our private server to allow us to drink gasoline which would buff move speed significantly for like 3 minutes and a bit of hunger and thirst but I cannot seem to get it to display the food stats that shows how much hunger, thirst and move speed it provides. 

A0nNcR4.png


Heres the items.xml I did for it so far.

Code:
<configs>

<append xpath="/items">

<item name="drinkDrinkableGas">
	<property name="Extends" value="drinkJarRedTea"/>
	<property name="Tags" value="drinks"/>
	<property name = "DisplayType" value = "drinkDrinkableGas" />
	<property name="HoldType" value="3"/>
	<property name="Meshfile" value="@:Other/Items/Food/bottled_waterPrefab.prefab"/>
	<property name="DropMeshfile" value="@:Other/Items/Misc/sack_droppedPrefab.prefab"/>
	<property name="Material" value="Mglass"/>
	<property name="Stacknumber" value="25"/>
	<property name="EconomicValue" value="50"/>
	<property name="CraftingIngredientTime" value="10"/>

	<property class="Action0">
		<property name="Class" value="Eat"/>
		<property name="Delay" value="1"/>
		<property name="Sound_start" value="player_drinking"/>
	</property>

	<property name="Group" value="Food/Cooking,CFDrink/Cooking"/>

	<effect_group tiered="false" name="Drink Tier 0">
			<triggered_effect trigger="onSelfPrimaryActionEnd" action="ModifyCVar" cvar="$foodAmountAdd" operation="add" value="30"/>
			<triggered_effect trigger="onSelfPrimaryActionEnd" action="ModifyCVar" cvar="foodHealthAmount" operation="add" value="10"/>
			<triggered_effect trigger="onSelfPrimaryActionEnd" action="ModifyCVar" cvar="$waterAmountAdd" operation="add" value="50"/>
			<triggered_effect trigger="onSelfPrimaryActionEnd" action="AddBuff" buff="buffProcessConsumables,GasPegasus"/>
			<display_value name="dRunSpeed" value="200"/>
			<display_value name="dDuration" value="500"/>
			<display_value name="dStaminaRegen" value=".25"/>
			<triggered_effect trigger="onSelfPrimaryActionEnd" action="AddBuff" buff="GasPegasus" duration="300"/>
	</effect_group>

	<effect_group tiered="false">
		<requirement name="HasBuff" buff="buffIsOnFire"/>
			<triggered_effect trigger="onSelfPrimaryActionEnd" action="AddBuff" buff="buffExtinguishFire"/>
	</effect_group>
</item>


</append>


</configs>
 
Just skimming through it quickly I see dRunSpeed=200. I believe that is a percentage expressed as a ratio, so you have 20,000% increase in speed. That might be confusing it.

 
Do you have a drinkDrinkableGas entry in ui_display.xml? That's where DisplayType points to. 

 
Just skimming through it quickly I see dRunSpeed=200. I believe that is a percentage expressed as a ratio, so you have 20,000% increase in speed. That might be confusing it.
how do the statistic values work? I thought it meant 1 = 1%. Am I completely going overkill with the hunger and thirst stats too?

 
how do the statistic values work? I thought it meant 1 = 1%. Am I completely going overkill with the hunger and thirst stats too?


In this case, 1 would be 100%. Some stat buffs are percentage increase/decrease and some are absolute numbers. I think the food and water are ok. Look at other foods and drinks in items to see how the numbers are used.

 
how do the statistic values work? I thought it meant 1 = 1%. Am I completely going overkill with the hunger and thirst stats too?


Hi Dajokaman759

You could put .2 in dRunSpeed which would be 20% of your running speed.
In the water and food statistics you will only add 30 and 50 respectively, you don't have that as a percentage.

Regards

Gouki

 
Back
Top