Jump to content
Zillano

Anyway to make weapons spawn with magazines around them?

Recommended Posts

Hello, I'm a server owner and have been trting to recreate the old arma 2 dayz vibe. I miss how back then guns would spawn with maybe 1-3 mags of ammo along with the guns themselves when they spawn. Now I understand that the loot is coded differently and doesn't really have a pool but would anyone know how to add a additional spawn parameter for mags to spawn around the guns and such? I have tried and poked around with a couple different options such as <spawnwith> and mucking about in the spawnabletypes but have had no luck in getting the mags to show when the gun spawns. Thanks for any and all information! -- Mike

Share this post


Link to post
Share on other sites

I think there's only one approach it's called 'direct'. Basic loot spawn system is not considering spawn 'loot stack'. You need to create custom mod (or server mod) that shall override the loot spawn mechanics.

Also you need to explore EntityAI.c that file contains methods for checking item for example EntityAI.IsWeapon(), then you may cast EntityAI -> WeaponBase and check does it has magazine(s) and create function for spawn mags near the object, but also don't forget that we have 3 different logic of firearms in the game:

1. Firearm with Mag (AR15s, AUGs, AKs..)

2. Firearm with Internal Mag (SKS, Mosin91/30, Winchester 70...)

3. Revolvers (has multiple barrels (based on game logic), each barrel has 1 chamber for cartridge) and double barrel shotguns.

So for 2nd and 3rd cases you can spawn nearby the ammo stacks or ammo packs.

 

But as I said b4 current loot spawn system not allowing to preset spawn of pile (2 or more items) on the same spot.

  • Like 1

Share this post


Link to post
Share on other sites

Sorry but I have to use Google Translate.

I don't quite understand... do you want to have the weapons generated with the magazines and ammunition already inserted inside?

Or have the magazines and ammunition generated around but not already inside the weapon?

  • Like 1

Share this post


Link to post
Share on other sites
On 1/4/2025 at 12:19 AM, Riddick_2K said:

Sorry but I have to use Google Translate.

I don't quite understand... do you want to have the weapons generated with the magazines and ammunition already inserted inside?

Or have the magazines and ammunition generated around but not already inside the weapon?

If you didn't played in DayZ Mod (DZM) I'll tell you that firearms in DZM spawned with mags nearby. Like one AKM and 1 - 5 mags nearby that AKM. Player wants to recreate the same stuff in current DayZSA and asked for the help about how can he do it. (He'd expected that's DZSA loot spawn system is the same like it was in DZM).

Actually it's not cares will mag be attached or deattached (it's the matter of spawn behavior and taste of server's admin).

 

I think that's an interesting idea for implantation and at the base base it can be extended. For example not simply spawn the mags in a pile around firearm but also some ammunition and let player charge the mags. Or even try to change logic to randomization of item behavior like in one spawn you may find AKM with 2 mags, on next spawn AKM with several ammo piles and so on and on.

I hope that you can understand what do I mean 🙂

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites
On 1/3/2025 at 6:03 AM, Sid Debian said:

I think there's only one approach it's called 'direct'. Basic loot spawn system is not considering spawn 'loot stack'. You need to create custom mod (or server mod) that shall override the loot spawn mechanics.

Also you need to explore EntityAI.c that file contains methods for checking item for example EntityAI.IsWeapon(), then you may cast EntityAI -> WeaponBase and check does it has magazine(s) and create function for spawn mags near the object, but also don't forget that we have 3 different logic of firearms in the game:

1. Firearm with Mag (AR15s, AUGs, AKs..)

2. Firearm with Internal Mag (SKS, Mosin91/30, Winchester 70...)

3. Revolvers (has multiple barrels (based on game logic), each barrel has 1 chamber for cartridge) and double barrel shotguns.

So for 2nd and 3rd cases you can spawn nearby the ammo stacks or ammo packs.

 

But as I said b4 current loot spawn system not allowing to preset spawn of pile (2 or more items) on the same spot.

This! Bro thank you so much! Like I've been screaming across google trying to find what it was for a direction of where to start mucking about in the code. I'll be doing some dives and seeing what I can come up with, Truly! Thanks so much for the speedy and informative reply. Hope yinz had a great new year!

Share this post


Link to post
Share on other sites
22 hours ago, Sid Debian said:

If you didn't played in DayZ Mod (DZM) I'll tell you that firearms in DZM spawned with mags nearby. Like one AKM and 1 - 5 mags nearby that AKM. Player wants to recreate the same stuff in current DayZSA and asked for the help about how can he do it. (He'd expected that's DZSA loot spawn system is the same like it was in DZM).

Actually it's not cares will mag be attached or deattached (it's the matter of spawn behavior and taste of server's admin).

 

I think that's an interesting idea for implantation and at the base base it can be extended. For example not simply spawn the mags in a pile around firearm but also some ammunition and let player charge the mags. Or even try to change logic to randomization of item behavior like in one spawn you may find AKM with 2 mags, on next spawn AKM with several ammo piles and so on and on.

I hope that you can understand what do I mean 🙂

This guy really gets it goddamn! Truly yall are so cool and yep thats exactly what I'm thinking. A more dynamic loot pool so people in my server just feel more attached to the world! 

Share this post


Link to post
Share on other sites
3 hours ago, Zillano said:

This guy really gets it goddamn! Truly yall are so cool and yep thats exactly what I'm thinking. A more dynamic loot pool so people in my server just feel more attached to the world! 

You know I'd digged yesterday (by my timezone) scripts.pbo and didn't reached how loot spawn system works. Maybe bit later I'll try to search with other ways to reach the understanding coz that theme is quite interesting to me too. But yet no luck with it, anyway I think it shall be something quite simple and obvious but I didn't reach it yet xD

Share this post


Link to post
Share on other sites
6 hours ago, Sid Debian said:

You know I'd digged yesterday (by my timezone) scripts.pbo and didn't reached how loot spawn system works. Maybe bit later I'll try to search with other ways to reach the understanding coz that theme is quite interesting to me too. But yet no luck with it, anyway I think it shall be something quite simple and obvious but I didn't reach it yet xD

No worries at all and I really appreciate it! I am working with Inclement Dab as of late and I'll run it by him aswell see if hes got any idea of what would be a way of overriding or just how it works in general. If he knows anything I'll repost it to here too. I'll poke around a bit tonight at work and see what I can figure but I think you got the right idea with doing a type of override, I've tried a good chunk of different things, tho getting deep in the PBOs is not one of them.

Share this post


Link to post
Share on other sites
2 hours ago, Zillano said:

No worries at all and I really appreciate it! I am working with Inclement Dab as of late and I'll run it by him aswell see if hes got any idea of what would be a way of overriding or just how it works in general. If he knows anything I'll repost it to here too. I'll poke around a bit tonight at work and see what I can figure but I think you got the right idea with doing a type of override, I've tried a good chunk of different things, tho getting deep in the PBOs is not one of them.

Yet only one PBO contains all scripts and (open/visible) mechanics of the game is the DayZ\dta\scripts.pbo, any other PBO is only the wrapper around that addon, also theres hodden mechanics it's already codebase of DayZ.exe.

But need to find how loot spawn machine is working in the game (callbacks and base classes) amd try to exted them, then extend configuration of loot spawn machine (allow admins edit propertues of machine and implement custom types), like spawn with AKM only 30 rnd mags or only 75 rnd mags, or random, or only ammo and etc for each class for implementation of better randomization.

Yet with spawnabletypes.xml you can configure to spawn weapons with different loadouts, same as implement only one attached magazine of prefered types (dummy but works).

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

×