ID:118947
 
Resolved
If repeat macros were defined for both key and Shift+key (or some other modifier combo), pressing or releasing the modifier keys did not change which command was being repeated. Now the command will change as long as the new modifiers match a different repeating macro.
Applies to:Dream Seeker
BYOND Version:490
Operating System:Windows 7 Ultimate 64-bit
Web Browser:Firefox 6.0.2
Status: Resolved (490)

This issue has been resolved.
Descriptive Problem Summary:
I'm currently using two sets of macros. WASD for movement, and then the same keys with a shift modifier for running. The problem is if you hit shift while already walking, or release shift while already running, the macro will not switch to the proper set. (by set I don't mean separate macro setups)

Numbered Steps to Reproduce Problem:
1. See the code below.
2. Setup macros for general movement on WASD, then set the running verbs on Shift+W/A/S/D.
3. Hold north (W) and then hold shift, you wont run.
4. Hold shift + north (W), then release shift, you wont walk.

Code Snippet (if applicable) to Reproduce Problem:
mob
verb
Run_North()
set category=null
src.step_size*=2
src.client.North()
src.step_size/=2
Run_East()
set category=null
src.step_size*=2
src.client.East()
src.step_size/=2
Run_South()
set category=null
src.step_size*=2
src.client.South()
src.step_size/=2
Run_West()
set category=null
src.step_size*=2
src.client.West()
src.step_size/=2


Expected Results:
For the macro system to recognize when a modifier has been activated or released.

Actual Results:
The macro system doesn't recognize if the modifier has been activated or released.

Does the problem occur:
Every time? Or how often? Every time.
In other games? Unknown. Used a fresh project.
In other user accounts? Yes.
On other computers? Yes.

When does the problem NOT occur?
It always occurs.

Did the problem NOT occur in any earlier versions? If so, what was the last version that worked?
I've had this issue as far back as I can remember. Only reporting it now because it's a haulting problem.

Workarounds:
None that I know of.
I'm not sure if this is a bug, but I agree the behavior should be changed.
Maybe they can throw this in while they're at it.
I'm not sure if they consider it a bug, but I do. This feature should be responding to keyboard changes IMO. As for your link there, I personally don't have a use for it.
Stevenw9 wrote:
As for your link there, I personally don't have a use for it.
Sure you do. Instead of needing double macros for everything, you could just make a simple toggle when they press shift.
I wont use toggle running because you'd be out of stamina so fast it wouldn't make it useful. If I did I'd want to use the caps lock key, since it's used in most MMO's.
So it's not considered a bug. Faith? Gone. Another project shelved due to BYOND being incapable of dealing with it properly. (Unless someone proves me wrong, and I would love you for it.)
Stevenw9 wrote:
I wont use toggle running because you'd be out of stamina so fast it wouldn't make it useful.
It would work almost exactly like your current code, except more efficiently and sensibly. Sprint mode is activated by holding shift, and deactivated by releasing it. The end result would be the same, and you wouldn't need multiple copies of poorly written nearly identical code.

So it's not considered a bug.
They haven't marked it as 'Not a bug'?

Another project shelved due to BYOND being incapable of dealing with it properly.
Get used to it, or try Unity.
Falacy wrote:
Stevenw9 wrote:
I wont use toggle running because you'd be out of stamina so fast it wouldn't make it useful.
It would work almost exactly like your current code, except more efficiently and sensibly. Sprint mode is activated by holding shift, and deactivated by releasing it. The end result would be the same, and you wouldn't need multiple copies of poorly written nearly identical code.

The code is only written once. Also, stop trying to be offensive. We're not here to discuss my code, but how the macro modifier system is broken.

So it's not considered a bug.
They haven't marked it as 'Not a bug'?

This was removed from bugs and added to feature requests, pay attention.

Another project shelved due to BYOND being incapable of dealing with it properly.
Get used to it, or try Unity.

'Get used to the system breaking or use another system.' <- I just lost all respect for you.

P.S. I'm not telling you that your feature request is bad, but maybe I want shift to do more than one thing.
Stevenw9 wrote:
The code is only written once.
The code is written 4 times, once for each direction. If you wanted to edit sprint speed from x2 to x3, for example, you would have to edit 4x the code. Its also a bad idea to have it defined for clients, since you can't apply that sprinting system to NPCs.

This was removed from bugs and added to feature requests, pay attention.
Was wondering where it went. For some reason they sort feature requests by votes instead of activity by default.

'Get used to the system breaking or use another system.' <- I just lost all respect for you.
I've been working with BYOND for years, 90% of that time is spent trying to find ways to work around their broken implementations of everything. Only worked with Unity for a few months, but every time I came across a problem, a quick search would turn up a blatant solution to the problem.

P.S. I'm not telling you that your feature request is bad, but maybe I want shift to do more than one thing.
You must not understand the feature request then, and/or you haven't realized how key down/up macro combinations can be put to good use.
Falacy wrote:
Stevenw9 wrote:
The code is only written once.
The code is written 4 times, once for each direction. If you wanted to edit sprint speed from x2 to x3, for example, you would have to edit 4x the code. Its also a bad idea to have it defined for clients, since you can't apply that sprinting systems to NPCs.

This isn't meant to be a 'learn from me' source, nor is it supposed to represent a finished product. This is simply a, 'lets get this working to see if it even works', which it does not. I apologize for the horrible programming, but if what I was shooting for worked I'd be rewritting it.

This was removed from bugs and added to feature requests, pay attention.
Was wondering where it went. For some reason they sort feature requests by votes instead of activity by default.

Yeah. I know who moved it, but I don't hate the person for it.

'Get used to the system breaking or use another system.' <- I just lost all respect for you.
I've been working with BYOND for years, 90% of that time is spent trying to find ways to work around their broken implementations of everything. Only worked with Unity for a few months, but every time I came across a problem, a quick search would turn up a blatant solution to the problem.

I enjoy spending my time finding breaks in the system and reporting them, as long as BYOND staff is willing to listen, and eventually fix it, regardless of how long it takes.

P.S. I'm not telling you that your feature request is bad, but maybe I want shift to do more than one thing.
Obviously you don't understand the feature request then, and/or you haven't realized how key up macros can be put to good use.

Quite possible. What I took from your suggestion was that SHIFT would have its own macro binding, so Shift+Direction and Shift+Shoot wouldn't necessarily act different. I.E. the former being running and the latter causing you to shoot much further with say, a grenade launcher.
Stevenw9 wrote:
Quite possible. What I took from your suggestion was that SHIFT would have its own macro binding, so Shift+Direction and Shift+Shoot wouldn't necessarily act different. I.E. the former being running and the latter causing you to shoot much further with say, a grenade launcher.
The request isn't for the removal of SHIFT+Key. In fact, is was even suggested there that the systems be expanded to take any combination of keys as a macro. The request is only for the addition of SHIFT as its own macro, on top of working in combinations. However, even if the functionality of combo macros was removed for the addition of these keys functioning separately, it would be a simple task for us to add our own systems for processing such combinations. As for SHIFT+SHOOT, if that's referring to the mouse, then that would still have to be handled through the Click() proc as it is now.
Falacy wrote:
Stevenw9 wrote:
Quite possible. What I took from your suggestion was that SHIFT would have its own macro binding, so Shift+Direction and Shift+Shoot wouldn't necessarily act different. I.E. the former being running and the latter causing you to shoot much further with say, a grenade launcher.
The request isn't for the removal of SHIFT+Key. In fact, is was even suggested there that the systems be expanded to take any combination of keys as a macro. The request is only for the addition of SHIFT as its own macro, on top of working in combinations. However, even if the functionality of combo macros was removed for the addition of these keys functioning separately, it would be a simple task for us to add our own systems for processing such combinations. As for SHIFT+SHOOT, if that's referring to the mouse, then that would still have to be handled through the Click() proc as it is now.

I meant with the keyboard. I see what you mean now though, still, I feel like that's a feature request and this is a bug. x.X
Honestly, this seems more like a bug to me. If you setup a macro for SHIFT+key, I'd expect that to happen the moment the keyboard detected a SHIFT+key state, regardless of order of key operations.

I also agree that macros for the modifiers themselves is a useful feature.
Does this only work on repeating keys?
Holding W and tapping Shift, even if their macros aren't set to repeat, would hopefully spam trigger W and SHIFT+W macros, as well as any UP macros that may be assigned to said keys.