Jump to content

Help? Attaching temporary perks to items with several instances


DynasuarezWrecks

Recommended Posts

I am working on a mod that provides a perk when an item is picked up, similar to the way the lucky 8 ball provided its luck boost in Fallout 3. I have managed to attach the perk to the item with a simple script like follows:

 

Begin OnAdd

Player.AddPerk

End

 

BeginOnDrop

Player.RemovePerk

End

 

For the most part, it works fine, but I am hitting a snag. The lucky 8 ball was simple because there was only one instance of it. My mod involves some vanilla items that you can find multiple instances of, and if you are holding, say, two of the item and drop one, the perk is removed even though you are still holding one because the script only cares that the item has been dropped. My goal is to prevent the removal of the perk as long as you are holding at least one.

 

I have looked at some other things within the GECK to try and find a solution, like the relationship between graves and shovels. I have tried using different scripts like the following:

 

Begin OnAdd

if Player.GetItemCount [item ID here] = 1

Player.AddPerk

endif

End

 

Begin OnDrop

if Player.GetItemCount [item ID here] = 0

Player.RemovePerk

endif

End

 

I have tried a couple of different conditions and syntaxes, but nothing I do is working. The GECK won't even let me close the script box because the script is erroneous somehow. Is it a syntax error? Is it even possible to begin with? Helpful suggestions are appreciated.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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