Is there anyway to make a custom Walk function?

Started by Stranga, Tue 26/03/2019 02:36:34

Previous topic - Next topic

Stranga

Hey everyone,

I want to create a custom walk function where I can change a variable while walking then change it back when finished walking. If that makes sense? It sounds easy to do but I'm having brain farts at the moment and can't figure it out. Any help would be appreciated! :)

Khris

Can you tell us why you want to do this? What your goal is? Because this sounds suspiciously like an XY problem.
For instance there's Character.IsMoving which is true while a character walks.

Stranga

This may sound silly (and it probably is), but I want to drop the game speed during some cutscenes to make the characters walk slower. Because I'm using a custom keyboard movement script the character's movement speed is controlled in the script not the default settings and the lowest default movement speed is 1 which still walks too fast at 60fps. What I found is that before I make the player walk to a certain destination i can drop the speed down to 30 to make them walk slower. I know this isn't practical, but it's the best with what I could do with my knowledge.

But I may be able to use Character.IsMoving

I'm using this script So I can have the player slide along the walls: https://www.adventuregamestudio.co.uk/forums/index.php?topic=21766.0

Khris

A character's MovementSpeed isn't supposed to change during the game because it's based on the pixels of the walkcycle frames (unless you want the character to moonwalk or slide).

What you should do instead is increase the AnimationSpeed, which is actually the frame delay. A higher AnimationSpeed causes slower walking.

Stranga

Would I need to link movement with animation the animation? It seems to work when I've checked that.

Khris

Yes, definitely. Otherwise the character will move MovementSpeed pixels every frame.

Stranga

It seems to be working. Although, now the view following the player seems choppy in bigger rooms. His animation looks fine though.

Khris

AGS default scrolling can cause that choppiness; one way to fix it is to use smooth scrolling. There's a module for that.

Stranga

#8
Ah! I'll check that out! Thanks Khris! :)

Edit: The smooth scrolling works but now the player movement when controlling him is now choppy (more like really shaky). Maybe I just need to play with the settings a little more?

SMF spam blocked by CleanTalk