Jagged Alliance 3

Jagged Alliance 3

Not enough ratings
Demo Revised Mags Submod
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
987.565 KB
12 Apr, 2024 @ 3:44pm
1 Change Note ( view )

Subscribe to download
Demo Revised Mags Submod

Description
A demo mod to make custom weapons and calibers compatible with Revised Mags.

1. Adding Magazine Items

The first thing you have to do is to create "Mag" items. There are also 4 subclasses (PistolMag, RifleMag, SmgMag, LargeMag) which are only used for Revised Tactical gear at the Moment.

Ideally you copy an existing Mag. Unfortunatelly overriding existing Mags is not possible. Maybe this is a limitation with submods. If you need to do so you have to use code.

This fields are important:

  • Define Scrap Parts
  • Make a Mag non repairable
  • Add and Icon (more about the icon later)
  • Add Display Name, Description and Additional Hint
  • Add BobbyRay Properties (tier should match the tier of the weapon and choose one of the category pairs)

This are the Mag specific fields:

  • Platform: Platform is introduced by RM and is used to group weapons together which can use the same mags.
  • MagazineSize: The max number of bullets
  • Caliber: Has to match the weapon's caliber
  • Modification: This is important for the visual appearance of the mag. More about it below
  • Type: Is not used at the moment as it was replaced by subclasses
  • Extra Reload AP: This could be used if it is more time consuming to insert this mag.
  • Mag Reload AP: This are the costs to reload a magazine with bullets
  • Mag Unload AP: This are the costs to remove bullets from a magazine

2. Adding Weapon Components

In the next step you have to add the Weapon Component which is the visual representation of the magazine when loaded.

It is important that you add an icon and that each weapon has it's own entry. If a magazine is shared between two weapons at least the icon should be the same. Ideally the entity is also the same as it is the 3D representation of the magazine.

3. Setting up the Weapons

To setup newly created weapons of override existing ones your have to call the REV_SetupWeapon function.

This function accepts 5 parameters:

  • The WeaponClass (not the name but the class itself without parentheses
  • The Plattform of the weapon (multiple weapons can have the same plattform which enables magazine sharing)
  • The Mag InventoryItem name (with parentheses)
  • The default Modification which should match the modification of the mag
  • A table/array of available modifications

REV_SetupWeapon(HiPower, "HiPower", "BHPMagazine", "MagNormal", {"MagLarge", "MagNormal"})

The function should be called on this hook:

OnMsg.RevisedMagPropsAddedToFirearms

Remarks

At the moment there are no negative effects for large magazines. Extra reload ap for those mags are added via the magazine InventoryItem.
I would recommend to
I did not add finetuned mags as there were not enough icons. I am not sure if they are needed.
I will add quickmags later which will be combine receipes
As you cannot override magazine classes you would probably need a script to transform the old mags or it won't be save game compatible.
9 Comments
Free Lunch 6 Jun, 2024 @ 9:18am 
Hi,
I did the same thing for ToG; thanks a lot for this demo and your tutorial.
Do I need to add the mags to the loot table? Or does RM2 automatically add all avaliable mags to the loot?
permanent666  [author] 1 Jun, 2024 @ 11:28am 
@CharlieChap, just release it as a new mod.
CharlieChap 26 May, 2024 @ 8:41am 
This works well permanent666. I did a version for the guns in Masters Of War.

I would upload it but its your code, Should I upload it and you can change the directory and check it over and maybe make it available ?
permanent666  [author] 8 May, 2024 @ 1:14pm 
I will have a look. It should use Uzi Mags.
benden 6 May, 2024 @ 8:11am 
The Lion's Roar can't be loaded in my game, is it a bug? it would be cool to use Uzi's magazines with this SMG too!
Baka Racker 24 Apr, 2024 @ 5:26pm 
Yeah, I should have clarified I meant Revised Mags II.
Lucjan 15 Apr, 2024 @ 2:58pm 
Revised Mags II... ok I thought you were talking about some mod that adds weapons just like ToG
Lucjan 15 Apr, 2024 @ 2:54pm 
RM2?
Baka Racker 15 Apr, 2024 @ 2:40pm 
Oh, this framework provides serious potential. It'd be rad to see someone make a compat mod for RM2 and TOG, sadly I have neither the time nor the skills to do so. :/