Automatic place char. into keyboard buffer?

Blitz3D Forums/Blitz3D Beginners Area/Automatic place char. into keyboard buffer?

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

I think there are many misunderstandings in this thread. I guess Sammy was talking about a replay mode as seen in certain games.

Replay or demo modes simply emulate keyhits and mouse action by "feeding" their Input Routines alternatively with data when in demo mode instead of user input.

eg:
if replay_mode=0
 mxs#=mousexspeed()/4.0
 turnentity camera,0,mxs#,0
 mxs_array#(c)=mxs#
 c=c+1
else
 mxs#=mxs_array#(c)
 turnentity camera,0,mxs#,0
 c=c+1
endif


In the first case (play mode) the camera rotation is controlled by the mouse, additionally the rotation is stored in an array

In the ELSE case (replay mode) the camera rotation is controlled by the array data, containing previously stored mouse actions.

Every User Action can be stored this way. When recording and replaying, the same constant framerate should be used to keep things simple. If delta timing etc. is used and a constant framerate is not possible, a slightly more complicated solution is required, utilizing realtime sequencing.

Furthermore the usage of random values (Rand and Rnd) can be tricky. In theory they can be used if they are initialized with the same seed everytime, but that's probably only theory :)

For a fixed demomode sequence the array may be saved to a file that is loaded by default.