Results 1 to 7 of 7

Thread: [HELP] Bedroll buff

  1. #1
    Scavenger
    Join Date
    Jul 2019
    Posts
    33
    Rep Power
    0

    [HELP] Bedroll buff

    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?
    Last edited by SickWolf; 11-11-2019 at 07:24 PM.

  2. #2
    Zombie Hunter bdubyah's Avatar
    Join Date
    Dec 2016
    Location
    Tennessee
    Posts
    469
    Rep Power
    1
    This would be easier to read if you used some CODE tags.

    In the blocks.xml you have "buffBedAOE(3)" but in buffs.xml it's "buffBedAOE". Maybe that's it?

  3. #3
    Scavenger
    Join Date
    Jul 2019
    Posts
    33
    Rep Power
    0
    Sorry there was no CODE block in the bar. The campfire also use this. I'll investigate.
    I also found that
    Code:
    <append xpath="/blocks/bedroll">
    should be
    Code:
    <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?

  4. #4
    Zombie Hunter bdubyah's Avatar
    Join Date
    Dec 2016
    Location
    Tennessee
    Posts
    469
    Rep Power
    1
    Not easily, no. Animation stuff is tricky.

  5. #5
    Scavenger
    Join Date
    Jul 2019
    Posts
    33
    Rep Power
    0
    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
    Code:
    <SickWolfSleepRecovery>
        <append xpath="/blocks/block[@name='bedroll']">
            <property name="BuffsWhenWalkedOn" value="buffBedAOE"/>
        </append>
    </SickWolfSleepRecovery>
    buffs.xml
    Code:
    <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
    Code:
    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.

  6. #6
    Zombie Hunter
    Join Date
    Feb 2018
    Posts
    443
    Rep Power
    1
    I did mine a while back but all I added to mine was that It healed you for 1hp every 2s never went any further than that....

  7. #7
    Colony Founder Doombringer101's Avatar
    Join Date
    Aug 2015
    Posts
    3,091
    Rep Power
    1
    Quote Originally Posted by SickWolf View Post
    Sorry there was no CODE block in the bar. The campfire also use this. I'll investigate.
    I also found that
    Code:
    <append xpath="/blocks/bedroll">
    should be
    Code:
    <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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •