PDA

View Full Version : Are there ZScript commands to disable directions?



Nimono
12-23-2006, 09:14 PM
Like the title says. Yes, I read the documentation, but it doesn't help. All that bool Input__ (Where the blank is what direction you want to modify) will do is simulate the press and/or release of a certain direction, and that's not what I want. I want to actually DISABLE two certain directions (up and down), not simulate them being pressed or not. With bool InputUp and bool InputDown, all that I could do is either have up and down conflict with each other trying to always make Link go that way, or simply make it so it's always released (which would obviously not work to prevent up and down being pressed BY THE PLAYER). Though, if making it so it's always released would work the way I want, then that'd be nice to know. ;)

ShadowTiger
12-23-2006, 10:35 PM
What about crafting it so that when you press (Or Hold) up, it moves Link one pixel down and does a waitframe? ... It'd cause a Link Animation, but he shouldn't go anywhere, theoretically. :shrug:

The animation would be a problem though, right? =/

Saffith
12-23-2006, 11:33 PM
Though, if making it so it's always released would work the way I want, then that'd be nice to know. ;-)Yeah. There's no way to simply disable them, but setting inputUp and inputDown to false every frame has the same effect.
You could also just save his position and reset it each frame, but then he'd vibrate. That never looks good.


What about crafting it so that when you press (Or Hold) up, it moves Link one pixel down and does a waitframe? ... It'd cause a Link Animation, but he shouldn't go anywhere, theoretically. :shrug:Ah, not quite that easy. See, Link doesn't just move one pixel per frame; he goes 1-1-2-1-1-2, or something like that. But he does go one pixel per frame on slow walk combos, and one pixel each direction when moving diagonally.

C-Dawg
12-25-2006, 12:04 AM
Saffith is right. If you set Link->InputUp = false; every frame (meaning every time a loop executes) then the game engine will never react to the key press.

However, will the code react the next frame? Say I wanted the player to jump with L, but have control over how far the jump goes. This is accomplished by having the player's upward thrust increased while L is held down (for a few instants). But I need to disable L every frame, otherwise Link's inventory will cycle, as this is the normal function of L. If, each frame, I check for L, then modify Link's jump accordingly, and then set it to false before the waiframe, will this have the desired effect?