Jump to content

[TESTING] Custom Loadouts


axeman

Recommended Posts

I have a working custom loadout that is ready for testing if anybody fancies giving it a go..?

 

All works from existing DB schema, nothing more required than adding a new entry to existing object_data table, for each player / admin. And updating / re-packaging server_monitor.sqf and server_playerLogin.sqf..

 

Coded for v1.0.1.4 vanilla Epoch..

 

I wouldn't recommend this unless you are happy with trying out new scripts, can package server PBOs and can update your SQL with confidence, as said above, is for testing, no hand holding :)

 

The required fields in DB (object_data) are:

 

Classname: custom_loadout

CharacterID: <the UID of the player you want to apply the loadout to>

Inventory: The custom loadout in this format:

[["weapon1","weapon2","weapon3"],["magazine1","magazine2","magazine3"],["<backpack class name>",[["backpack weapon"],[1]],[["backpack magazine","backpack magazine","backpack magazine"],[1,1,1]]],"<Player skin class>"]

EG:

[["ItemFlashlight","ItemKnife","revolver_EP1","ItemMatchbox","ItemMap"],["ItemPainkiller","PartWheel","ItemHeatPack","FoodCanFrankBeans","ItemMorphine","ItemJerrycanEmpty","ItemAntibiotic"],["DZ_CivilBackpack_EP1",[["ItemToolbox"],[1]],[["ItemPainkiller","PartWheel","ItemHeatPack","FoodCanFrankBeans","ItemMorphine","ItemJerrycanEmpty","ItemAntibiotic"],[1,1,1,2,2,3,2]]],"Soldier1_DZ"]

Get the DB entry wrong and you will see errors when trying to join the game..

 

Example SQL for loadout:

INSERT INTO `object_data` VALUES (561,98368222451168,11,'custom_loadout','2013-07-07 20:47:32',23393798,'[0,[0,0,0]]','[[\"ItemFlashlight\",\"ItemKnife\",\"revolver_EP1\",\"ItemMatchbox\",\"ItemMap\"],[\"ItemPainkiller\",\"PartWheel\",\"ItemHeatPack\",\"FoodCanFrankBeans\",\"ItemMorphine\",\"ItemJerrycanEmpty\",\"ItemAntibiotic\"],[\"DZ_CivilBackpack_EP1\",[[\"ItemToolbox\"],[1]],[[\"ItemPainkiller\",\"PartWheel\",\"ItemHeatPack\",\"FoodCanFrankBeans\",\"ItemMorphine\",\"ItemJerrycanEmpty\",\"ItemAntibiotic\"],[1,1,1,2,2,3,2]]],\"Soldier1_DZ\"]','[]',0.00000,0.00000);

EDIT: Not tested yet on 1.0.1.5

 

Enjoy..

epoch_1014_custom_loadouts.zip

Link to comment
Share on other sites

Please make sure this is a test environment guys and gals!

 

If you run the .sql provided it will rewrite your object_data table? 

 

DROP TABLE IF EXISTS `object_data`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `object_data` 
 
Sorry if I am wildly incorrect still learning SQL...
Link to comment
Share on other sites

Oops. Well spotted. I just took the backup and edited the fields. . Yeh be careful running that sql it will drop the existing table. That would be bad. .

Am out now but will update that sql later to just do an update to the table object_data..

Link to comment
Share on other sites

Basically server_monitor.sqf parses the custom_loadout field and adds it to a server variable, tagged with the player uid.

When logging in, server_playerlogin. sqf checks the player uid and if it finds a match enters in the loadout.

As said. It is very much in testing..

Oh Yeh, also. The custom backpack is dropped at your feet when you start..

Link to comment
Share on other sites

  • 3 weeks later...
  • 3 weeks later...
  • 1 month later...

I knew this thread would be found sooner or later ;)

No reason why this would not still work if edited properly. Would like to make the backpack handling a bit better and format the overall inventory so that it can be copied and pasted in from existing inventory..

Will pick this up in a week or so and finish it for the next version..

Starting my stag do tomorrow so may well be out of it for a few days to a week. feel free to ignore any posts from me, late at night, over the next week ;)

Link to comment
Share on other sites

I knew this thread would be found sooner or later ;)

No reason why this would not still work if edited properly. Would like to make the backpack handling a bit better and format the overall inventory so that it can be copied and pasted in from existing inventory..

Will pick this up in a week or so and finish it for the next version..

Starting my stag do tomorrow so may well be out of it for a few days to a week. feel free to ignore any posts from me, late at night, over the next week ;)

 

Sounds good. I tried making the changes that I saw in the two included files, but on my test server I kept spawning in the debug, so I probably missed something.

Link to comment
Share on other sites

Try just adding the players inventory. Backpacks are formatted 'oddly'. I got it working and even then a new backpack would appear at your feet, wasn't all that happy with the outcome, pretty sure I can replace the backpack is just making sure it is done in the right place when loading..

 

Most likely the format of the inventory or backpack is not quite right, this will send you to debug or just give a 'something went wrong' error and you'll get stuck until the database is edited again..

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Discord

×
×
  • Create New...