Jump to content

NVSE scripting question


Xilandro

Recommended Posts

Hello. I'm sorry, but i need some scripting help =\ I'm trying to make a counter how many ammo clips are left in the player's inventory for equipped weapon (like stimpak counter here http://newvegas.nexusmods.com/mods/49566/?)

And the question is: how can i get the clip number in the player's inventory? As i understand it's something like "ammo count in player's inventory / rounds in clip = clip number"

NVSE have next functions that may be helpful

GetPlayerCurrentAmmo

GetWeaponClipRounds

GetWeaponAmmoUse

GetClipSize

 

i will appreciate any help.

 

Already done, thanks to Dazzerfong

ref refGun
ref refAmmo
short magsRemaining
 
begin gamemode
 
            set refGun to player.getequippedobject 5
            set refAmmo to getweaponammo refGun

set magsRemaining to (player.getitemcount refAmmo)/(player.GetWeaponClipRounds refGun)
Edited by Xilandro
Link to comment
Share on other sites

  • 2 weeks later...

I'm not exactly a guru at scripting, especially with NVSE, but did you run the script through cipscis? I did, and the only thing it wanted was the "end" statement, but I'm pretty sure you already know that.

 

Alternatively, you can always ask the creator of mods like that for help; walrus2517 for the stimpak counter mod, and there's another mod on FNV: Nexus, the "Realistic Reloading" mod, you could checkout.

 

-Regards

Edited by 2cooldays
Link to comment
Share on other sites

  • Recently Browsing   0 members

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