RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
[REQUEST] A script to strafe

0 Members and 1 Guest are viewing this topic.

****
Rep:
Level 84
3...2...1...
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?

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
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)

****
Rep:
Level 84
3...2...1...
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.

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
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

****
Rep:
Level 84
3...2...1...
Yeah, I was exaggerating.

********
Resource Artist
Rep:
Level 94
\\\\\
Project of the Month winner for June 2009
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.