Smooth walking character, and popup GUI

Started by manny.p, Tue 07/03/2006 23:34:04

Previous topic - Next topic

manny.p

Hello me newb.

I'm in a bit of a cuffufle here and need some help.

1. I want to make narrow walkable areas and make the character walk smoothly across the them. Basically whenever my characters come to an edge his walking animation gets stuck for about half a second.

Can I make narrow lines and have a smooth walking character, or is there a script so i can allow just a line to be the walkable area instead of have to make it a filled in rectangle every time?

2. I'm using the old MI 2 template (fixed it for 2.71), I added my own GUI as GUI 11 and want it to come up after the intro credits. But how can I make it come up with closing the current background, at the moment it just overlays it.

Thnx in advance, manny.p

Khris

2 is more simple, so I'll address that first.
Easy way: Make the GUI as big as the screen by adding a suitable black border.

Elegant way: Before opening the GUI, call
Code: ags
RawSaveScreen();
RawSetColorRGB(0, 0, 0); //black
RawDrawRectangle(0, 0, 319, 239); // adjust bottom right coords to fit your res, of course
Wait(1); // make sure the screen is black before GUI opens

After closing the GUI, just call
Code: ags
RawRestoreScreen();


1: Easy way: Make sure that all narrow areas are at least 3 pixels wide.

Hard way: Write your own Walk-routine, intercept all walk mode clicks in the on_mouse_click and use
Code: ags
Character.Walk(x, y, eBlock, eAnywhere);

I'm too lazy right now to provide a working script, but it can be done and for a newb you seem to have a pretty good grasp of AGS, so take a shot at it.
(You'll want to use regions to determine if you have to handle walking yourself.)

manny.p

#2
Cheers mate the GUI is sorted.

About this smooth walking, on one room I have a wide enough walkable area but it just seems as soon as he hits the edge he stops for half a second (while his walking animation continues) before he starts to move in the right direction again.

Is there any other ways?


Edit: I think there may be a frame missing in the characters walk that may making this way more obvious that it should be. I'll look into it but if you have any suggestions I would love to hear them.

Scorpiorus

Quoteit just seems as soon as he hits the edge he stops for half a second (while his walking animation continues) before he starts to move in the right direction again

Hmm, did you set up diagonal walking loops for the character by any chance?

If you did, are they ok? It should be:

Loop 4 - walking diagonally down-right
Loop 5 - walking diagonally up-right
Loop 6 - walking diagonally down-left
Loop 7 - walking diagonally up-left

MugOGrog

"I'm using the old MI 2 template (fixed it for 2.71)"

I've just downloaded this same template, and i'm trying to fix it also. Could you either tell me how you fixed it, or upload it somewhere and share it?

Please PM me when you reply.
Thanks,
   - MugOGrog

SMF spam blocked by CleanTalk