[Resolved] Blizz ABS Moving While Guarding

Started by CriticalHit, May 02, 2017, 11:57:49 pm

Previous topic - Next topic

CriticalHit

May 02, 2017, 11:57:49 pm Last Edit: May 04, 2017, 12:33:09 pm by CriticalHit
Hi,

I am using RMXP with Blizz ABS. I want to make it so the player can't move while guarding. I've tried making an event running on a parallel process to check if the player is guarding or not. The problem is detecting if the player is guarding. I've tried the following in the script part of the conditional branch:

Input.pressed?(Key[Defend])
get error:
uninitialized interpreter ::Key
Input.pressed?(Input::Key[Defend])
get error:
uninitialized constant Defend

The Blizz ABS manual says Defend is how to check for the defend key.
How can I check if the player is defending so I can slow or stop them from moving while they defend?

As a last resort, I am planning on just checking for the buttons assigned to defending but I don't want to have to do that because I would like my users to be able to change their key configs eventually and this wouldn't allow the not moving while defending to carry over to a new key.

Any help will be appreciated.

KK20

May 03, 2017, 12:14:16 am #1 Last Edit: May 03, 2017, 12:17:53 am by KK20
Defend needs to be a string (things with "quotes" around it).
Input.pressed?(Input::Key["Defend"])


Also, there's a hackish solution: http://forum.chaos-project.com/index.php/topic,10775.msg156013.html

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

CriticalHit

Thanks for the response. I tried

Input.pressed?(Input::Key["Defend"])

In the script part of the conditional branch but got this error:

undefined method 'pressed?' for inputModule
Why isn't this working?

I read the hackish solution you posted but was saving that as a last resort because I'd like the user to be able to change their key configs which wouldn't work well with this solution plus I'd like to have more control rather than just not moving while defending, like as your blocking skill increases, you can move slow, fast, and faster.

Here is a link to my project repository in Github,
https://github.com/antlaw0/RMXP-Blizz-ABS

Thanks for any assistance you can provide.







KK20


Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

CriticalHit

I changed pressed? to press? like you said. Now I get this error:

script "Blizz 2" line 7617: TypeError occurred. no implicit conversion from nil to integer

This line is part 2 of 3 of Blizz ABS and has something to do with Key[]

How can I get not moving while defending to work?





KK20

Had to actually look at the docs this time to make sure.

For this case, you don't want to make it a string. You also don't need Key either.
Input.press?(Input::Defend)

The only time you use Key is if you're specifying a keyboard key. The key has to be a string.
Input.press?(Input::Key['L'])

So in the help file section 5.5, everything from Down to Turn only requires Input:: before it.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

CriticalHit

Excellent,
This worked:
Input.press?(Input::Defend)

:)
Yeah, the documentation was a little unclear.

Thank you!