Jump to content

How to disable -10 wellness when we died?


camuless

Recommended Posts

I have not tested this and I do not know if it will work but I did notice this value when changing my minimum wellness level for my mod so it might work and it might not.

 

to change the amount of wellness that is lost per death you need to open the Assembly-CSharp flle and navigate to EntityAlive and find SetAlive() : Void, inside SetAlive you need to change the 10f number to whatever you feel you want it to be within reason.

 

Again keep in mind I have not actually tested this and there may need to be other values that need to be changed elsewhere but I do not know since I am very new to dll editing myself.

 

public override void SetAlive()
{
bool flag = this.IsDead();
base.SetAlive();
if (!this.isEntityRemote)
{
	this.Stats.ResetStats();
	if (flag)
	{
		while (true)
		{
			switch (5)
			{
			case 0:
				continue;
			}
			break;
		}
		if (!true)
		{
			RuntimeMethodHandle arg_3C_0 = methodof(EntityAlive.SetAlive()).MethodHandle;
		}
		float a = this.Stats.Wellness.Value - [color="#FFFF00"]10f[/color];
		this.Stats.Wellness.Value = Mathf.Max(a, 30f);
		Log.Out(US.ZZ(191910) + this.Stats.Wellness.Value.ToCultureInvariantString());
	}
	this.Stats.UpdatePlayerProgression();
}
else
{
	this.Stats.ClearImmunity();
}
this.Health = (int)this.Stats.Health.Max;
this.Stamina = (float)this.GetMaxStamina();
this.Sickness = 0;
this.Gassiness = 0;
this.deathUpdateTime = 0;
this.bDead = false;
this.NL.Fatal = false;
this.emodel.SetAlive();
}

Link to comment
Share on other sites

I'm pretty sure that's a DLL mod.

 

But you could try modifying the initvars buff at the top of buffs.xml so it's like this.

 

<buff id="initvars" duration="1" actions="setvar(beers,0);setvar(BDKbloodLoss,0);setvar(CTRbed,0);setvar(CTRbedroll,0);setvar(CTRbigbed,0);setvar(CTRblockBurn2,0);setvar(CTRblockBurn3,0);setvar(CTRroadrun,0);setvar(CTRsnowberry,0);setvar(CTRtrapDmg1,0);setvar(CTRbluePill,0)"/>
<modify id="0" stat="wellness" amount="10" rate="1" />
</buff>

 

Downside is, if it works, you will start the game with an extra 10 wellness because that buff is called on game start AND when you die.

Link to comment
Share on other sites

I'm pretty sure that's a DLL mod.

 

But you could try modifying the initvars buff at the top of buffs.xml so it's like this.

 

<buff id="initvars" duration="1" actions="setvar(beers,0);setvar(BDKbloodLoss,0);setvar(CTRbed,0);setvar(CTRbedroll,0);setvar(CTRbigbed,0);setvar(CTRblockBurn2,0);setvar(CTRblockBurn3,0);setvar(CTRroadrun,0);setvar(CTRsnowberry,0);setvar(CTRtrapDmg1,0);setvar(CTRbluePill,0)"/>
<modify id="0" stat="wellness" amount="10" rate="1" />
</buff>

 

Downside is, if it works, you will start the game with an extra 10 wellness because that buff is called on game start AND when you die.

 

That is a good idea too for a workaround where you can make a buff return an X amount of wellness upon respawn, however you can not modify the initvars buff since it is hardcoded. You would have to create a seperate buff for it.

Link to comment
Share on other sites

ClockworkOrange is right.

Also, we can't decrease wellness strict amount via xml. When player dies, always decrease 10 pts, but all wellness decreasing via xml changes based on current wellness. (70-100:100%, 100-150: 50%, 150-200: 25%)

 

@KhaineGB All custom vars are initialized to 1, opposed to built-in ones such as beers are initialized to 0. Also, initvars is never fired, unless you make trigger such as buffif or onexpired from other buff. It's just existing there.

Link to comment
Share on other sites

I use a custom variable reset upon death buff that is usefull for removing any variables so they dont carry over after death and can be used within the full scope of what is possible within the current buff system.

 

<buff id="GameStart" duration="3" mutex="GameStartLock" buffif="coretemp lequal 300" onexpired="GameReset" />
<buff id="GameReset" duration="3" onexpired="GameStartLock" mutex="GameStartLock" actions="setvar(venomGood, 0);setvar(venomBad, 0);setvar(infected, 0);setvar(CTRChair, 0);setvar(CTRCouch, 0);setvar(fatigue, 0);setvar(CTRlotus, 0);setvar(shocking, 0);setvar(hygiene, 0)" />
<buff id="GameStartLock"/>

 

basically what this buff does is it will buff "GameStart" for 3 seconds upon respawning or "birth" after those 3 seconds the buff expires and casts the "GameReset" buff which resets all your custom variables and casts the buff "GameStartLock" which locks out the resetting buffs from reocurring.

 

I have tested the few different ways that is possible to achieve this same goal and this is the most reliable method of which to do it.

Link to comment
Share on other sites

An easier way may be to modify the wellness level in progression.xml

 

In the Health Nut perk you could modify your min wellness, maybe this will work...

 

<perk name="Health Nut" icon="run" description_key="healthNutDesc" title_key="healthNut" max_level="5" skill_point_cost_multiplier="1.43" skill_point_cost_per_level="5" always_fire="true" group="health">
<requirement perk_level="1" required_skill_name="Athletics" required_skill_level="1"/>
<requirement perk_level="2" required_skill_name="Athletics" required_skill_level="10"/>
<requirement perk_level="3" required_skill_name="Athletics" required_skill_level="20"/>
<requirement perk_level="4" required_skill_name="Athletics" required_skill_level="40"/>
<requirement perk_level="5" required_skill_name="Athletics" required_skill_level="60"/>
<effect name="MinWellness">
	<add perk_level="0" value="30"/>
	<add perk_level="1" value="30"/>
	<add perk_level="2" value="30"/>
	<add perk_level="3" value="30"/>
	<add perk_level="4" value="30"/>
	<add perk_level="5" value="50"/>
</effect>
<effect name="MaxWellness">
	<add perk_level="0" value="0"/>
	<add perk_level="1" value="5"/>
	<add perk_level="2" value="10"/>
	<add perk_level="3" value="20"/>
	<add perk_level="4" value="30"/>
	<add perk_level="5" value="50"/>
</effect>
</perk>

Link to comment
Share on other sites

Thank you for all idea.

 

I want to create a PVP server when players are fighting and killing, their wellness is not decrease. I think they will have more enjoy fighting.

 

I try to change from your idea but it not works. Do you have more idea?

Link to comment
Share on other sites

No worries, as a rule of thumb is usually best to explain what your main goal is when modding because it is usually likely that there is more than one way to do something. With a specific questions sometimes answers are overlooked or never discovered.

 

with that said you can replace the health nut perk with this modified version and what it does is sets minimum wellness to 100 so you can still gain wellness up to a total of 250 with the active health nut perk and can lose any wellness gained above 100.

 

Its not 100% the same functionality as removing the wellness penalty on death but it is the easiest way to achieve close to what you are looking for.

 

<perk name="Health Nut" icon="run" description_key="healthNutDesc" title_key="healthNut" max_level="5" skill_point_cost_multiplier="1.43" skill_point_cost_per_level="5" always_fire="true" group="health">
	<requirement perk_level="1" required_skill_name="Athletics" required_skill_level="1"/>
	<requirement perk_level="2" required_skill_name="Athletics" required_skill_level="10"/>
	<requirement perk_level="3" required_skill_name="Athletics" required_skill_level="20"/>
	<requirement perk_level="4" required_skill_name="Athletics" required_skill_level="40"/>
	<requirement perk_level="5" required_skill_name="Athletics" required_skill_level="60"/>
	<effect name="MinWellness">
		<setvalue perk_level="0" value="100"/>
		<setvalue perk_level="1" value="100"/>
		<setvalue perk_level="2" value="100"/>
		<setvalue perk_level="3" value="100"/>
		<setvalue perk_level="4" value="100"/>
		<setvalue perk_level="5" value="100"/>
	</effect>
	<effect name="MaxWellness">
		<add perk_level="0" value="0"/>
		<add perk_level="1" value="5"/>
		<add perk_level="2" value="10"/>
		<add perk_level="3" value="20"/>
		<add perk_level="4" value="30"/>
		<add perk_level="5" value="50"/>
	</effect>
</perk>

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...