Item Eaten Check

Post » Sat Feb 19, 2011 1:31 am

hey guys,

Apologies if this has already been posted elsewhere on here but I did a search and nothing seemed to oome up.

Title and description probaly says it all really but i'm racking my brains trying to work out how to fire a script when a custom Potion (in this instance a wine) is consumed. I've tried all sorts of 'begins'..'onActivate' 'onDeath' 'onDrop' ...nothin ever happens when I drink it!

I take it you CAN have a quest event fire if you eat/drink a certain item? it IS possible?

Any help would be MUCH appreciated!
User avatar
kitten maciver
 
Posts: 3472
Joined: Fri Jun 30, 2006 2:36 pm

Post » Sat Feb 19, 2011 3:31 am

Attach the script to the custom potion itself and use Begin OnEquip to run it. And yes, you can start quests/set quest stages etc. within the script. You can use StartQuest QuestID or SetStage QuestID StageIndex for that.
User avatar
CYCO JO-NATE
 
Posts: 3431
Joined: Fri Sep 21, 2007 12:41 pm

Post » Sat Feb 19, 2011 6:56 am

Just tried Begin OnEquip, still nothing happening when I drink the wine.

here is the script if its at all useful. It's an Object script, used within the custom potions SCRIPT: field.

scn AADrinkWinebegin OnEquip	SetStage AAWineQ 10	MessageBox "You take a swig of the stranger's wine. It tastes bitter and before long you start to feel exteremely dizzy and pass out."end


When I consume the wine, neither the stage changes nor the message appears? :(
User avatar
Joey Bel
 
Posts: 3487
Joined: Sun Jan 07, 2007 9:44 am

Post » Sat Feb 19, 2011 9:08 am

Right, FINALLY! It's much more long winded than that!

For future reference guys, first of all I needed to make a script of type 'Magic Effect' with the code:
scn AADrinkWinebegin MenuMode 1002 (Inventory screen)	MessageBox "You take a swig of the stranger's wine. It tastes bitter and before long you start to feel extremely dizzy and pass out."end


Then in the Results part of the Potion options where you set what effects a potion can have on you, you have to select 'Script Effect' and choose that script from the list!
User avatar
Scott Clemmons
 
Posts: 3333
Joined: Sun Sep 16, 2007 5:35 pm


Return to IV - Oblivion