Chaos Project

RPG Maker => General Discussion => Troubleshooting / Help => Topic started by: CriticalHit on May 02, 2017, 11:57:49 pm

Title: [Resolved] Blizz ABS Moving While Guarding
Post by: CriticalHit on May 02, 2017, 11:57:49 pm
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.
Title: Re: Blizz ABS Moving While Guarding
Post by: KK20 on May 03, 2017, 12:14:16 am
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
Title: Re: Blizz ABS Moving While Guarding
Post by: CriticalHit on May 03, 2017, 12:21:38 pm
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 (https://github.com/antlaw0/RMXP-Blizz-ABS)

Thanks for any assistance you can provide.






Title: Re: Blizz ABS Moving While Guarding
Post by: KK20 on May 03, 2017, 03:39:46 pm
Oh right...it's Input.press?
Title: Re: Blizz ABS Moving While Guarding
Post by: CriticalHit on May 03, 2017, 11:16:18 pm
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?




Title: Re: Blizz ABS Moving While Guarding
Post by: KK20 on May 04, 2017, 01:51:26 am
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.
Title: [Solved] Blizz ABS Moving While Guarding
Post by: CriticalHit on May 04, 2017, 12:19:41 pm
Excellent,
This worked:
Input.press?(Input::Defend)

:)
Yeah, the documentation was a little unclear.

Thank you!