Trying to enable creature quest alias on container change.

Post » Wed Jun 20, 2012 4:26 am

I have a chest with some gems in it and I'm trying to attach a script to the gems so that when the player takes them a pair of hostile wisps (start disabled) are enabled. A quest has been created and the wisps are alias of the quest. The script won't compile however.

Scriptname SilverTreeSpiritSummon extends ObjectReference Quest Property UWSilverTree  Auto Event OnContainerChanged(ObjectReference akNewContainer, ObjectReference akOldContainer)    if akNewContainer == Game.GetPlayer()    Alias_Spirit1.GetReference().Enable()    Alias_Spirit2.GetReference().Enable()    EndIfEndEvent

PS. what would the event reference be for an item that is not in a container, aka just laying around?
User avatar
Roddy
 
Posts: 3564
Joined: Fri Jun 15, 2007 11:50 pm

Post » Tue Jun 19, 2012 8:05 pm

What's the error message you get?

Are you attaching this script to the container or the gems? It sounds like you should be attaching it to the gems. The problem then would be that if there is more than one gem the script would fire for every gem the player picks up...
User avatar
Michael Korkia
 
Posts: 3498
Joined: Mon Jul 23, 2007 7:58 pm

Post » Tue Jun 19, 2012 8:25 pm

The error mesage I'm getting is that Alias_Spirit1&2 are undefined.

I've also tried setting up the situation a different way, but with no cigar. I make the chest holding the gems and the wisps an alias of a quest called UWSilverTree. On the chest alias I set up a script to advance the quest stage on activation, and on the quest stage the script to enable the wisps. The editors has no complaints about any of this and allows me to save, but then in game nothing happens. If I set up the instruction to enable the wisps directly on the chest I get the "Alias_Spirit1&2 are undefined" error.

I have also set the Wisp Alias to allow for being disabled so it's not that.

I really don't understand what the problem is. I've set up this very same situation with other objects with no problem. It just really hates the wisps for some reason. Even the render window hates them, since it can't display the textures for them and they're invisible in the editor (makes it hard to work with them).
User avatar
Jynx Anthropic
 
Posts: 3352
Joined: Fri Sep 08, 2006 9:36 pm

Post » Tue Jun 19, 2012 5:06 pm

Maybe you need to add Alias_Spirit1 & 2 as properties in the script and then set the properties on the chest in the CK to point at the wisps?
User avatar
Joey Bel
 
Posts: 3487
Joined: Sun Jan 07, 2007 9:44 am


Return to V - Skyrim