Recreating old AGI styled text parser adventure games.

Started by SkyeFyre, Thu 21/08/2014 17:53:11

Previous topic - Next topic

SkyeFyre

So I am working on a game in the style of the old Sierra AGI adventure games (like King's Quest 3, Space Quest 1-2, Police Quest) and while I've made a lot of progress there's a few things that aren't quite right yet.

The main problem I'm looking for help with, is that whenever the character stops moving they return to their resting position. In the old games the character would remain in the same position as they were when they stopped (even if mid-step). I have no clue as to how this could be achieved. Any help with this would be greatly appreciated. Basically I don't want the animations to reset back to standing, and if possible to omit the standing frame altogether.

The second thing, which I think I could solve myself given some time is I'm using a keyboard movement script I found on here which works beautifully, but whenever I attempt to input anything to my parser (Basically pressing any key) the character stops moving. I'm confident that with time I could code myself a new movement script (or try and figure out what's causing this behaviour with the existing script) but I was just curious if anyone knew of an easier solution to spare me some grief.

Khris

Regarding the first issue, short of creating your own movement (which is not too hard, given that you won't need pathfinding), a quick way I can see is to dynamically change the Normal View's first (standing) frame in each loop. Using the ViewFrame commands you can change sprites in a view during the game; you'd have to keep track of the current frame in repeatedly_execute (if (player.Frame != 0) lastWalkFrame = player.Frame;), then put the stored walkcycle frame in the first slot of each loop.

The second issue should be an easy fix, depending on which keyboard movement script you are using. Note that AGS already comes with a KM script anyway, which is also already included in a default game. If you used a different one from the forums, please link us to it so we know which one it is.

Crimson Wizard

Quote from: Khris on Thu 21/08/2014 19:59:55
Regarding the first issue, short of creating your own movement (which is not too hard, given that you won't need pathfinding), a quick way I can see is to dynamically change the Normal View's first (standing) frame in each loop. Using the ViewFrame commands you can change sprites in a view during the game; you'd have to keep track of the current frame in repeatedly_execute (if (player.Frame != 0) lastWalkFrame = player.Frame;), then put the stored walkcycle frame in the first slot of each loop.
I think it will be simplier to lock last frame when stopping:
Code: ags

if (!player.Walking)
    player.LockViewFrame(player.View, player.Loop, lastWalkFrame);

and unlock when walking again (or before issuing Walk command):
Code: ags

player.UnlockView();

This just need to be tested to see that there's no jumps when player starts walking again.

SMF spam blocked by CleanTalk