using mouse through keyboard to get diagonal movement

NOTE: I HATE A LOT OF YOUR ZZT GAMES, SO WATCH OUT!

Moderators: Commodore, Zenith Nadir

Post Reply
gingermuffins
Posts: 371
Joined: Fri Sep 01, 2006 1:30 am

using mouse through keyboard to get diagonal movement

Post by gingermuffins »

i was fooling around with mouse mode in zzt, and I noticed that with mousekeys on (a windows utility that emulates mouse movements with the numpad) you can move diagonally.

ex: holding 9 down would keep telling the player to move north and east over and over again.

problem is, mousekeys is too slow for this to work. so it takes like two seconds to get going that way.

i found another mouse emulator (http://www.geocities.com/pronto4u/mouseemulator.html) that lets you change the speed by entering new values into its section of the registry.

If you backup/copy the fastest reg file and change it to something like this...
REGEDIT4

[HKEY_CURRENT_USER\Software\RH Designs\Mouse Emulator]
"Mouse Delay"=dword:00000010
"Mouse Base Speed"=dword:00000100
"Mouse Max Speed"=dword:00000100
(edit: changed numbers)
(edit2: changed numbers again)

...it will move the mouse fast enough to give you diagonal movement.

But it's unresponsive, hard to touch things, and sometimes goes in the wrong direction. so it's pretty useless unless you're playing a game with lots of open spaces. since the mouse emulator uses the numpad (5 is down for some reason, 1 is shoot, 2 is autorun), you can switch between the arrow keys and the numpad when you want different styles of control.

If there's a better way to get diagonal movement, I want to know!
MadTom
<:D
Posts: 886
Joined: Fri May 13, 2005 6:37 am

Post by MadTom »

gingermuffins: resident zztologist
gingermuffins
Posts: 371
Joined: Fri Sep 01, 2006 1:30 am

Post by gingermuffins »

:ravebaron: I'm hunting for macro:ravebaron:

I've been trying to find a virtual keystroke program that will type in ?+i automatically. I've only found one that works in zzt so far.

Autohotkey is free (and open-source) and it seems to work, but it's windows-only and a little slow working with zzt.

If you add this into the ini it creates when you start it...

Code: Select all

/::
KeyWait Shift
Blockinput On
SetKeyDelay [, 100, 0,]
SendEvent {Shift Down}/={Shift Up}i{Enter}
BlockInput Off
return



!/::
KeyWait Shift
Blockinput On
SetKeyDelay [, 50, 0,]
Send +/-i{Enter}
BlockInput Off
return
...you can set and clear the "i" flag by pressing slash and alt+slash. (if that conflicts with other things you're working on, you can use "^i::" and "!i::" which would make it ctrl+i and alt+i)

But it's a little slow. I guess it's a faster than typing it manually, but there is a short wait.

This is the only macro program I could get to work; none of the DOS ones functioned right with zzt.

I can't get it to set i any faster because it will miss keys and input things like ?i, ?+, i, etc.

clearing the flag always seems to work though.

This would make games that use inventory engines and special commands a little easier to play.

does it work on anyone else's comp?


(edit: the implication of this is that any unused key can become a command!!!1!11)


(edit 2)

Code: Select all

f::
KeyWait Shift
Blockinput On
SetKeyDelay [, 100, 0,]
SendEvent {Shift Down}/={Shift Up}{F}{U}{C}{K}{Y}{E}{A}{H}{Enter}
BlockInput Off
return


?+FUCKYEAH

(edit 3: if you make a macro that's invoked with only one key, like if you use i::, then you should put all i's in your macro in {} parenthesis. otherwise it will call the same macro over and over again. also, pressing ctrl+alt+delete will stop a macro)
User avatar
Zenith Nadir
this is my hammer
Posts: 2767
Joined: Wed Mar 12, 2003 11:40 am
Location: between the black and white spiders

Post by Zenith Nadir »

MadTom wrote:gingermuffins: resident zztologist
what about nanobot, and his zzt periodic table
he looked upon the world and saw it was still depraved :fvkk:

Overall: Rotton egg for breakfast
gingermuffins
Posts: 371
Joined: Fri Sep 01, 2006 1:30 am

Post by gingermuffins »

TAKEN KEYS:

a (title:about)
b (sound toggle/editor:boardlist)
e (title:goto editor)
h (help/hi-scores)
p (pause)
r (title:restore)
s (save/speed)
t (torch)
w (title:world)
space (shoot/editor:plot)

The following are taken in the editor only but can be used while playing:

c (editor:colour)
i (editor:board info)
l (editor:load)
n (editor:new world)
x (editor:flood fill)
z (editor:clear board)
F1 (editor:item)
F2 (editor:creature)
F3 (editor:terrain)
F4 (editor:text)
tab (editor:draw mode)

In addition, these keys are not usable if you want to use cheats or set flags:

+
-
z
m
o
d
k

So that leaves the following keys free for macro usage:

THE LETTER F

THE LETTER J

THE LETTER U

THE LETTER V

1234567890
insert
delete
home
end
pgup
pgdn
,
.
/
;
'
[
]
\
...caps lock?

i think shift+key interferes with normal commands, though.

numpad keys maybe (probably the best place to set the hotkeys, but it might cause troubles on laptops with no numpads.)

You can use ctrl + anykey and it won't interfere though

alt + anykey also works

------------

i might finish vinegar gulf because of this!
what about nanobot, and his zzt periodic table
Q. What's with that Nazi symbol in the corner?

A. That isn't a Nazi symbol. It's four Ns arranged in an X shape, as in Nanobox. I am not in any way affiliated with the Nazi party, nor do I believe in its philosophies.
gingermuffins
Posts: 371
Joined: Fri Sep 01, 2006 1:30 am

Post by gingermuffins »

Here are most of the cheats. they're a little slow but they work.

ctrl+h = health
ctrl+a = ammo
ctrl+k = keys
ctrl+g = gems
ctrl+t = torches
ctrl+z = zap

Code: Select all

^h::
KeyWait Shift
Blockinput On
SetKeyDelay [, 100, 0,]
SendEvent {Shift Down}/{Shift Up}{h}{e}{a}{l}{t}{h}{Enter}
BlockInput Off
return

^a::
KeyWait Shift
Blockinput On
SetKeyDelay [, 100, 0,]
SendEvent {Shift Down}/{Shift Up}{a}{m}{m}{o}{Enter}
BlockInput Off
return

^k::
KeyWait Shift
Blockinput On
SetKeyDelay [, 100, 0,]
SendEvent {Shift Down}/{Shift Up}{k}{e}{y}{s}{Enter}
BlockInput Off
return

^z::
KeyWait Shift
Blockinput On
SetKeyDelay [, 100, 0,]
SendEvent {Shift Down}/{Shift Up}{z}{a}{p}{Enter}
BlockInput Off
return

^t::
KeyWait Shift
Blockinput On
SetKeyDelay [, 100, 0,]
SendEvent {Shift Down}/{Shift Up}{t}{o}{r}{c}{h}{e}{s}{Enter}
BlockInput Off
return

^g::
KeyWait Shift
Blockinput On
SetKeyDelay [, 100, 0,]
SendEvent {Shift Down}/{Shift Up}{g}{e}{m}{s}{Enter}
BlockInput Off
return
(edit: avoid using pgup and pgdn as hotkeys too because they're used in the blue message box)

(edit 2: I've re-started vinegar gulf)
User avatar
Zenith Nadir
this is my hammer
Posts: 2767
Joined: Wed Mar 12, 2003 11:40 am
Location: between the black and white spiders

Post by Zenith Nadir »

when i discovered that pgup and pgdn could be used as page-skippers in the blue box, it was a real revelation to me. not as much as learning how to copy/paste code through a window, though

also, tab can be used for easier navigation of the char selection interface when editing objects.

also also finishing vinegar gulf = grand idea
he looked upon the world and saw it was still depraved :fvkk:

Overall: Rotton egg for breakfast
gingermuffins
Posts: 371
Joined: Fri Sep 01, 2006 1:30 am

Post by gingermuffins »

"copy/paste code through a window"

cool
User avatar
superbowl shuffle
Official Clamp School Defender
Posts: 418
Joined: Mon Apr 07, 2003 4:52 am
Location: CAsE SenSiTiVe

Post by superbowl shuffle »

I remember there was some page on za that had windows tips that taught me the copy/paste trick.
[size=75:lh51rn9h][b:lh51rn9h]When the 5 o'clock whistle blows, so do I.[/b:lh51rn9h]
[/size:lh51rn9h]
gingermuffins
Posts: 371
Joined: Fri Sep 01, 2006 1:30 am

Post by gingermuffins »

one last thing

reducing the keystroke repeat delay in the keyboard section under windows control panel will make the player piece pause less between running and stopping

it's fast enough to let you do 90 degree turns without pausing

this works better than the emulated mouse control and it's more responsive

but it doesn't affect the cursor speed in kevedit which is annoying

ok i'm done ranting
MadTom
<:D
Posts: 886
Joined: Fri May 13, 2005 6:37 am

Post by MadTom »

I have almost no delay on my keyboard, and have had for years, for that exact reason.
superbowl shuffle wrote:I remember there was some page on za that had windows tips that taught me the copy/paste trick.
http://zzt.org/?p=winzzt
gingermuffins
Posts: 371
Joined: Fri Sep 01, 2006 1:30 am

Post by gingermuffins »

There's a post by wil somewhere down the line and it has code for a "I know when you re-entered the board" trick.
First: the "I know when you re-entered the board" trick. This trick is very useful because it uses the "time" variable, which nobody uses anyway.

Code: Select all


@checkingobject
#cycle 1
:enteredboard
#give time 16300
You have entered the board!
Whee!
Execute valuable entered board code here.
:loop
/i/i#take time 1 enteredboard
#loop
This blows my mind but I don't understand why it works. I know that #give and #take are reversed for the time variable, and that time resets on re-entering the board, but it's just not clicking together in my head.

Could someone elaborate?
castro
newcomer
Posts: 1
Joined: Thu Jan 25, 2007 4:52 am

Post by castro »

It works because Tim Sweeney programed it to work that way.

Ahem. Let me explain.

For whatever coked-out reason, whenever you see a time limit in ZZT, that's actually a negative number. Instead of having a count down or something remotely logical, ZZT will add 1 every second. This is why #give/#take is reversed in regards to the amount of time left.

Now, when time is a positive integer, ZZT is programmed to not display anything; it will, however, continue to track said integer. So when the player is given roughly four and a half hours in seconds, the game will store that value, it just won't appear.

I'm pretty sure it's a little bit more complicated than that, but that's how it makes sense to me.
Post Reply