Jump to content
Corpse Eater

Spawn Tents already deployed with inventory in them

Recommended Posts

Ex.  I want to spawn a car tent with gear already inside of it when the server starts up so people can choose gear in this game mode.  Is this possible?  Is it also possible to make those items in the tent instantly or quickly respawn once they are taken from the tent so others might be able to loot the same item? 

Share this post


Link to post
Share on other sites

You can access the inventory of the spawned object with 

GetInventory()

and create items in it with

GetInventory().CreateInInventory()

 

  • Beans 1

Share this post


Link to post
Share on other sites

understand that.  what i want to do is something like

GetInventory().CreateObject(CarTent)   (when this object is created in the world though, i would like it to be deployed(not packed up) as in someone took it and placed it so they could access the inventory)

Basically what I would like to do is make a spawn area where there are deployed tents that already have gear in them so people can take whatever gear they want before they leave the spawn.  I would also like the gear that is spawned in the tents to never go away after being looted or immediately respawn so another player can get the same items and items won't run out before server restart. 

 

Wasn't sure if there was a switch or something i could toggle to make the tent spawn deployed other than packed up. 

Thanks for the reply

Share this post


Link to post
Share on other sites

The only way i would know how to do this would be to set it up on the server with all the things you want inside, create a save point, and then just restore when you want it?

 

Edit: But i'm guessing that is no help at all seeing as you want to spawn it, probably at different locations?

Edited by Dongleberry

Share this post


Link to post
Share on other sites

I can probably do it that way.  What about making it so say a m4a1 when pulled from said tent doesn't deplete the stock of 1 m4a1 in it.  essentially making it an infinite amount of m4a1s.  Say I want 10 people to be able to join the server.  all 10 get kits from the tent(anything that could hold it all) that includes some people having the same gear.  If those guys died, I would shortly despawn thier corpses and when they respawn, they can get geared up again at the same tent  and so on and so forth.  Same for any other players that join/die on the server.  I want there to be enough equipment that it wouldn't deplete before reboot and I wouldn't have to reboot constantly to keep it stocked.  Thanks for the reply.

Edited by Corpse Eater

Share this post


Link to post
Share on other sites
	TentBase Tent = GetGame().CreateObject("CarTent", player.GetPosition(), false);
	Tent.Pitch();
	Tent.GetInventory().CreateInInventory("M4A1_Black");
	Tent.GetInventory().CreateInInventory("Mag_STANAGCoupled_30Rnd");
	
Edited by ItsRobinson
  • Like 1

Share this post


Link to post
Share on other sites
On 12/8/2018 at 1:45 PM, ItsRobinson said:

	TentBase Tent = GetGame().CreateObject("CarTent", player.GetPosition(), false);
	Tent.Pitch();
	Tent.GetInventory().CreateInInventory("M4A1_Black");
	Tent.GetInventory().CreateInInventory("Mag_STANAGCoupled_30Rnd");
	

It tells me that pitch is undefined when starting the server.  How do I define pitch?  Thank you.

Share this post


Link to post
Share on other sites
58 minutes ago, Corpse Eater said:

It tells me that pitch is undefined when starting the server.  How do I define pitch?  Thank you.

It might be because of where you are calling it.  I used this and it worked.  I did change it from Car tent to the large tent.

TentBase Tent = GetGame().CreateObject("LargeTent", chatPlayer.GetPosition(), false);
							
Tent.Pitch();
Tent.GetInventory().CreateInInventory("M4A1_Black");
Tent.GetInventory().CreateInInventory("Mag_STANAGCoupled_30Rnd");

 

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

×