Amulet into Inventory Script

Post » Mon Nov 19, 2012 1:18 pm

Hey there

I was doing the tutorial (Bethesda Tutorial for Quests from the wiki) for making a quest step by step and everything works, exept one thing. When I come to the part where you got to take up the amulet from the thiefs body to progress in the quest, the script doesn't do anything. Nothing happens when I take up the amulet.

Here is the script:
Scriptname GSQAmuletScript extends ObjectReferenceQuest Property GSQ01  Auto Event OnContainerChanged(ObjectReference newContainer, ObjectReference oldContainer)Debug.Trace ("Function called")If (newContainer == Game.GetPlayer())  Debug.Trace ("Is in inventory")  GSQ01.SetStage(30)EndifEndEvent

The debug doesn't show anything either. Please help. :(

mfg, MrStranded
User avatar
Lovingly
 
Posts: 3414
Joined: Fri Sep 15, 2006 6:36 am

Post » Mon Nov 19, 2012 7:14 am

Try:
ScriptName GSQAmuletScript Extends ObjectReference ; ReferenceAlias if this script is to be attached to an aliasActor Property PlayerREF AutoQuest Property GSQ01 AutoEvent OnContainerChanged(ObjectReference akNewContainer, ObjectReference akOldContainer)	If akNewContainer == PlayerREF		GSQ01.SetStage(30)		Debug.Notification("GSQ01.GetStage() == " + GSQ01.GetStage())	EndIfEndEvent
So long as the properties are filled, I can't see how it could go wrong unless the amulet is an alias in which case this would need to extend ReferenceAlias rather than ObjectReference.
User avatar
Mr. Allen
 
Posts: 3327
Joined: Fri Oct 05, 2007 8:36 am

Post » Mon Nov 19, 2012 8:46 pm

I tried your script, but still nothing happens. There's nothing in the debug as well. I too am pretty sure the properties are correct since I checked on them many times. It is, as if I would not take up the amulet. : /

Edit: And yes, the amulet is an alias, although the script is in the normal data of the item (I don't know wheter that makes a difference or not). ReferenceAlias doesn't seem to do the trick as well.

mfg, MrStranded
User avatar
Anna Watts
 
Posts: 3476
Joined: Sat Jun 17, 2006 8:31 pm

Post » Mon Nov 19, 2012 8:15 pm

Scriptname GSQAmuletScript extends ObjectReferenceEvent OnContainerChanged(ObjectReference newContainer, ObjectReference oldContainer)  Debug.Trace ("Function called")EndEvent

If this isn't sending a trace to your debug when you grab the amulet, it most likely means the script is not attached to the amulet.

EDIT: If it is attached to the amulet. Make sure you saved everything correctly and you may need to do a clean save on your mod.
User avatar
Daniel Holgate
 
Posts: 3538
Joined: Tue May 29, 2007 1:02 am

Post » Mon Nov 19, 2012 6:27 pm

How can I attach the script to the amulet?
User avatar
Anna Beattie
 
Posts: 3512
Joined: Sat Nov 11, 2006 4:59 am

Post » Mon Nov 19, 2012 3:18 pm

Edit it and, in its "Scripts" tab, you have to add the script, then press the *button shown when editing its properties such that the properties will be pointed to the appropriate forms.

*autofill
User avatar
Daniel Holgate
 
Posts: 3538
Joined: Tue May 29, 2007 1:02 am

Post » Mon Nov 19, 2012 12:03 pm

Thanks guys! :D
It now works. The solution was to put the script into the script-section of the alias and not the normal amulet-item.

have a good day, MrStranded
User avatar
JR Cash
 
Posts: 3441
Joined: Tue Oct 02, 2007 12:59 pm

Post » Mon Nov 19, 2012 9:14 am

Cool was just typing the reply to do that =]
User avatar
sarah simon-rogaume
 
Posts: 3383
Joined: Thu Mar 15, 2007 4:41 am


Return to V - Skyrim