Jump to content

A Script request


Davidheat

Recommended Posts

You're going to have to be a lot more specific than that - what sort of item? How is it supposed to be "used"? What is the script supposed to be attached to?

 

To add a perk, just use the AddPerk function. You'll probably want to use either an OnEquip or OnActivate block, but you've been to vague for me to know which to recommend.

 

Cipscis

Link to comment
Share on other sites

I assume from your reference to "eating" the item that it will be an ingestible? If this is the case, then you'll want to use a ScriptEffectStart block, which would be applied to the ingestible through a Base Effect with Effect Archetype "Script" and your Effect Script defined as its "Assoc. Item".

 

If it's a book, then it's slightly different. Although books, like ingestibles, appear under the "Aid" section of the Pip-Boy's inventory menu, "using" them will trigger an OnEquip block.

 

Cipscis

Link to comment
Share on other sites

What you're trying to do is fairly simple, so something like this should be all you need:

ScriptName AddMyPerkOnEat

Begin ScriptEffectStart
if HasPerk MyPerk == 0
	AddPerk MyPerk
endif
End

That Effect Script should be used in a Base Effect, which will then be used by your ingestible. You'll want to replace "MyPerk" with the EditorID of your Perk.

 

The "if HasPerk == 0" condition ensures that the perk's rank won't increase if more than one instance of the ingestible is consumed. If you want the rank to increase with every one of them that the player consumes, just remove the condition.

 

Cipscis

Link to comment
Share on other sites

  • 2 weeks later...

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

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