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

Near Death Trauma - Mod or item

Question - Near Death Trauma (NDT) is there a way to heal or remove it?

basically I am thinking of making an item that can be crafted like a Trauma Kit that would remove NDT.

I need to know if its a state that can be "healed" or a buff that can be removed

 
Have you looked at buffNearDeathTrauma? :)

I guess any item with something like

Code:
<effect_group tiered="false">
 <triggered_effect trigger="onSelfPrimaryActionEnd" action="RemoveBuff" target="self" buff="buffNearDeathTrauma"/>
</effect_group>
should do the trick.

 
Code:
<triggered_effect trigger="onSelfPrimaryActionEnd" action="RemoveBuff" target="self" buff="buffNearDeathTraumaTrigger"/>
This should be the code you would need to remove the NDT. You CAN build an item from scratch OR you can just build an item based on the bandage or medkit. You'll just want to make sure the above code is within the code below:

Code:
<effect_group tiered="false">
</effect_group>
 
can you explain

<effect_group tiered="false">

</effect_group>

I see effect_group in many buffs like broken leg but I can't find anything with "tiered" in the buff.xml file

 
buffNearDeathTrauma

buffNearDeathTraumaCalculate

You might want to either include the above two lines in additional lines on the item OR you'll run into an infinite debuff of lower stats. You'll need the debuff removed... I haven't tested this but this is the code you'll need. Not sure if the "RemoveBuff" will work. I'll try it when I get a chance.

 
If you want to create a new item, it will be in items.xml.

Something along those lines if you're creating a modlet:

Code:
<append xpath="/items">
   <item name="NearDeathTraumaKit">
     <property name="Extends" value="medicalBandage" param1="DescriptionKey"/>
     <property name="Group" value="Science"/>
     <property name="EconomicValue" value="200"/>
     <property name="CraftingSkillGroup" value="craftSkillScience"/>
     <property name="Stacknumber" value="5"/>
     <property class="Action0">
       <requirement name="StatCompare" stat="health" operation="lte" value="50"/>
       <property name="Sound_start" value="player_firstAidKit"/>
     </property>
     <property class="Action1">
       <property name="Sound_start" value="player_firstAidKit"/>
     </property>
     <effect_group tiered="false">
       <triggered_effect trigger="onSelfPrimaryActionEnd" action="RemoveBuff" target="self" buff="buffNearDeathTrauma"/>
     </effect_group>
   </item>
 </append>
(Without the append otherwise.)

I just tried it and it worked.

You'll need a

Code:
<property name="CustomIcon" value="something"/>
though. :)

 
Code:
<item name="medicalBandage">
<property name="DisplayType" value="medical"/>
<property name="HoldType" value="16"/>
<property name="Meshfile" value="Items/Health/gauze"/>
<property name="DropMeshfile" value="Items/Misc/sack_droppedPrefab"/>
<property name="Material" value="Mcloth"/>
<property name="Stacknumber" value="10"/> <!-- STK medical -->
<property name="FuelValue" value="1"/>
<property name="Weight" value="5"/>
<property name="EconomicValue" value="5"/>
<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_bandage"/>
</property>
<property class="Action1">
	<property name="Class" value="UseOther"/>
	<property name="Delay" value="1.0"/>
	<property name="Use_time" value="..."/>
	<property name="Sound_start" value="player_bandage"/>
</property>
<property name="Group" value="Science,Basics"/>
<property name="DescriptionKey" value="medicalBandageDesc"/>
<property name="ActionSkillGroup" value="Medicine"/>
<property name="CraftingSkillGroup" value="craftSkillMiscellaneous"/>
<property name="PickupJournalEntry" value="firstAidTip"/>

[color="#FF0000"]<effect_group tiered="false">
	<triggered_effect trigger="onSelfPrimaryActionEnd" action="ModifyCVar" target="self" cvar="maxHealthAmount" operation="add" value="15"/> <!-- X -->
	<triggered_effect trigger="onSelfPrimaryActionEnd" action="ModifyCVar" target="self" cvar="maxHealthIncrease" operation="set" value="@medicPerkIncrease"/>

	<triggered_effect trigger="onSelfPrimaryActionEnd" action="AddBuff" target="self" buff="buffProcessConsumables"/>
	<triggered_effect trigger="onSelfPrimaryActionEnd" action="RemoveBuff" target="self" buff="buffInjuryBleeding"/>

	<triggered_effect trigger="onSelfSecondaryActionEnd" action="ModifyCVar" target="other" cvar="maxHealthAmount" operation="add" value="15"/> <!-- X -->
	<triggered_effect trigger="onSelfSecondaryActionEnd" action="ModifyCVar" target="other" cvar="maxHealthIncrease" operation="set" value="1.25">
		<requirement name="CVarCompare" target="self" cvar="maxHealthIncrease" operation="Equals" value="1.25"/> </triggered_effect>
	<triggered_effect trigger="onSelfSecondaryActionEnd" action="ModifyCVar" target="other" cvar="maxHealthIncrease" operation="set" value="1.5">
		<requirement name="CVarCompare" target="self" cvar="maxHealthIncrease" operation="Equals" value="1.5"/> </triggered_effect>
	<triggered_effect trigger="onSelfSecondaryActionEnd" action="ModifyCVar" target="other" cvar="maxHealthIncrease" operation="set" value="2">
		<requirement name="CVarCompare" target="self" cvar="maxHealthIncrease" operation="Equals" value="2"/> </triggered_effect>

	<triggered_effect trigger="onSelfSecondaryActionEnd" action="AddBuff" target="other" buff="buffProcessConsumables"/>
	<triggered_effect trigger="onSelfSecondaryActionEnd" action="RemoveBuff" target="other" buff="buffInjuryBleeding"/>
</effect_group>[/color]
</item>
Here is the bandage as an example. It says "tiered=false" because its not a function of the current game iteration. It might have meaning in the future but for now it's just how it works.

 
If you want to create a new item, it will be in items.xml.Something along those lines if you're creating a modlet:

Code:
<append xpath="/items">
   <item name="NearDeathTraumaKit">
     <property name="Extends" value="medicalBandage" param1="DescriptionKey"/>
     <property name="Group" value="Science"/>
     <property name="EconomicValue" value="200"/>
     <property name="CraftingSkillGroup" value="craftSkillScience"/>
     <property name="Stacknumber" value="5"/>
     <property class="Action0">
       <requirement name="StatCompare" stat="health" operation="lte" value="50"/>
       <property name="Sound_start" value="player_firstAidKit"/>
     </property>
     <property class="Action1">
       <property name="Sound_start" value="player_firstAidKit"/>
     </property>
     <effect_group tiered="false">
       <triggered_effect trigger="onSelfPrimaryActionEnd" action="RemoveBuff" target="self" buff="buffNearDeathTrauma"/>
     </effect_group>
   </item>
 </append>
(Without the append otherwise.)

I just tried it and it worked.

You'll need a

Code:
<property name="CustomIcon" value="something"/>
though. :)
I know XML but rusty. what does the /append xpath do? normally I would just add a new item.

ALSO I assume this is added to the items.xml file.

not sure how to add a custom/new icon to the game.

I did try your code without the /append and I see the item in creative menu with no icon but I get the following error when I try and use it:

NullReferenceException: Object Reference Not set to an Instance of an Object

 
Last edited by a moderator:
If you're just adding it to the vanilla xmls, you don't need the append stuff. That's just if you're making a separate modlet out of it.

And for the icon you an always use one that's already in the game. Can add a tint to it so it's recognizable.

Code:
<property name="CustomIcon" value="ammoRocketHE"/><property name="CustomIconTint" value="107,12,12"/>
That's the RocketFrag icon, just using the RocketHE with a tint, for example. You could use any icon, just find the name of the one you want. :)

 
Made a quick test item. This worked for me. All it does is remove the NDT buff, nothing else. You could always add some effects from the medical bandage if you wanted it to also do some healing or whatever.

Code:
<item name="TEST">
<property name="DisplayType" value="medical"/>
<property name="HoldType" value="16"/>
<property name="Meshfile" value="Items/Health/gauze"/>
<property name="DropMeshfile" value="Items/Misc/sack_droppedPrefab"/>
<property name="Material" value="Mcloth"/>
<property name="Stacknumber" value="10"/> <!-- STK medical -->
<property name="FuelValue" value="1"/>
<property name="Weight" value="5"/>
<property name="EconomicValue" value="5"/>
<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_bandage"/>
</property>
<property class="Action1">
	<property name="Class" value="UseOther"/>
	<property name="Delay" value="1.0"/>
	<property name="Use_time" value="..."/>
	<property name="Sound_start" value="player_bandage"/>
</property>
<property name="Group" value="Science,Basics"/>
<property name="DescriptionKey" value="medicalBandageDesc"/>
<property name="ActionSkillGroup" value="Medicine"/>
<property name="CraftingSkillGroup" value="craftSkillMiscellaneous"/>
<property name="PickupJournalEntry" value="firstAidTip"/>

<effect_group tiered="false">
	<triggered_effect trigger="onSelfPrimaryActionEnd" action="RemoveBuff" target="self" buff="buffNearDeathTrauma"/>
</effect_group>
</item>
 
ok I will try this.

I am NEW to Mod/modlets in A13-A16 I would just mode the existing /data/config/*.xml files.

so you are saying I can use the /append tag to put the new item in a file called (for example) /mods/mymodlet.xml and as long as I have the "<append xpath="/items">" and </append> wrapper it will know that this is an extension of items.xml? could I put an append for block and recipe and items all in the same mymodlet.xml ?

 
No, you need to create a new XML called items.xml then put the append code in that and place that XML in your mods folder. And no, you need to do block changes in blocks.xml, recipes in recipes.xml, and items in items.xml

 
If you have any other modlets, check the file structure.

It would go in Mods/yourmodsfolder/Config/items.xml.

You'll also need a modinfo.xml in your mod folder so it loads it.

 
I am getting errors when I run my modlet.

the error when I USE the item is: NullReferenceException: Object Reference Not set to an Instance of an Object

is it because I do not have NDT on me?

I put the modlet in the /mods/LonestarCanuck_Mods folder and it contains a ModInfo and a folder called config with the items.xml. here is the code:

ModInfo.xml

Code:
<?xml version="1.0" encoding="UTF-8" ?>
<xml>
<ModInfo>
	<Name value="LonestarCanuck_mods" />
	<Description value="LonestarCanuck_mods" />
	<Author value="LonestarCanuck" />
	<Version value="1.0" />
	<Website value="http://www.lonestarcanuck.com/" />
</ModInfo>
</xml>
and the items.xml

Code:
<configs>

<append xpath="/items" >


   <item name="NearDeathTraumaKit">
     <property name="Extends" value="medicalBandage" param1="DescriptionKey"/>
  <property name="CustomIcon" value="ammoRocketHE"/><property name="CustomIconTint" value="107,12,12"/>
     <property name="Group" value="Science"/>
     <property name="EconomicValue" value="200"/>
     <property name="CraftingSkillGroup" value="craftSkillScience"/>
     <property name="Stacknumber" value="5"/>
     <property class="Action0">
       <requirement name="StatCompare" stat="health" operation="lte" value="50"/>
       <property name="Sound_start" value="player_firstAidKit"/>
     </property>
     <property class="Action1">
       <property name="Sound_start" value="player_firstAidKit"/>
     </property>
     <effect_group tiered="false">
       <triggered_effect trigger="onSelfPrimaryActionEnd" action="RemoveBuff" target="self" buff="buffNearDeathTrauma"/>
     </effect_group>
   </item>

</append>

</configs>
 
Last edited by a moderator:
Not sure honestly. I do know that line under Action0 with StatCompare in it is commented out in vanilla. Try removing that single line. If that doesn't work, try using my code just to see.

I wouldn't think not having NDT would cause an NRE.

 
Last edited by a moderator:
Try to add a requirement like so

Code:
<effect_group tiered="false">
 <requirement name="HasBuff" buff="buffNearDeathTrauma"/>
 <triggered_effect trigger="onSelfPrimaryActionEnd" action="RemoveBuff" target="self" buff="buffNearDeathTrauma"/>
</effect_group>
 
Back
Top