Problem with Ref variable in BlockType

Post » Tue Oct 11, 2011 10:45 am

I'm making a script on a Floor Sit Marker so it is marked for deletion when no longer needed. It works fine when I originally specified a companion ref explicitly, but it needs to work for all companions. So within the OnLoad blocktype, I set the NPC reference to curCompRef (current companion). so far so good as it compiles & saves. However, the variable is not accepted in the next blocktype, GameMode.

Object Script
scn FloorSitMkrScriptshort onceref curCompRef ; current companion reference; REMINDER:; Temporary solution.  Some mods remove the hired limit restriction.  if so So the wrong ref could be set.Begin OnLoad    if VNPCFollowers.bCassHired > 0        set curCompRef to RoseofSharonCassidyREF    elseif VNPCFollowers.bBooneHired > 0        set curCompRef to CraigBooneREF    elseif VNPCFollowers.bVeronicaHired > 0        set curCompRef to VeronicaREF    elseif VNPCFollowers.bLilyHired > 0        set curCompRef to LilyREF    elseif VNPCFollowers.RaulHired > 0        set curCompRef to RaulREF    else         set curCompRef to ArcadeREF    endifEnd; The GameMode blocktype is where the compiler has trouble accepting the reference variable (curCompRef).  :sadvaultboy: However,  it will complie if the NPC reference is given explicitly (e.g VeronicaREF).  But that would defeat the point of the OnLoad blocktype.  Begin GameMode    if curCompRef.Waiting == 0        if (once == 0 && curCompRef.GetSitting == 0)            set once to 1            disable            MarkForDelete        endif    endifEnd


Any solutions offered will be like giving me an aspirin. :yes: Thanks
User avatar
Hairul Hafis
 
Posts: 3516
Joined: Mon Oct 29, 2007 12:22 am

Return to Fallout: New Vegas