NorthstarLauncher icon indicating copy to clipboard operation
NorthstarLauncher copied to clipboard

Add "Mod Weapon Vars"

Open EladNLG opened this issue 10 months ago • 6 comments

What?

Creates an alternative to weapon mods by allowing overrides of any numeric eWeaponVar through script.

Example

ScriptWeaponVars_SetInt(weapon, eWeaponVar.ammo_clip_size, 50)

Why?

  1. Weapon files need to be downloaded client side to work, and MAD isn't finished yet.
  2. Weapon mods have a 200 "modifications" limit. This has been raised to ~240 through admirable work of others, but will not be enough for larger-scale mods/mods that want to apply a variety of modifiers on a variety of weapons.
  3. Allows setting a variable to a range of values instead of being limited to 32 options (e.g. if you'd want to recreate the nemesis with the current weapon system, you wouldn't be able to because the amount of possible values for its burst delay is effectively infinite, however, this allows such things.)

WIP. Relies on

  • #692

Required before merging

  • [x] Manager for script weapon modifiers
  • [x] System to reapply overrides when weapon vars are recalculated (e.g. after AddMod) (Script PR not existing yet)

Optional

~~- [ ] Auto-sync server changes to client through a remote function~~ ~~- [ ] Add "predicted" versions of functions, that do not transmit to client~~ Decided against autotransmitting changes for a few reasons:

  1. MAD
  2. would be a pain and overcomplicate things imo

[Screenshots/Examples TBD]

EladNLG avatar Apr 24 '24 12:04 EladNLG

while im not able to "review" this because i dont know anything in c++ or such at all i just want to say that his would be an excelent addition, the mod limit is big but still something that can happen. and having the evars modifyable directly via script enables alot more then the current need of switching mods on stuff.

EM4Volts avatar Apr 24 '24 13:04 EM4Volts

PR finally works with prediction - gonna try cleaning up code tomorrow.

Unfortunately, i cannot figure out proper naming for the hooked functions - im just going off of frequency of calls :[

Please help if you can.

EladNLG avatar Apr 26 '24 23:04 EladNLG

Also, do we want to support strings/assets/vectors?

EladNLG avatar Apr 27 '24 18:04 EladNLG

Also, do we want to support strings/assets/vectors?

If it's not that bad, yeah would be nice. Vectors probably the most useful

ASpoonPlaysGames avatar Apr 27 '24 18:04 ASpoonPlaysGames

Uh, for some reason format check is failing now @EladNLG :c

GeckoEidechse avatar Jul 10 '24 13:07 GeckoEidechse

Need to change hook, currently fucks up stuff (causes weird MGL-related crash, probably fucked up params?)

EladNLG avatar Sep 22 '24 21:09 EladNLG