Jump to content

Defined Property returning as None


jaghar7

Recommended Posts

Before anyone even thinks it (probably too late but meh) yes it really IS defined in CK.

 

So, I've now had this happen in the same script with two separate properties, A formlist and a script. I'm honestly not even sure what information is relevant here except to say that in-game this particular script thinks my formlist is a none. ie it's treating it as if it hasn't been defined in the CK when it is. Triple checked and checked again. This is driving me nuts.

 

All I want to do is a simple .getsize() and .AddForm but the logs say can't call on a none.

 

 

FormList			property BB_ActiveSchedules	auto

.....


Function BB_ClearSchedule()
	Debug.Trace("!Bowen - Clear Schedule Start")
	Quest Schedule 
	ReferenceAlias ActorAlias 
	
	if BB_ActiveSchedules == none
		Debug.MessageBox("Clear - BB_ActiveSchedules bugged")
		return
	endif

	int ListSize = BB_ActiveSchedules.GetSize() - 1
	int index = ListSize
	
	Debug.Trace("!Bowen - Clear Schedule ListSize: " + ListSize)
	
	while index >= 0
		Schedule = BB_ActiveSchedules.GetAt(0) As Quest
		ActorAlias = Schedule.GetAlias(0) As ReferenceAlias	
		Debug.Trace("!Bowen - Clear Schedule Schedule: " + Schedule)
		Debug.Trace("!Bowen - Clear Schedule Alias: " + ActorAlias)
		Debug.Trace("!Bowen - Clear Schedule Index: " + index)
		ActorAlias.Clear()
		; BB_ActiveSchedules.RemoveAddedForm(Schedule as Form)
		Debug.Trace("!Bowen - Clear Schedule Remaining: " + BB_ActiveSchedules.GetSize())
		index -= 1
		Utility.Wait(0.1)
	endwhile
	Debug.Trace("!Bowen - Clear Schedule End")
endFunction

Function BB_SetSchedule()
	Quest Schedule 
	ReferenceAlias ActorAlias 

	if BB_ActiveSchedules == none
		Debug.MessageBox("Set - BB_ActiveSchedules bugged")
		return
	endif

	Schedule = ScheduleQuests.GetAt(AtLocation.GetValueInt()) As Quest
	ActorAlias = Schedule.GetAlias(0) As ReferenceAlias
	ActorAlias.ForceRefTo(MapMarker)
	BB_ActiveSchedules.Revert()
	BB_ActiveSchedules.AddForm(Schedule as Form)
	Debug.Trace("!Bowen - Set Schedule Schedule: " + Schedule)
	Debug.Trace("!Bowen - Set Schedule Alias: " + ActorAlias)
	Debug.Trace("!Bowen - Set Schedule Size: " + BB_ActiveSchedules.GetSize())

endFunction

 

 

The weirder thing is, if I call ClearSchedule() from another script it works perfectly! But when call either of these from inside the script they're in, can't call on a none.

 

I'm also using a variant of SetSchedule() in another script without issue, though it's not quite relevant. It's just frustrating to have half a working system. :smile:

 

Naturally I can't find any hint of anyone else having this problem.. or my google-fu has really gone downhill lately. Does anyone have any idea what the bleep I'm missing?

Edited by jaghar7
Link to comment
Share on other sites

What are you extending and whos calling

 

If you are extending the right type, and its attached to the same entity calling this, yeah it should see it fine so long as CK populated as you verified

 

Script in question is on a reference alias, extending reference alias and being called via dialogue with the NPC filling that alias.

 

I'd be happy to post a screenshot of the properties in CK if I thought it would help. This really has me baffled (and somewhat vexed). It strikes me as odd that I can call ClearSchedule() from another script (on same alias) and it functions just fine. If the property wasn't set then it shouldn't work at all right?

 

So I took that notion of calling from elsewhere.. put the functions in question in another script and added that script as a property to the original.. but then the script property came back as none as well! Can't call a function on a none! I know things can sometimes get weird so I thought it might serve as a workaround but nope.

 

I wonder if I removed the script altogether and then added it back and reassigned all the properties.. I'm at wits end at this point I'll try just about anything. :)

Link to comment
Share on other sites

Are you testing on a new game? Or save that has not seen the mod in question yet? I ask because quests are notorious for not recognizing new changes once they have already started.

 

 

An excellent question! All the changes I've been making recently have been working well so it didn't occur to me. I have a pretty good feeling you're right. Would explain why my latest attempt at a workaround met with the exact same issue. At least I'm assured I haven't gone crazy. (yet) I'll give it a go. I was about to the point where I was going to need to start a fresh game anyway.

 

I suppose this is what I get for a first time Skyrim mod.. really should've thought of that. :)

Link to comment
Share on other sites

while (i >= 0)
;;; Schedule = BB_ActiveSchedules.GetAt(0) As Quest           ; you code line
    quest q = BB_ActiveSchedules.GetAt(i) As Quest
    referenceAlias RA = q.GetAlias(0) As ReferenceAlias
    IF ( RA )
       RA.Clear()
    ENDIF
    i = i - 1
endwhile

just another approach by using array

 

https://forums.nexusmods.com/index.php?/topic/10976043-defined-property-returning-as-none/

  GlobalVariable  PROPERTY AtLocation auto
  ObjectReference PROPERTY MapMarker  auto

  FormList PROPERTY ScheduleQuests auto

  Quest[] BB_ActiveSchedules

  Bool bBusy                                ; [default=False]


FUNCTION InitArray()
;-------------------
    BB_ActiveSchedules = new Quest[100]
ENDFUNCTION


FUNCTION DestroyArray()
;----------------------
    quest[] b
    BB_ActiveSchedules = b
ENDFUNCTION


;------------------------
FUNCTION BB_SetSchedule()
;------------------------
    WHILE (bBusy)
        Utility.Wait(0.1)
    ENDWHILE
    bBusy = TRUE
;    -------
    quest q = ScheduleQuests.GetAt( AtLocation.GetValueInt() ) as Quest         ; get the schedule quest
    referenceAlias RA = q.GetAlias(0) as ReferenceAlias                         ; get related alias
    IF ( RA )
        RA.ForceRefTo(MapMarker)                                                ; refer to marker
    ENDIF

    IF (BB_ActiveSchedules.Length == 0)
        InitArray()
    ENDIF

    int i = BB_ActiveSchedules.Find(None)
    IF (i >= 0)
        BB_ActiveSchedules[i] = q                                               ; store to array as active quest
    ENDIF
;    -------
    bBusy = False
ENDFUNCTION


;--------------------------
FUNCTION BB_ClearSchedule()
;--------------------------
IF ( bBusy )
    RETURN    ; - STOP -    Do not clear more than once!
ENDIF
;---------------------
    bBusy = TRUE
;    -------
    quest q

    int i = 0
    WHILE (i < BB_ActiveSchedules.Length)
        q = BB_ActiveSchedules[i]
        IF ( q )
            referenceAlias RA = q.GetAlias(0) as ReferenceAlias
            IF ( RA )
                RA.Clear()
            ENDIF
    
            q = None
            BB_ActiveSchedules[i] = q
    
            i = i + 1
        ELSE
            i = BB_ActiveSchedules.Length
        ENDIF
    ENDWHILE

    i = BB_ActiveSchedules.Find(None)
    IF (i == -1)
        RETURN    ; - STOP -    Array is full!
    ENDIF
;    ----------------------
    int n = i                                ; position of first <None> entry
    i = i + 1                                ; get next array position (init)
    WHILE (i < BB_ActiveSchedules.Length)
        q = BB_ActiveSchedules[i]
        IF ( q )
            BB_ActiveSchedules[n] = q        ; compact array by moving entry down
            n = n + 1                        ; increase compact counter
        ENDIF
        i = i + 1                            ; get next array position (update)
    ENDWHILE
;    -------
    bBusy = False
ENDFUNCTION

 

 

Edited by ReDragon2013
Link to comment
Share on other sites

while (i >= 0)
;;; Schedule = BB_ActiveSchedules.GetAt(0) As Quest           ; you code line
    quest q = BB_ActiveSchedules.GetAt(i) As Quest
    referenceAlias RA = q.GetAlias(0) As ReferenceAlias
    IF ( RA )
       RA.Clear()
    ENDIF
    i = i - 1
endwhile

just another approach by using array

 

https://forums.nexusmods.com/index.php?/topic/10976043-defined-property-returning-as-none/

  GlobalVariable  PROPERTY AtLocation auto
  ObjectReference PROPERTY MapMarker  auto

  FormList PROPERTY ScheduleQuests auto

  Quest[] BB_ActiveSchedules

  Bool bBusy                                ; [default=False]


FUNCTION InitArray()
;-------------------
    BB_ActiveSchedules = new Quest[100]
ENDFUNCTION


FUNCTION DestroyArray()
;----------------------
    quest[] b
    BB_ActiveSchedules = b
ENDFUNCTION


;------------------------
FUNCTION BB_SetSchedule()
;------------------------
    WHILE (bBusy)
        Utility.Wait(0.1)
    ENDWHILE
    bBusy = TRUE
;    -------
    quest q = ScheduleQuests.GetAt( AtLocation.GetValueInt() ) as Quest         ; get the schedule quest
    referenceAlias RA = q.GetAlias(0) as ReferenceAlias                         ; get related alias
    IF ( RA )
        RA.ForceRefTo(MapMarker)                                                ; refer to marker
    ENDIF

    IF (BB_ActiveSchedules.Length == 0)
        InitArray()
    ENDIF

    int i = BB_ActiveSchedules.Find(None)
    IF (i >= 0)
        BB_ActiveSchedules[i] = q                                               ; store to array as active quest
    ENDIF
;    -------
    bBusy = False
ENDFUNCTION


;--------------------------
FUNCTION BB_ClearSchedule()
;--------------------------
IF ( bBusy )
    RETURN    ; - STOP -    Do not clear more than once!
ENDIF
;---------------------
    bBusy = TRUE
;    -------
    quest q

    int i = 0
    WHILE (i < BB_ActiveSchedules.Length)
        q = BB_ActiveSchedules[i]
        IF ( q )
            referenceAlias RA = q.GetAlias(0) as ReferenceAlias
            IF ( RA )
                RA.Clear()
            ENDIF
    
            q = None
            BB_ActiveSchedules[i] = q
    
            i = i + 1
        ELSE
            i = BB_ActiveSchedules.Length
        ENDIF
    ENDWHILE

    i = BB_ActiveSchedules.Find(None)
    IF (i == -1)
        RETURN    ; - STOP -    Array is full!
    ENDIF
;    ----------------------
    int n = i                                ; position of first <None> entry
    i = i + 1                                ; get next array position (init)
    WHILE (i < BB_ActiveSchedules.Length)
        q = BB_ActiveSchedules[i]
        IF ( q )
            BB_ActiveSchedules[n] = q        ; compact array by moving entry down
            n = n + 1                        ; increase compact counter
        ENDIF
        i = i + 1                            ; get next array position (update)
    ENDWHILE
;    -------
    bBusy = False
ENDFUNCTION

 

 

 

 

I will make a note thanks! I haven't quite gotten to using arrays yet. Though the loop to clear is just a precautionary measure against weirdness. There should only be one active schedule at a time or they'll start to conflict. My guy will walk to Solitude instead of Windhelm etc. :smile: I was initially using a global as an index of a formlist to keep track but needs changed to something more flexible.

 

As a side note.. started a new game and now my guy won't even talk to me! LOL So I can't tell whether restarting helped or not.. if it's not one thing it's another!

 

Also, just wanted to say thanks to all who replied. I was waiting until I confirmed my issue was resolved but wanted to make sure I didn't forget. It is much appreciated.

 

Update: Restarting does seem to have fixed the Property = none issue..(assuming the logs are any indication) and revealed new ones.. some fixed.. but why... oh why.. is my follower now giving me the silent treatment??? the dialogue was working perfectly before dang nab it! Conditions haven't changed.. I guess something else must have. I'm >< close to VA *cough* and initial release.

 

Anyway, thanks again.

Edited by jaghar7
Link to comment
Share on other sites

Are you using vanilla follower system or is this follower using one of your custom quests as a framework?

 

Anyway it sounds like dialogue conditions arent being met from the sounds of it. Like they did apply mid-game but on a new one they aren't. Depending how you have this setup maybe generate another seq file if you otherwise know conditions etc are correct, just to rule that part out. One of those id have to look at it to pinpoint for sure

Link to comment
Share on other sites

Are you using vanilla follower system or is this follower using one of your custom quests as a framework?

 

Anyway it sounds like dialogue conditions arent being met from the sounds of it. Like they did apply mid-game but on a new one they aren't. Depending how you have this setup maybe generate another seq file if you otherwise know conditions etc are correct, just to rule that part out. One of those id have to look at it to pinpoint for sure

 

'Custom' framework.. though it's mostly just the same scripts from tutorials. At this point I've gone so far as removing all conditions on 'Follow me' and checking other followers. No sign of others not working and removing conditions had no effect. I'm thinking it's something funky with the quest. Still have one or two things to try. At the moment I've no idea what a seq file is/does. Conditions were just same as any other.. GetIsId on the quest and DismissedFollowerFaction == 1 on the dialogue. double and triple checked that hadn't changed on the actor. Still has the faction on game start.

 

Update: SEQ Start Enabled Quests.. got it.

 

So at one point I did check (with sqv) to make sure the controller quest was running (it was). I'm starting new games every time. It's acting like it's not on my follower and I don't see anything that sticks out from the logs. It's about this time I really start craving caffeine and pizza. :)

Edited by jaghar7
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...