![]() Jan 5 2013, 6:45 pm
|
|
Are you using FA's keyboard library? If so, I believe it is done like this:
|
Does this tell you what key you are pressing?
mob In case you still didn't, include the library as how I instructed you earlier. |
Is the side scroller movement working well? If so, your key_down proc is being overridden by the side scroller. Please remove your copy-paste and include the library properly. Then, update the key_down proc:
mob |
well i added the library properly and i can see my the keys im pressing so thats promising, unfortunately my map is black/i cant see anything so until i figure out that problem i cant test the macros...
|
In order to make normal macros without editing key_down.
You can simply override keys list and have Forum_account's library only set key_down for keys you use: var/const/MOVEMENT_KEYS = "east|west|north|south" |
im stuck now, because i cant seem to figure out why the map window wont show up. i've already checked to see if it was because my spawn location was outside of the map, and i made sure to turn off the map in sidescroller since i made my own. but it still shows up all black . any idea on what the problem might be?
|
Make sure you ticked off the maps and demo codes of both sidescroller and keyboard library.
|
I fixed the window problem and used the library properly, but now....
Jemai1 wrote: > mob when i input that code i get the error that i dont have attack defined: Main.dm:15:error: Attack: undefined proc which i dont understand because i clearly showed that i had it defined earlier. |
Rotem12 wrote:
In order to make normal macros without editing key_down. var/const/MOVEMENT_KEYS = "east|west|north|south" You can avoid changing key_down() by simply changing keys list (You're going to need directions + jump key only for sidescroller). You probably get "Main.dm:15:error: Attack: undefined proc" because Attack() isn't defined under mob. It might be defined under mob/player etc. |
I tried:
var/const/MOVEMENT_KEYS = "east|west|north|south" and i get the error that movement keys arent defined: Main.dm:54:error: keys: undefined var is there something else that the sidescroller library has the keys named under besides movement? or did i input it wrong? |
First, make sure you have tabbed everything properly. If you copy-paste the code we have supplied, you'll get problems since the forum uses spaces instead of tabs.
If the Attack proc is still giving an undefined proc error, make sure that you are overriding the key_down proc of the mob where you defined the Attack proc. Tip: Whenever you post a proc, give the complete path. mob/combatant insead of just Attack() |
my game is split into classes so i created an Attack verb under each class, however i never did make a proc for attack... So for example one of my attack verbs is under:
mob/erza other than that problem. I did make sure i indented the code properly. |
Basically your game uses Sidescroller --> Sidescroller uses Keyboard library and there keys is defined under client (Keyboard library - keyboard.dm Line: 55).
I suppose you can modify keyboard library directly and just define the keys you want the library to use. Your current problem is that key_down overrides every macro you make. key_down is macro-ed for each key in keys list. Whatever key isn't in keys can be used normally without: mob |
so how exactly can i get passed the key_down overriding my new macros? without turning off the keyboard file since i need the keys and procs in it for the other files as well...?
|
You should fix your inheritance tree.
mob |
The sidescroller only needs direction keys and 1 other key for jump.
It doesn't need your entire keyboard. Right now it does use your entire keyboard. From keyboard library: client If you change the var keys, you'll be able to tell the library what keys to use. That way if you want to use the x key, the library won't trouble you. |
Rotem12 wrote:
The sidescroller only needs direction keys and 1 other key for jump. > client If you change the var keys, you'll be able to tell the library what keys to use. i dont get how its using the whole keyboard if the only keys are the directions and the jump one: var |