onActivate - I'm running out of ideas

Post » Wed Jun 20, 2012 9:32 pm

I created a trigger primitive, set it to activator, and rotated it ever so slightly so the player could activate it. The script, below, should do as it says, run through a few commands when the primitive is activated, but I'm completely unable to get any response from it. There aren't any problems compiling it, but it simply doesn't activate. I've checked all the conditionals, and they're all accurate. I know there's a cleaner way to write this script, but not if it simply wont activate. I'm sort of at a dead end for solutions, so any help would be appreciated.

Scriptname ABC extends ReferenceAliasEvent OnActivate(ObjectReference akActionRef)  if akActionRef == Game.GetPlayer() && GetOwningQuest().GetStage() == 60  Debug.Messagebox("123")elseif akActionRef == Game.GetPlayer() && GetOwningQuest().GetStage() == 70  Debug.Messagebox("456")elseif akActionRef == Game.GetPlayer()  Debug.MessageBox("789")endifEndEventObjectReference Property W  AutoArmor Property X  AutoArmor  Property Y  AutoEffectShader Property Z  Auto 
User avatar
Nuno Castro
 
Posts: 3414
Joined: Sat Oct 13, 2007 1:40 am

Post » Thu Jun 21, 2012 7:24 am

The trigger or activator isn't part of a quest, therefor GetOwningQuest() is where that's breaking. Just make a property for your quest and say that instead, and it should work.

Also; a trigger primitive as an activator the player hit's E at? I've never heard of that one.
User avatar
Alina loves Alexandra
 
Posts: 3456
Joined: Mon Jan 01, 2007 7:55 pm

Post » Thu Jun 21, 2012 3:59 am

GetOwningQuest should work, since the trigger is an alias of the quest (hence the script extending ReferenceAlias).

The problem is most likely that the alias is simply not filling when the quest starts, or the quest hasnt started at all


does the trigger box have to be an alias? is it because you have an objective pointing to it?
User avatar
SexyPimpAss
 
Posts: 3416
Joined: Wed Nov 15, 2006 9:24 am

Post » Thu Jun 21, 2012 9:03 am

The intent is that the player activates it, it checks what stage of the quest they're on, and responds appropriately. If the first stage, it removes quest items and ends the quest. If the end stage, it gives them a message. At any other point, which would never happen, it gives a vague message.

I think extending ReferenceAlias would allow me to GetRef on the items I plan on removing to make it easier, but my current problems prevents me from even testing that. I just need a way for the player to make the decision to end the quest.
User avatar
Lisa Robb
 
Posts: 3542
Joined: Mon Nov 27, 2006 9:13 pm

Post » Thu Jun 21, 2012 1:08 pm

if the activator is not an actual ref alias, and you are only extending the ref alias script to access that function, then alex is right, the quest does not own the activator, hence that call doing nothing.

in which case, i dont think extending ref alias is a good idea. you should have the script extend objectreference and if you need to acces refs of an alias, do it through the quest it is attached to.

use the objectreference script as a controller by adding a quest property that points to it
User avatar
Andrea P
 
Posts: 3400
Joined: Mon Feb 12, 2007 7:45 am

Post » Thu Jun 21, 2012 8:18 am

The primitive is a Quest Alias, so the ReferenceAlias extension will allow it to access other aliases and the quest itself. Would the extension prevent it from activating?
User avatar
MR.BIGG
 
Posts: 3373
Joined: Sat Sep 08, 2007 7:51 am


Return to V - Skyrim