Skip to content

[READ!] Major Update Information

WuBoytH edited this page Oct 23, 2026 · 4 revisions

Smashline is about to hit 2.0.0, bringing a great deal of changes to how weapon cloning is handled. An update this big will naturally make older plugins incompatible, but I promise the updates are worth it.

This page is meant to help inform users on what has changed. Please read the following and determine if you need to update your plugin or not.

If your plugin doesn't touch anything listed below, there shouldn't be a need to update, but test for yourself first.

Crashes

clone_weapon

The function signature for clone_weapon has changed. Plugins that use the old clone_weapon definition will CRASH if the latest smashline plugin is being used.

Old:

let generate_id_add = clone_weapon(
    "mario", // Original Article Owner
    *WEAPON_KIND_MARIO_FIREBALL, // Original Article ID
    "sonic", // Cloned Article Owner
    "fireball", // Cloned Article Name
    true // Use Original ACMD/Status Scripts
);
// clone_weapon returned generate_id_add, which you were meant to handle yourself... it was a mess.

New:

let fireball = clone_weapon(
    "sonic", // Cloned Article Owner
    "fireball", // Cloned Article Name,
    *WEAPON_KIND_MARIO_FIREBALL, // Original Article ID
    true // Use Original ACMD/Status Scripts
);
// clone_weapon now returns a CloneWeapon struct, containing the exact weapon_id and
// generate_id - no more doing math yourself.

update_weapon_count

The function signature for update_weapon_count has changed. Plugins that use the old update_weapon_count definition will CRASH if the latest smashline plugin is being used.

Old:

update_weapon_count(
    *WEAPON_KIND_MARIO_FIREBALL, // Article ID
    10 // New Max Article Count
);

New:

update_weapon_count(
    *FIGHTER_KIND_MARIO, // Fighter ID
    *FIGHTER_MARIO_GENERATE_ARTICLE_FIREBALL, // Generate Article ID
    10 // New Max Article Count
);

Behavior Changes

Generally, due to how large this rework to weapon cloning was, it will be natural that some things may behave differently than before. I wanted to specifically note down a few instances of safeguards that have been added to this version:

Using Original Code

Setting use_original_code to false will now disable param remapping. This means it will be on the end user to rewrite all calls to the article's params manually.

Conversely, setting use_original_code to true will now show a warning, depending on the situation:

  • Cloning multiple of the same article onto a single fighter.
    • Ex. 1: Cloning WEAPON_KIND_MARIO_FIREBALL onto Mario, with use_original_code set to true.
    • Ex. 2: Cloning WEAPON_KIND_MARIO_FIREBALL onto Sonic twice, with different names, with either having use_original_code set to true.
  • Cloning a weapon onto a fighter if the fighter has an article with the same name.
    • Ex. Attemping to clone WEAPON_KIND_LUIGI_FIREBALL onto Mario, who already has an article called fireball.

This causes issues with how smashline handles the cloned weapon's params. It is not recommended to set use_original_code to true for publically released movesets for this reason.

Fighter or Weapon Vtable Functions

If you manually patch a vtable function, I would strongly recommend updating your plugin to use the newly added replace_fighter_vtable or replace_weapon_vtable.

These have been added so that you can replace a vtable function without modifying any of the original vtables in memory. This is doubly important since I've added get_original_fighter_vtable and get_original_weapon_vtable, which is meant to return the unmodified function.

For slotted fighters, replace_fighter_vtable_costume is available.

replace_fighter_vtable(
    *FIGHTER_KIND_RICHTER, // Fighter ID
    FighterVtableSlot::OnFrame5, // Vtable Slot
    richter_on_frame_5 as *const () as usize // Vtable Function, converted to usize
);
replace_fighter_vtable(
    *WEAPON_KIND_RICHTER_CROSS, // Weapon ID
    WeaponVtableSlot::WeaponOnAttackMask, // Vtable Slot
    richter_cross_on_hit as *const () as usize // Vtable Function, converted to usize
);

Enabling Modules for Weapons

If you manually patch the table that holds each weapon's ____Module vtable pointers, I would strongly recommend updating your plugin to use the newly added enable_weapon_module.

This is so that other cloned weapons, which will get the original weapon's module vtable pointers as a base, do not get patched as well.

enable_weapon_module(*WEAPON_KIND_EDGE_FLASH, WeaponModule::Search);

whitelist_kirby_copy_article

The definition for whitelist_kirby_copy_article hasn't changed, but the expected inputs have. This has the potential to crash, and will be considered undefined or unintended behavior if you do not update.

Old:

whitelist_kirby_copy_article(
    *FIGHTER_KIND_RICHTER, // Fighter ID
    *WEAPON_KIND_RICHTER_CROSS // Weapon ID
);

New:

whitelist_kirby_copy_article(
    *FIGHTER_KIND_RICHTER, // Fighter ID,
    *FIGHTER_RICHTER_GENERATE_ARTICLE_CROSS // Generate Article ID
);

Clone this wiki locally