The RPG Maker Resource Kit

RMRK RPG Maker Creation => Requests => Script Request => Topic started by: Countdown on August 22, 2009, 04:23:45 PM

Title: [REQUEST] A script to strafe
Post by: Countdown on August 22, 2009, 04:23:45 PM
Hey, does anybody know of (or can make) a script for RMVX to lock the player's facing as long as you are holding a button?  For example, I'm using Vlad's Requiem ABS, and when I'm running away from an enemy, I can't attack, so I want to be able to hold a button to lock my character's facing for as long as I hold it so that I can walk backwards, and still attack while strafing.  Any help?
Title: Re: [REQUEST] A script to strafe
Post by: modern algebra on August 22, 2009, 07:05:31 PM
Any reason this can't be done with a parallel process common event like the following?

@>Conditional Branch: The [X] Button is being pressed
   @>Set Move Route: Player
    :                         : $> Direction Fix ON
   @>
:   Else
   @>Set Move Route: Player
    :                         : $> Direction Fix OFF
:   Branch End
@>Wait: 4 frame(s)
@>


(X being whatever button you want to enable strafing)
Title: Re: [REQUEST] A script to strafe
Post by: Countdown on August 22, 2009, 07:15:53 PM
Yeah, it would work. It would work great, I just don't really like having thousands of parallel process events going at the same time.  I suppose I'll have to do it that way though.  Thanks.
Title: Re: [REQUEST] A script to strafe
Post by: modern algebra on August 22, 2009, 07:31:12 PM
Well, as long as you put wait frames in, then parallel processes aren't going to kill the game

60 frames / second. What's the maximum acceptable response time? I put 4 frames since I doubt anyone would notice a 1/15 second delay (maximum) between pressing a button and starting to strafe. You could probably go higher. As long as you aren't updating all of your parallel processes every frame, there shouldn't be a lag problem.

Unless you weren't exaggerating and actually have thousands of parallel processes going on :P. In which case, I would suggest that you skim off some of the fat :P
Title: Re: [REQUEST] A script to strafe
Post by: Countdown on August 22, 2009, 07:44:32 PM
Yeah, I was exaggerating.
Title: Re: [REQUEST] A script to strafe
Post by: Grafikal on August 23, 2009, 01:32:03 AM
Also, it would save the trouble of making something so simple compatible with the combat system of Vlad's ABS. I was about to suggest the same event when reading the first post. I would strongly suggest eventing this as well.