×
Меню
Индекс

MSFD Detecting if player is indoors or outdoors

[no fix] GetInterior (returns Boolean/short)
 
If ( GetInterior == 1 )
 
Undocumented function! (Thanks XP-Cagey and Killgore)
This function will return 1 if the current cell is an interior cell and 0 if it is an exterior cell. It will also return 1 if the player is in an interior acting like exterior (GetWindSpeed can be used to detect a fake exterior).
The following is a global sample script by Killgore. If you want to try it out start it by typing "StartScript Outside_Check" in the console.
 
Begin Outside_Check
short doonce
 
if (MenuMode == 1)
Return
EndIf
 
if (doOnce == 0) ;if you’re in some brand new cell
;or it just started
 
if ( GetInterior == 1 )
MessageBox "1: inside"
elseif ( GetInterior == 0 )
MessageBox "0: outside"
else
MessageBox "mystery else"
endif
 
set doOnce to 1
Return
endif
 
if (doOnce == 1)
if (CellChanged == 0) Return
else ;if the player changes cells that frame..
set doOnce to 2 ;it waits an extra frame
endif
Return
endif
 
if (doOnce == 2) ;then starts over and prints
set doOnce to 0
Return
endif
 
End Outside_Check