Jump to content

Help a newb with a script?


dianacat777

Recommended Posts

All right, so I have a problem that I'm not sure how to tackle.

 

I want to, given that the character has a certain perk, make it so that a (random) message will appear when the player eats a food item. Bonus points if there's a random chance this message appears rather than a 100% rate.

 

I can't exactly create new items with an effect to work on, because it's existing food I'm messing with. Anyway, I'm at a loss as for what to do with this. Can somebody more experienced please give me some pointers?

 

And what sort of activation would that script use? OnEquip doesn't seem to work with food.

Link to comment
Share on other sites

Disclaimer: I'm not sure this is the best method.

 

1. Create a script with a ScriptEffectStart block. Inside that block call GetRandomPercent and depending on the result display your message.

2. Create an effect that uses said script.

2. Add that effect to the food with the condition that the player has a certain perk.

Link to comment
Share on other sites

That is the correct method. Create a Base Effect for the food items, then add a script to that Base Effect (script must be an Effect script - not an object or quest script).

 

The Script would look like this

 

scn FoodThingyScript

 

int irand ;random number

 

Begin ScriptEffectStart

 

set irand to GetRandomPercent

if irand > 50

ShowMessage

endif

 

End

Edited by Kuroitsune
Link to comment
Share on other sites

  • Recently Browsing   0 members

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