Jump to content

Can one script weapon base damage?


Moraelin

Recommended Posts

Well, my problem is as follows -- in case I'm missing a more obvious solution -- on one hand, I like having the items I'm making still be fairly powerful, or at least competitive, by the end of the game. On the other hand, I like to have them fairly early in the game, because, well, if I make a weapon available only right before meeting the Legate or whatever end boss, then most people won't even see it. And on the third hand, I really can't be bothered to make enough weapons in a thematic category (e.g., "rusty SW blasters" or "shiny lasers") to populate all levels with increasingly powerful versions.

 

So that creates a bit of a problem. A weapon that is even vaguely competitive with endgame weaponry, will be hideously overpowered if you find it outside Vault 101 or Doc Mitchell's home at level 1. Conversely, a weapon that is balanced against Sunny's rusty hunting rifle, will probably be beyond useles by the time you even get to New Vegas.

 

I really have no good solution to that.

 

I keep telling people to just change it in the GECK themselves if they disagree, but that's also not a very good solution. Most users probably don't want to be modders.

 

So now I get this idea: would it be possible to have a weapon's damage be something like 10 + (user_level / 2) and level up with the user? How would one script that? Preferably without script extenders, if possible, since I'd like to keep dependencies to a minimum.

Link to comment
Share on other sites

I believe so, at least it can be done in Oblivion. Still, like for the reach (for melee at least) re-equipping the weapon may be necessary. Since I don't know how it works for Fallout and have not dabbled with FOSE/OBSE for a long time, you should research that information deeper.

 

Edit: reviewing my script, the speed and reach are what need re-equipping, the damage is set (in oblivion) by:

 

RefID.SetAttackDamage

 

Notice you need the reference ID and not the BaseID. The script can create a ref variable and then use the command to get it's refid:

 

ref     MyWeaponRef
float   MyDamage
.
.
.Begin GameMode
set MyWeaponRef to player.GetEquippedObject 16
.
.
; calculate the damage you want to apply, lets say you store it in a variable MyDamage

MyWeaponRef.SetAttackDamage MyDamage
.

 

The value 16 there is not the same for Fallout, check it on the wiki. You can use that test to grant the equipped weapon is yours.

Edited by nosisab
Link to comment
Share on other sites

  • 1 month later...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...