Food box, is it possible to spawn?

Angelykc

Member
I'm looking for a script for a placeable food box in the game.. i've seen them spawn in a Land_barrack on another server and would like to place them on mine for food spawns for my military outposts. i've looked for a script but can't find one. anybody know how to spawn it?
 
yeah, i thought of that, the problem with that would be all the mags that spawn, i want it to primarily be used for food not so much ammo.. and i want the food to respawn on server restarts.. but i have to spawn it in using 2d editor .. i can't edit any mission or server files because i'm having a problem uploading updated pbo's to my host site.

I appreciate the feedback though :)
 
They won't spawn with anything in them. If you add them as a deployable. You just add the inventory via DB and they will refill in server restart :) Save's editing any PBO files. Which host are you with?
 
have you tried to add it (the foodbox or medical box also refills normally if you empty it) in the 3d editor and then place it ingame over the db method?
 
They won't spawn with anything in them. If you add them as a deployable. You just add the inventory via DB and they will refill in server restart :) Save's editing any PBO files. Which host are you with?

Oh smart thinking? do you have the code for said empty box?
 
Yeah sure, first decide which one you want to use. The small chest type one is USBasicAmmunitionBox_EP1.

Add this to your "deployables" table on the database.

Then create a new player with a random unique ID & random ID, I used 9999999 and 9999. Then create them a "life" in the survivor table and ensure that they are set to alive. (i.e. is_dead is 0) Then, head to instance_deployable and create a deployable instance for your ammo crate. Making sure you use the ID as the one you set for your ammo box.

Set your world space (by placing an object in the editor and using the position from the mission.sqf file the editor makes) Add your inventory, here's mine for a food/med box
Code:
[[[],[]],[["FoodSteakCooked","FoodCanSardines","FoodCanBakedBeans","FoodCanFrankBeans","FoodCanPasta","ItemSodaCoke","ItemSodaPepsi","ItemSodaMdew","ItemWaterbottle","ItemPainkiller","ItemEpinephrine","ItemMorphine","ItemBloodbag","ItemBandage","ItemAntibiotic"],[15,15,15,15,15,15,15,3,15,20,15,15,20,35,10]],[[],[]]]

Again use a random unique ID, I used 999999 for the first, then 9999991, 9999992 and so on for my "custom" deployed items.

Set the owner ID to the fake player you created above, this ensures clean up scripts don't delete it.

Done.

This was a little rushed, sorry if ti makes no sense lol
 
Yeah sure, first decide which one you want to use. The small chest type one is USBasicAmmunitionBox_EP1.

Add this to your "deployables" table on the database.

Then create a new player with a random unique ID & random ID, I used 9999999 and 9999. Then create them a "life" in the survivor table and ensure that they are set to alive. (i.e. is_dead is 0) Then, head to instance_deployable and create a deployable instance for your ammo crate. Making sure you use the ID as the one you set for your ammo box.

Set your world space (by placing an object in the editor and using the position from the mission.sqf file the editor makes) Add your inventory, here's mine for a food/med box
Code:
[[[],[]],[["FoodSteakCooked","FoodCanSardines","FoodCanBakedBeans","FoodCanFrankBeans","FoodCanPasta","ItemSodaCoke","ItemSodaPepsi","ItemSodaMdew","ItemWaterbottle","ItemPainkiller","ItemEpinephrine","ItemMorphine","ItemBloodbag","ItemBandage","ItemAntibiotic"],[15,15,15,15,15,15,15,3,15,20,15,15,20,35,10]],[[],[]]]

Again use a random unique ID, I used 999999 for the first, then 9999991, 9999992 and so on for my "custom" deployed items.

Set the owner ID to the fake player you created above, this ensures clean up scripts don't delete it.

Done.

This was a little rushed, sorry if ti makes no sense lol


I love you man! Thanks!
 
Back
Top