I have something for you guys that works pretty decently. It's not exactly what I had tried to describe earlier, but it's close.
first, variable declarations:
gamevar camshake 0 1
gamevar temp 0 0
In the player actor, add the following:
ifp ponground
{
ifp pwalking addvar camshake 128
ifp prunning addvar camshake 256
ifp pducking setvar camshake 0
ifp pjetpack setvar camshake 0
ifp pstanding setvar camshake 0
}
else setvar camshake 0
Then you will need some event code:
onevent EVENT_DISPLAYROOMS
ifvare player[screenpeek].over_shoulder_on NO
ifvarg camshake 0
{
getplayer[screenpeek].posz cameraz
sin temp camshake
shiftvarr temp 4
subvarvar cameraz temp
}
endevent
If you like it, feel free to use it, change it, or whatever. One flaw is that the camera keeps bobbing for a moment after the player stops running. This is because the player's sprite animation does not stop immediately. I'll edit this again later if I think of a simple way to fix that.