Multiple Use Item Actions

I’m trying to make a mod that will involve a complicated crafting tree similar to that one lightsaber mod. Except the crafting tree will be for a suit of armor instead of a weapon. I want to give the armor multiple holsters for gun, grenades, magazines, etc. and other things.

However, I can’t seem to understand the syntax for doing this. If this is even a thing that can be done in the first place. The code I have for it goes like this:

"use_action": [ { "type": "holster", "max_volume": 10, "draw_cost": 150, "skills": [ "smg", "shotgun", "rifle", "launcher" ] },
{"type": "holster",
   "holster_prompt": "Stash grenades",
   "holster_msg": "You stash your %s.",
   "multi": 4,
   "max_volume": "750 ml",
   "draw_cost": 30,
   "flags": [ "GRENADE" ]
 },
 { "type": "holster",
   "holster_prompt": "Stash ammo",
   "holster_msg": "You stash your %s.",
   "multi": 4,
   "max_volume": "500 ml",
   "draw_cost": 30,
   "flags": [ "MAG_COMPACT" ]
 } ],
 "flags": [

use triple ticks: ``` to surround your text.

That unfucked the post. Thank you.

One of the enchanted belts in Magiclysm has this:

"use_action": [
   {
     "type": "holster",
     "holster_prompt": "Sheath blade",
     "holster_msg": "You sheath your %s"
   },
   "CROWBAR"
 ],

so it looks like you should be correct on the syntax. What errors/issues are you seeing when you try it in the game?

I got the game to load. Apparently the syntax error crashing it had nothing to do with the specific pocket thing and it was such a simple error that I can only imagine I must truly be the Big Dumb.

However, still have a problem with this specific mod idea. I load it up and spawn in the item to test. I can only use the gun holster. Can’t access the magazine or grenade pouches at all.

Development is tricky and even experienced developers make simple mistakes. Don’t beat yourself up over making an error when you get started. Try to learn from it.

My next suggestion would be to add a different type of use_action, like CROWBAR, and see if that works.

1 Like

Oh, no. I wasn’t taking it anywhere near that hard. I was just being lazy and wanted to say what the real error was in a succinct way jokingly. Instead of writing out the whole thing, which was a super common mistake, anyway.

You mean like separating the holster actions with non-holster actions like crowbar to see if it’ll accept multiple holsters, then?

I’d try that at least.

Oh yeah, I know that feeling.
Programming in a Nutshell
Some days I might just as well hit compile and flip a coin.

1 Like