Jump to content

I Need Hellp


mentilreq

Recommended Posts

I am having trouble figuring out why my game crashes when this script runs. I did notice it seems to happen if the player and the mannequin are the only ones in the cell (Victors Shack, Good Springs Home 4)

 

SCN MrMannequinQuestScript

 

Ref Man

 

Begin GameMode

Set Man to GetFirstRef 200 0 0

Label 1

If Man.GetIsRace aaaMRMannequinRace

Man.SetActorsAi 0

Set Man to Pencil01; Apple Bug

Set Man to GetNextRef

GoTo 1

EndIf

End

 

Any help would be greatly appreciated.

Link to comment
Share on other sites

Don't run functions on references that could possibly be NULL (which will return 'false' in a conditional).

Simply add a 'If Man' statement directly after the 'Label 1' line, and the corresponding EndIf just before 'End'.

 

Not sure if you mean that I should remove the "If Man.GetIsRace aaaMRMannequinRace" and just use "If man". Doing that set the ai on all npc's to 0.

Link to comment
Share on other sites

No, add the extra condition so that you will be checking for the NULL value that is returned when the refwalk is complete.

 

I changed the code within the loop too to what you probably want it to do.

SCN MrMannequinQuestScript

Ref Man

Begin GameMode
 Set Man to GetFirstRef 200 0 0
 Label 1
 If Man
   ;We have a valid reference in Man

   If Man.GetIsRace aaaMRMannequinRace
     ;The ref is of the correct race
     Man.SetActorsAi 0
   EndIf

   ;Go on to the next reference (if any)
   Set Man to Pencil01; Apple Bug
   Set Man to GetNextRef
   GoTo 1

 EndIf
End

Link to comment
Share on other sites

  • Recently Browsing   0 members

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