Jump to content

Undefined Variables


Recommended Posts

Posted

I've been working on a mod and I can't get my script to compile.

 

 

Scriptname SF_AADBDoorexplode_01001D88 extends Scene Hidden

Actor Property Player Auto
ReferenceAlias Property Alias_BlackDoorAlias Auto


;BEGIN FRAGMENT CODE - Do not edit anything between this and the end comment
;NEXT FRAGMENT INDEX 9

;BEGIN FRAGMENT Fragment_2
Function Fragment_2()
;BEGIN CODE
BlackDoorAlias.SetOpen(true)
;END CODE
EndFunction
;END FRAGMENT

;BEGIN FRAGMENT Fragment_0
Function Fragment_0()
;BEGIN CODE
game.DisablePlayerControls(abCamSwitch=true)
game.ForceThirdPerson()
game.SetPlayerAIDriven(true)
;END CODE
EndFunction
;END FRAGMENT

;BEGIN FRAGMENT Fragment_1
Function Fragment_1()
;BEGIN CODE
Game.EnablePlayerControls()
game.SetPlayerAIDriven(false)
;END CODE
EndFunction
;END FRAGMENT

;END FRAGMENT CODE - Do not edit anything between this and the begin comment

 

 

It's failing on "BlackDoorAlias.SetOpen(true)" saying BlackDoorAlias is not defined even though it's clearly defined above as a ReferenceAlias and in the quest. It's the same alias used by the rest of the Dark Brotherhood scripts so I'm not sure why it doesn't work in mine. Any help?

 

Edit: I'm using MO and I've been seeing errors about not supporting 64bit binaries. Could that be affecting the compiler? I saw a mod earlier that patched the ck binary to stop that but I didn't think I needed it since I haven't had trouble compiling other scripts.

Posted

.SetOpen() is a function defined on ObjectReferences, you are using a ReferenceAlias.

A ReferenceAlias cannot be set to a door. An ObjectReference can.

 

Probably you need to change:

ReferenceAlias Property Alias_BlackDoorAlias Auto

to:

ObjectReference Property ref_BlackDoor Auto

 

Posted

That did it! Strange though, the quest where I got that line from (way of the voice) has it both ways. It's a ReferenceAlias and an ObjectReference. I wonder why it needs both?

 

Anyways, thanks for the help!

Posted

If you need it as map marker to find the object, then you need it as ReferenceAlias.

But if you need to operate on it then you need it as ObjectReference.

 

Special case are Actors, because you can get directly the Actor from a ReferenceAlias, and an Actor is an ObjectReference.

 

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

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