Nice!
I have itsybitsy perfected the script and added a "PREFIX" feature to "TAG" your video file, in cases someone opens it with Notepad.
By default they will read "BLITZ ENTITY VID1.00" but you ma change that to whatever you want (like "MYGAME MOV1.2")
I have itsybitsy perfected the script and added a "PREFIX" feature to "TAG" your video file, in cases someone opens it with Notepad.
By default they will read "BLITZ ENTITY VID1.00" but you ma change that to whatever you want (like "MYGAME MOV1.2")
Const rec_version$="1.00" Const rec_prefix$="B3D ENTITY VID" Global rec_file=0 Global rec_state=0 Function RecordEntity(e) WriteFloat rec_file,EntityX(e) WriteFloat rec_file,EntityY(e) WriteFloat rec_file,EntityZ(e) WriteFloat rec_file,EntityPitch(e) WriteFloat rec_file,EntityYaw(e) WriteFloat rec_file,EntityRoll(e) End Function Function StartRecording(filename$) If rec_file <> 0 Then CloseFile rec_file rec_file=WriteFile(filename) rec_state=1 WriteLine rec_file,rec_prefix+rec_version End Function Function StartPlayback(filename$) rec_file=ReadFile(filename) rec_state=2 rv$=ReadLine(rec_file) rv=Right(rv,Len(rv)-Len(rec_prefix)) If rv <> rec_version RuntimeError("Error in file "+FileName+". "+rec_prefix+" version is "+rv+", must be "+rec_version) EndIf End Function Function PlaybackEntity(e) If rec_file=0 Then Return If Not Eof(rec_file) x#=ReadFloat(rec_file) y#=ReadFloat(rec_file) z#=ReadFloat(rec_file) pitch#=ReadFloat(rec_file) yaw#=ReadFloat(rec_file) roll#=ReadFloat(rec_file) PositionEntity e,x,y,z RotateEntity e,pitch,yaw,roll Else CloseRecFile() EndIf End Function Function StopPlayback() CloseRecFile() End Function Function StopRecording() CloseRecFile() End Function Function CloseRecFile() If rec_file <> 0 Then CloseFile rec_file rec_file=0 End If rec_state=0 End Function