Mega Man 8-bit Deathmatch > Projects & Creative

Modular Weapons - Concluded Tech Demo

(1/3) > >>

Trillster:
(click to show/hide)
Modular Weapons - A Successful Test

Modular Weapons was a tech demo for the systems now implemented as part of Mega Man 8-Bit Deathmatch V6B. It showed that there was interest and feasibility to a setup that promoted compatibility between mods and it also helped us gauge what modders might be interested in if a system like this would be put into place, such as weapons that gain two types of ammo, means to do custom styled bars, and even further expanded systems to add and randomize new assist items.

As a result, however, this thread is now no longer needed, because the packs built for Modular Weapons are out of date and will be deprecated in favor of updating those mods for Version 6B of MM8BDM. Its legacy will live on, however, as you can now randomize all sorts of pickups in base Mega Man 8-Bit Deathmatch, so be sure to check out the new Version 6B wiki along with its documentation and server settings pages. Make sure to check the relevant threads later for weapon packs that'll be updated for Version 6B!

Visit the Wiki!

(click to show/hide)So weapon packs are pretty cool right? I'm sure we've all got some fond memories of playing with the RNC expansion or Ukiweps. What's not cool is how the upkeep on them kinda sucks. Every MM8BDM update breaks them, requiring rebuilding of some fundamental parts of the weapon pack to fix. Not only that, but trying to load other weapon packs with each other is a surefire way to break them, unless specifically designed for. While it was workable in the past, it's not ideal, because it leads to patch file after patch file. Inspired by Jax's old Expand8BDM methods, Modular Weapons fixes that. It allows modders to design their weapon packs in a way that not only allows them to be MM8BDM update-proof, but also so that weapon packs can be hosted together, perfectly functional.

Randomizer Mode

Weapons loading together doesn't do much good without a method of getting them out into maps and into the hands of players, so that's what this part of the mod is for. Randomizer uses the modular weapon definition method to be able to replace every weapon and buster upgrade pickup with another weapon of its same type. So if you load Rockman No Constancy weapons with Randomizer, you can expect to see some Wind Slicer in the place of Air Shooter and other close weapons. Same with Circuit Breaker and rapid weapons. Load both of the wads together in any order, and you get chances for both of those to happen at once. This mode even adds in whatever extra weapons are loaded into the respective Last Man Standing pools, so you can expect to see some custom weapons in your loadout.

Modder Notes

This section won't apply to everyone and it's gonna be LENGTHY, so have a spoiler.
(click to show/hide)
--- Quote ---Modular Weapons works with an import method, meaning for each type of definition you might need to give a weapon or item, you must have the source file from the Randomizer file for that respective definition in your weapon pack. However, you DON'T need to compile this file, and you SHOULD NOT compile it, only the files exclusive to your mod.

For example, to define a weapon's ammo and allow it to be valid for Randomizer and LMS modes, you must have the 8bdmamo.acs source file in your pack, alongside a new script file that looks like this,


--- Quote from: TESTAMMO.ACS ---#library "testammo"
#include "zcommon.acs"

#import "8bdmamo.acs"

//  0 - Weapon Name according to the Engine (Ex. RollingCutterWep)
//  1 - Weapon Ammo according to the Engine (Ex. RollingCutterAmmo)
//  2 - Weapon Name according to the Player (Ex. Rolling Cutter)
//  3 - Ammo gain multiplier (0.0 - 1.0)
//  4 - Can be given by Eddie? (YES/NO)
//  5 - Can be Stolen by Reggae? (YES/NO) [NO LONGER USED]
//  6 - LMS Slot

Script "test_ammo" OPEN
{
Delay(1);

// Defines a weapon valid for both Randomizer and LMS, in SLOT_RANGED
defineWeapon("AwesomeBeamWep","AwesomeBeamAmmo","Awesome Beam", 1.0, "YES", "YES", "SLOT_RANGED");

// Defines a weapon valid for Randomizer but not LMS because it is SLOT_NONE
defineWeapon("AwesomeBreakerWep","AwesomeBreakerAmmo","Awesome Breaker", 1.0, "YES", "YES", "SLOT_NONE");

// Defines a weapon that's not valid for Randomizer or LMS, because it has NO for Eddie and SLOT_NONE, however it still is defined so it can pick up ammo!
defineWeapon("DawnBreakerWep","DawnBreakerAmmo","Dawn Breaker", 1.0, "NO", "NO", "SLOT_NONE");

// Defines a weapon that's exclusive to Eddie, because it has YES for him, and a slot that is not checked for by Randomizer or LMS
defineWeapon("EddieSpecialWep","EddieSpecialAmmo","Eddie Special", 1.0, "YES", "YES", "SLOT_EDDIE");
}

--- End quote ---

To define a new buster upgrade, you must have the 8bdmbus.acs source file in your pack, alongside a new script file that looks like this,


--- Quote from: TESTBUST.acs ---#library "testbust"
#include "zcommon.acs"

#import "8bdmbus.acs"

//  0 - Buster Upgrade Pickup according to the Engine. Used for Randomizer spawns (Ex. ProtoUpgrade)
//  1 - Buster Upgrade Weapon according to the Engine. Used when another buster upgrade is used to ensure it is taken properly. (Ex. ProtoBuster)

Script "test_busters" OPEN
{
Delay(1);

// Defines a new buster upgrade with pickup name AwesomeBusterUpgrade and weapon name AwesomeBuster
defineBusterUpgrade("AwesomeBusterUpgrade","AwesomeBuster");
}

--- End quote ---

Make sure that your buster upgrade's code looks something like this so that it'll properly work with other buster upgrades in play.


--- Quote from: AwesomeBuster.txt ---actor AwesomeBusterUpgrade : BaseMM8BDMUseItem
{
Inventory.RespawnTics 350
inventory.amount 1
inventory.maxamount 1
inventory.pickupmessage "$PU_AWESOMEBUSTER"
Tag "$TAG_AWESOMEBUSTERUPGRADE"
inventory.icon "RNCWP9"
Inventory.PickupSound "item/1up"
scale 2.0
+COUNTITEM
+INVBAR
states
{
SpawnLoop:
WEAP X 1
loop
Use:
TRBB I 0 A_PlaySoundEx("item/refill","Voice")
TRBB I 0 A_GiveInventory("BusterGiven",1)
TRBB I 0 A_GiveInventory("AwesomeBuster",1)
TRBB I 0 A_SelectWeapon("AwesomeBuster")
stop
}
}

Actor AwesomeBuster : MegaBuster
{
Tag "$TAG_AWESOMEBUSTER"
Obituary "$OB_AWESOMEBUSTER"
Inventory.Pickupmessage "$PU_AWESOMEBUSTER"
States
{
Ready:
NCH1 A 0 A_JumpIfInventory("BusterGiven",1,"TakeBusters")
Goto Ready2
TakeBusters:
NCH1 A 0 A_GiveInventory("TakeBuster", 1)
Goto Ready2
Ready2:
NCH1 A 0 ACS_ExecuteAlways(998,0,COL_AWESOMEBUSTER)
NCH1 A 1 A_WeaponReady
Goto Ready2+1
...

--- End quote ---

To define a new bar that should be shown, you must have the 8bdmhud.acs source file in your pack, alongside a new script file that looks like this,


--- Quote from: TESTHUD.acs ---#library "testhudd"
#include "zcommon.acs"

#import "8bdmhud.acs"

// defineWeaponHud()
// 0 - Weapon Name according to the Engine (Ex. CircuitBreakerWep)
// 1 - Ammo Name according to the Engine (Ex. CircuitBreakerAmmo)
// 2 - Max amount of ammo (Ex. 28)
// 3 - Item to check for to show a flashing bar according to the Engine (Ex. WeaponCharge)
// 4 - Threshold of item needed to show the flashing bar (Ex. 40)
// 5 - Item to check for to show a darkened bar according to the Engine (Ex. SkullBarrierCooldown)
// 6 - Threshold of item needed to show the darkened bar (Ex. 1)
// 7 - Item to check for to show an overlaid bar (Ex. OilSliderFlag)
// 8 - Max amount of that item (Ex. 30)
// 9 - Cyan color of secondary bar (Ex. 4)
// 10 - Blue color of secondary bar (Ex. 128)

// defineDoubleWeaponHud()
// 0 - defineWeaponHud() call including all of its arguments (Ex. defineWeaponHUD("DualAssaultRifleWep", "AssaultRifleAmmo",200,"",0,"",0,"",0,4,128))
// 1 - Secondary Ammo Name according to the Engine (Ex. CircuitBreakerAmmo)
// 2 - Max amount of secondary ammo (Ex. 28)
// 3 - Secondary Item to check for to show a flashing bar according to the Engine (Ex. WeaponCharge)
// 4 - Threshold of secondary item needed to show the flashing bar (Ex. 40)
// 5 - Secondary Item to check for to show a darkened bar according to the Engine (Ex. SkullBarrierCooldown)
// 6 - Threshold of secondary item needed to show the darkened bar (Ex. 1)
// 7 - Secondary Item to check for to show an overlaid bar (Ex. OilSliderFlag)
// 8 - Max amount of that secondary item (Ex. 30)
// 9 - Cyan color of secondary bar (Ex. 4)
// 10 - Blue color of secondary bar (Ex. 128)

Script "test_huds" OPEN CLIENTSIDE
{
Delay(1);

// Defines a bar colored with translation (192,197) for Skull Barrier that darkens the bar whenever the user has 1 SkullBarrierCooldown
defineWeaponHUD("SkullBarrierWep", "SkullBarrierAmmo",28,"",0,"SkullBarrierCooldown",1,"",0,192,197);

// Defines a bar colored with translation (7,227) for Crypt Cloak that flashes whenever the user has 1 CloakedCheck
defineWeaponHUD("CryptCloakWep", "CryptCloakAmmo",108,"CloakedCheck",1,"",0,"",0,7,227);

// Defines a bar colored with translation (4,198) for Charade Clone that overlays another bar when the user has up to 125 CharadeCloneCharge
defineWeaponHUD("CharadeCloneWep", "CharadeCloneAmmo",28,"",0,"",0,"CharadeCloneCharge",125,4,198);

// Defines a double bar setup for DualAssaultRifleWep that colors the first bar with translation (4, 128) and the second bar with (4, 222)
// The first bar is drawn using AssaultRifleAmmo up to 200, and the second bar is drawn using GrenadeAmmo up to 16
defineDoubleWeaponHUD(defineWeaponHUD("DualAssaultRifleWep", "AssaultRifleAmmo",200,"",0,"",0,"",0,4,128),"GrenadeAmmo",16,"",0,"",0,"",0,4,222);
}

--- End quote ---

For some weapons or statuses, you might want to show a bar overlaid onto the HP bar. To do this, you'll need 8bdmhlth.acs in your file alongside a new script file such as this,


--- Quote from: TESTHLTH.acs ---#library "testhlth"
#include "zcommon.acs"

#import "8bdmhlth.acs"

// 0 - Inventory Name according to the Engine (Ex: PlantWeakener)
// 1 - Number of defined slot to use. Max of 50, min of 1. Be careful on the slot you choose, as you can override other mods! (Ex: 32)
// 2 - Max amount of item. If you enter 0 in this field, it will draw your overlay as if the user's HP is the max amount of the item.
//      Entering less than 0 will give an offset max relative to the user's HP. (Ex. 1)

Script "test_health" OPEN CLIENTSIDE
{
Delay(1);

// This definition defines a slot for SkullShieldCheck, that will draw bar 41 up to 105 SkullShieldCheck.
defineHealthHUD("SkullShieldCheck", 41, 105);

// This definition defines a slot for VirusTime, that will draw bar 42 based off of how much HP the user currently has.
defineHealthHUD("VirusTime", 42, 0);

// This definition defines a slot for PlantWeakener, that will draw bar 43 based off of how much HP the user currently has, plus 1.
defineHealthHUD("PlantWeakener", 43, -1);
}

--- End quote ---

Now that you've selected a slot for your HP overlays to use, go into TEXTURES to create the bars for them. You can also just do this by including graphics in your file in the form of sprites, but this saves some extra file size. Vertical bars use the naming scheme BRHLTXXX whereas horizontal bars use VRHLTXXX. Again, make sure that the slot you've chosen isn't going to encroach on someone else's bars or work!


--- Quote from: TEXTURES.BARS ---// These three definitions define the bars for slot 41, 42, and 43 as defined in ACS just before.
texture BRHLT041, 8, 56{patch BARENERG, 0, 0 {translation "192:192=192:192", "198:198=197:197"}} //Skull Shield Check
texture BRHLT042, 8, 56{patch BARENERG, 0, 0 {translation "192:192=4:4", "198:198=104:104"}} //Virus Time
texture BRHLT043, 8, 56{patch BARENERG, 0, 0 {translation "192:192=4:4", "198:198=104:104"}} //Plant Weakener

// These three are just to make sure bars exist for people using horizontal bars
texture VRHLT041, 56, 8{patch BRHLT041, 0, 0 {rotate 90}} //Skull Shield Check
texture VRHLT042, 56, 8{patch BRHLT042, 0, 0 {rotate 90}} //Virus Time
texture VRHLT043, 56, 8{patch BRHLT043, 0, 0 {rotate 90}} //Plant Weakener

--- End quote ---

Pain states are handled in a similar way, there's 50 defined slots for modders to make use via replacing. So if you want to add pain states, think of the slot from 1-50 that you'll want to claim for your mod. Once again, make sure to scout around for what other mods are using so that you don't accidentally break their work. When you find the slot you want, go into "actors/player/mod" in the Randomizer pk3, and copy the respective MegamanPain file. Include that MegamanPain file in your own weapon pack in that same folder directory of "actors/player/mod" You won't need to include this file using DECORATE because it will just be replacing the file already included in Randomizer. It'll end up looking something like this,


--- Quote from: MegamanPain41.txt ---actor MegamanPain41 : MegamanPain40 //InspiretroidMega
{
States
{
Pain.AnnihilatorBeam:
PLY1 H 0
goto Pain+1
Pain.LightBeam:
PLY1 H 0 A_GiveInventory("LightBeamProtect", 1)
Goto Pain
Pain.DarkBeam:
PLY1 H 0 A_ScaleVelocity(0.9)
goto Pain+1
}
}

--- End quote ---

Last but not least, you can define the translations that you want your weapons to use in its own separate file that'll look something like this.


--- Quote from: TESTTRNS.acs ---#library "testtrns"
#include "zcommon.acs"

#DEFINE SOMPMISL 3340
#DEFINE LIGHTBEAM 3341
#DEFINE DARKBEAM 3342
#DEFINE ANNIHILATORBEAM 3343

Script "test_translations" OPEN CLIENTSIDE
{
Delay(25);
CreateTranslation (SOMPMISL, 192:192=4:4, 198:198=107:107);
CreateTranslation (LIGHTBEAM, 192:192=4:4, 198:198=88:88);
CreateTranslation (DARKBEAM, 192:192=88:88, 198:198=31:31);
CreateTranslation (ANNIHILATORBEAM, 192:192=93:93, 198:198=78:78);
}

--- End quote ---

It's certainly a long process, but as long as you do it well, it means that you'll be on your way to having a weapon pack that's compatible and functional with everyone else's, and that's fun for everyone involved.

--- End quote ---

Download Here!

For any inquiries or feedback, you can contact me on Discord at Trillster#2887

Trillster:
Here are the weapon packs that have been updated to MM8BDM Version 6B!

Mega Man Rock Force

Rockman No Constancy

Megaman DOS Reborn

Legacy Downloads - Incompatible with Version 6B and requires Modular Weapons:
(click to show/hide)Megaman 6 Rush Adaptors

Contains : (click to show/hide)
--- Quote ---Jet Adaptor
Power Adaptor
--- End quote ---

Modder Notes: (click to show/hide)
--- Quote ---- Takes translation numbers 3250-3254
- Takes pain state slot 6
--- End quote ---

Download Here!

----------------------------------------------------------------------

Rockman and Forte 2

Contains : (click to show/hide)
--- Quote ---Barrier Wind
Compass Needle
--- End quote ---

Modder Notes: (click to show/hide)
--- Quote ---- Takes translation numbers 2000-2001
--- End quote ---

Download Here!

----------------------------------------------------------------------

Inspiretroid

Contains : (click to show/hide)
--- Quote ---Super Missile
Light Beam
Dark Beam
Annihilator Beam
--- End quote ---

Modder Notes: (click to show/hide)
--- Quote ---- Takes translation numbers 3340-3343
- Takes pain state slot 41
--- End quote ---

Download Here!

supersmashgaming:
Can any weapon mods work with this? Like Jax's Mega Man Unlimited Weapons.

Trillster:
Only weapon mods that are made compatible with this new system, such as the ones I've updated in my second post. However, as shown by those weapon mods, the system is robust enough to support anything that you might want to do in a weapon mod.

Trillster:
Here's an updated version of Modular Weapons that fixes up some backend stuff. No requirement to update for side mods.

https://allfearthesentinel.net/zandronum/download.php?file=mweps-randomizer-v6.pk3

Navigation

[0] Message Index

[#] Next page

Go to full version