Jump to content

A little help please


ingraved

Recommended Posts

I am creating a mod to add weight to ammo. I realize this has been done before. My dilemma is that I am currently not at my home computer which has FO3 and geck installed on it.

 

I am writing a script that will add and item called Ammo Box to my inventory with a weight of 1 to the ammount of ammo weight I wish to apply

Scriptname Ammoweightscript

ref ammowght

Begin GameMode
set ammowght to (player.getitemcount 32caliber*.01 + player.getitemcount missle + player.getitemcount mininuke*3 + player.getitemcount 308caliber*.05 + player.getitemcount 44caliber*.02)
if (ammowght-1) >= player.getitemcount AmmoBox
	player.additem AmmoBox (ammowght - player.getitemcount AmmoBox) 1
elseif ammowght < player.getitemcount AmmoBox
	player.removeitem AmmoBox (player.getitemcount AmmoBox - ammowght) 1
endif
End

I know the script is not 100% accurate, I can write most of it with confidence. although I would like to know if I can set my ammowght variable to the combined weight calculation I have in this scripted or if I have to go about it a different method

 

EDIT: I clicked post instead of preview :wallbash:

Link to comment
Share on other sites

Your ammowght variable need to be a float and not a ref.

You can still do it by having several command lines:

 

Set Ammowght to (player.getitemcount ammo10mm * 0.05) + (player.getitemcount ammo32calibur *0.02)

Set Ammowght to Ammowght + (player.getitemcount ammo308calibur * 0.05) + (player.getitemcount ammo44magnum *0.06)

 

ect, etc...

Link to comment
Share on other sites

  • Recently Browsing   0 members

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