Dialogue script error when casting a function call

Post » Sun Mar 09, 2014 11:21 pm

So we have this bug in the tracker for the unofficial patches:

[02/22/2014 - 12:18:18PM] error: Cannot call doOnce() on a None object, aborting function callstack:[topic info 0300B667 on quest DLC1VQ02 (03002F65)].DLC1_TIF__0100B667.Fragment_0() - "DLC1_TIF__0100B667.psc" Line 9[02/22/2014 - 12:18:18PM] warning: Assigning None to a non-object variable named "::temp3"stack:[topic info 0300B667 on quest DLC1VQ02 (03002F65)].DLC1_TIF__0100B667.Fragment_0() - "DLC1_TIF__0100B667.psc" Line 9

The code for the TIF script is this:

;BEGIN FRAGMENT CODE - Do not edit anything between this and the end comment;NEXT FRAGMENT INDEX 1Scriptname DLC1_TIF__0100B667 Extends TopicInfo Hidden;BEGIN FRAGMENT Fragment_0Function Fragment_0(ObjectReference akSpeakerRef)Actor akSpeaker = akSpeakerRef as Actor;BEGIN CODEif (((self as Form) as DLC1DoOnce).DoOnce())    (GetOwningQuest() as DLC1_QF_DLC1VQ01COPY0000_01002F65).MM.IncreaseOpen()endif;END CODEEndFunction;END FRAGMENT;END FRAGMENT CODE - Do not edit anything between this and the begin comment

The code for the DoOnce thing is this:

Scriptname DLC1DoOnce extends Form  bool __done = falsebool Function DoOnce()    if (__done)        return false    else        __done = true        return true    endifEndFunction

This is all unaltered stuff straight out of the Dawnguard DLC. I can't figure out why it's generating the error. It appears to be the only one of Serana's responses that does. Both scripts are attached to dialogue form 0200B667 in Dawnguard.esm. Part of DLC1VQ02, topic DLC1VQ02SeranaBackground1Topic.

Any insight into this would be great.

User avatar
Frank Firefly
 
Posts: 3429
Joined: Sun Aug 19, 2007 9:34 am

Post » Mon Mar 10, 2014 4:47 am

Is DLC1DoOnce used anywhere else?... It doesn't quite make sense.

TopicInfo extends Form, so the cast to form should go through. But the cast to DLC1DoOnce should fail.

From the wiki: "Only other objects can be cast to objects, and only if that object is a direct child or parent of the one being cast. If you are casting from the parent object to the child one, the cast may fail if it isn't actually an instance of the child object, in which case the result will be None."

I would bet that anywhere that script is used, you would find more problems...

User avatar
Judy Lynch
 
Posts: 3504
Joined: Fri Oct 20, 2006 8:31 am

Post » Sun Mar 09, 2014 7:08 pm

Can you do a

debug.messagebox(self)

debug.messagebox((self as Form) as DLC1DoOnce)

?

User avatar
Sophh
 
Posts: 3381
Joined: Tue Aug 08, 2006 11:58 pm


Return to V - Skyrim