Jump to content

[HELP] Bedroll buff


SickWolf

Recommended Posts

I'm playing with mods and I find it hard as the comments that serve as documentation is not well maintained.

 

I want to apply some buff when on top of a bedroll. I copied the buff from the campfire and some effect of the Beer buff.

 

blocks.xml

<SickWolfSleepRecovery>

<append xpath="/blocks/bedroll">

<property name="ActiveRadiusEffects" value="buffBedAOE(3)"/>

</append>

</SickWolfSleepRecovery>

 

buffs.xml

<SickWolfSleepRecovery>

<append xpath="/buffs">

<buff name="buffBedAOE" hidden="true">

<stack_type value="ignore"/>

<duration value=".1"/>

<!-- without the 2nd buff the buff display will flicker -->

<effect_group>

<triggered_effect trigger="onSelfBuffStart" action="AddBuff" buff="buffBedAOEEffect"/>

</effect_group>

</buff>

 

<buff name="buffBedAOEEffect" name_key="buffBedAOEEffectName" description_key="buffBedAOEEffectDesc" icon="ui_game_symbol_beer">

<stack_type value="replace"/>

<duration value="2"/>

<effect_group>

<!-- <display_value name="dStaminaRegen" value=".15"/>

<passive_effect name="FoodLoss" operation="perc_subtract" value="0.30"/>

<passive_effect name="StaminaChangeOT" operation="perc_subtract" value="0.30"/> -->

<passive_effect name="HealthChangeOT" operation="perc_add" value="0.25"/>

</effect_group>

 

<triggered_effect trigger="onSelfBuffStart" action="ModifyScreenEffect" intensity="0.3" effect_name="Drunk"/>

<triggered_effect trigger="onSelfBuffRemove" action="ModifyScreenEffect" intensity="0" effect_name="Drunk"/>

</buff>

</append>

</SickWolfSleepRecovery>

 

I kept the beer effect to play with the effects and for testing.

There is no buff being applied when I step on the bedroll. I'd like to slow down hunger and thirst and heal the player slightly faster.

 

Can someone explain to me why the buff is not being applied here?

Link to comment
Share on other sites

Sorry there was no CODE block in the bar. The campfire also use this. I'll investigate.

I also found that

<append xpath="/blocks/bedroll">

should be

<append xpath="/blocks/block[@name='bedroll']">

 

 

Is there an animation we can use so there would be a "sleeping" or "laying on the ground" animation?

Link to comment
Share on other sites

Thanks. I'll just keep the "ModifyScreenEffect" then.

 

I may need to adjust the values a bit after some gameplay but in case someone is interested:

 

Mods/something/Config

blocks.xml

<SickWolfSleepRecovery>
   <append xpath="/blocks/block[@name='bedroll']">
       <property name="BuffsWhenWalkedOn" value="buffBedAOE"/>
   </append>
</SickWolfSleepRecovery>

 

buffs.xml

<SickWolfSleepRecovery>
<append xpath="/buffs">
	<buff name="buffBedAOE" hidden="true">
		<stack_type value="ignore"/>
		<duration value=".1"/>
		<!-- without the 2nd buff the buff display will flicker -->
		<effect_group>
			<requirement name="HasBuff" buff="buffCampfireAOE" target="self"/>
			<triggered_effect trigger="onSelfBuffStart" action="AddBuff" buff="buffBedAOEEffect_Fire"/>
		</effect_group>

		<effect_group>
			<requirement name="NotHasBuff" buff="buffCampfireAOE" target="self"/>
			<triggered_effect trigger="onSelfBuffStart" action="AddBuff" buff="buffBedAOEEffect"/>
		</effect_group>
	</buff>


	<!-- Bed Buff -->
	<buff name="buffBedAOEEffect" name_key="buffBedAOEEffectName" description_key="buffBedAOEEffectDesc" icon="ui_game_symbol_map_bed">
		<stack_type value="replace"/>
		<duration value="1"/>
		<effect_group>
			<passive_effect name="HypothermalResist" operation="base_add" value="6"/>
			<passive_effect name="HyperthermalResist" operation="base_add" value="3"/>

			<passive_effect name="HealthChangeOT" operation="base_add" value="0.018"/>
			<passive_effect name="HealthChangeOT" operation="perc_add" value="0.012"/>

			<passive_effect name="HealthMaxModifierOT" operation="base_add" value="0.008"/>

			<passive_effect name="StaminaChangeOT" operation="base_subtract" value="0.01"/>

			<passive_effect name="FoodLoss" operation="perc_subtract" value="0.03"/>
			<passive_effect name="WaterLoss" operation="perc_subtract" value="0.06"/>

			<triggered_effect trigger="onSelfBuffStart" action="ModifyScreenEffect" effect_name="Dark" intensity="1" fade=".1"/>
			<triggered_effect trigger="onSelfBuffRemove" action="ModifyScreenEffect" effect_name="Dark" intensity="0" fade=".8"/>
		</effect_group>


	</buff>

	<!-- Bed Buff: Fire Buff -->
	<buff name="buffBedAOEEffect_Fire" name_key="buffBedAOEEffect_FireName" description_key="buffBedAOEEffect_FireDesc" icon="ui_game_symbol_map_bed" icon_color="0,125,0">
		<stack_type value="replace"/>
		<duration value="1"/>
		<effect_group>
			<passive_effect name="HypothermalResist" operation="base_add" value="8"/>
			<passive_effect name="HyperthermalResist" operation="base_add" value="1"/>

			<passive_effect name="HealthChangeOT" operation="base_add" value="0.024"/>
			<passive_effect name="HealthChangeOT" operation="perc_add" value="0.014"/>

			<passive_effect name="HealthMaxModifierOT" operation="base_add" value="0.011"/>

			<passive_effect name="StaminaChangeOT" operation="base_subtract" value="0.02"/>

			<passive_effect name="FoodLoss" operation="perc_subtract" value="0.06"/>
			<passive_effect name="WaterLoss" operation="perc_subtract" value="0.10"/>

			<triggered_effect trigger="onSelfBuffStart" action="ModifyScreenEffect" effect_name="Dark" intensity="1" fade=".1"/>
			<triggered_effect trigger="onSelfBuffRemove" action="ModifyScreenEffect" effect_name="Dark" intensity="0" fade=".8"/>
		</effect_group>


	</buff> 
</append>
</SickWolfSleepRecovery>

 

Localization.txt

Key,Source,Context,Changes,English
buffBedAOEEffectDesc,buffs,Buff,New,Your metabolism is slowing down and your body is recovering. Put your bed near a fire too increase the buff.\n\nHypothermal Resist: +6\nHyperthermal Resist: +3\nHealing: 0.018/s + 1.2%\nMax Health: 0.008/s\nReduced Food loss: 3%\nReduced Water loss: 6%
buffBedAOEEffect_FireDesc,buffs,Buff,New,Your metabolism is slowing down and your body is recovering. Put your bed near a fire too increase the buff.\n\nHypothermal Resist: +10\nHyperthermal Resist: +1\nHealing: 0.024/s + 1.4%\nMax Health: 0.011/s\nReduced Food loss: 6%\nReduced Water loss: 10%
buffBedAOEEffectName,buffs,Buff,New,Confy Bed
buffBedAOEEffect_FireName,buffs,Buff,New,Confy Bed near Fire

 

If there is already a bedroll on the floor, pick it up and put it back on the floor after you installed this. This provide slow healing but I don't want to overdo it. From a 60 minute day (2.5 min per in-game hour) it should regen a couple of health point at level 10 IF you spend the night on the bed XD (and miss the exp from killing night zombies roaming around). Slightly more healing if near a fire.

huh, I might end up creating a repo if I continue to play with modding eh? :p But for now this will have to do.

Link to comment
Share on other sites

  • 2 weeks later...
Sorry there was no CODE block in the bar. The campfire also use this. I'll investigate.

I also found that

<append xpath="/blocks/bedroll">

should be

<append xpath="/blocks/block[@name='bedroll']">

 

 

Is there an animation we can use so there would be a "sleeping" or "laying on the ground" animation?

 

The closest we have currently would be the player ragdoll when knocked down by a vehicle or sledgehammer etc.

You may be able to work with that in some way.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...