Jump to content
steam-76561198088513750

How to add materials to the first aid kit?

Recommended Posts

I'm going to play role-playing in my LAN server, i can only add batteries to my flashlight.but I don't know how to add medical supplies to the first aid kit,

This is an example;

ItemBase flashlight = player.GetInventory().CreateInInventory("Flashlight"); 
flashlight.GetInventory().CreateAttachment("Battery9V"); 

Here is an example of my own imitation, which is wrong (XD)   👇

        ItemBase FirstAidKit = player.GetInventory().CreateInInventory("FirstAidKit");
        FirstAidKit.GetInventory().CreateAttachment("BandageDressing");
        FirstAidKit.GetInventory().CreateAttachment("SalineBagIV");
        FirstAidKit.GetInventory().CreateAttachment("Epinephrine");
        FirstAidKit.GetInventory().CreateAttachment("BloodTestKit");

Which can I modify to make bat pass the verification and start the server?  👆

 

Forgive me for being a rookie. Thanks ☺️

Share this post


Link to post
Share on other sites

This code works for me:

EntityAI playersFirstAidKit = player.GetInventory().CreateInInventory("FirstAidKit");
playersFirstAidKit.GetInventory().CreateInInventory("BandageDressing");
playersFirstAidKit.GetInventory().CreateInInventory("SalineBagIV");
playersFirstAidKit.GetInventory().CreateInInventory("Epinephrine");
playersFirstAidKit.GetInventory().CreateInInventory("BloodTestKit");

I put it in init.c and I spawned with the first aid kit with the items in it, except for the Epinephrine. I think it's because it won't fit into the first aid kit unless it's turned horizontally, which the object creator doesn't seem to try, so it just didn't put it in there.

Share this post


Link to post
Share on other sites

If you want to add items in the first aid kit, the cfgspawnabletypes.xml must be edited. Search for "FirstAidKit" there and replace the code

	<type name="FirstAidKit">
		<tag name="shelves" />
		<cargo chance="1">
			<item name="BandageDressing" />
		</cargo>
		<cargo chance="1">
			<item name="BloodTestKit" />
		</cargo>
		<cargo chance="1">
			<item name="BloodBagEmpty" />
		</cargo>
		<cargo chance="1">
			<item name="StartKitIV" />
		</cargo>
	</type>

for example with this one:

	<type name="FirstAidKit">
		<tag name="shelves" />
		<cargo chance="1">
			<item name="BandageDressing" />
		</cargo>
		<cargo chance="1">
			<item name="BloodTestKit" />
		</cargo>
		<cargo chance="1">
			<item name="BloodBagEmpty" />
		</cargo>
		<cargo chance="1">
			<item name="StartKitIV" />
		</cargo>
		<cargo chance="0.5">
			<item name="Morphine" />
		</cargo>
		<cargo chance="0.5">
			<item name="Epinephrine" />
		</cargo>		
	</type>

In the example, epinephrine and morphine have been added. But theoretically you can also add other items.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×