ID:1257711
 
(See the best response by Kaiochao.)
Dream Daemon Log:Logged in as Panda dude XD.
runtime error: bad index
proc name: action (/mob/proc/action)
usr: null
src: Panda dude XD (/mob/create_character)
call stack:
Panda dude XD (/mob/create_character): action(369)

Code:
mob
var
tmp/freeze_time = 0

proc
frozen()
return world.time < freeze_time

freeze(ticks)
if(icon_state=="jumping")
decel=5
else
vel_x=0
vel_y=0
freeze_time = max(freeze_time,world.time+ticks)

action()
if(frozen())
return
..()


Problem description:
I tried out my game and it was lagging pretty bad so i checked Dream daemons log and as soon as anyone logs in those errors keep popping up, so i searched for where i had anything that said "action" and it was just used for this proc. So can someone help me figure out a "better index" to define action so i can minimize the lag on my game please?
Is there another definition of action() somewhere? Maybe one that takes a numerical argument.
the only other part of my library that has the word "action" in it is
mob/var/tmp/canaction = 1

which i use for my attack verbs to stop players from moving when they attack. other than that nothing...
EDIT:
and when you die...
    set_state()
if(Dead)
if(base_state)
icon_state = "[base_state]Dead"
canaction=0
canattack=0
Best response
I remember now that action() is in Forum_account's Pixel Movement/Sidescroller libraries. I know exactly what the problem is, although it's not a quick fix.

The problem: action() is trying to access 'keys' as a list before it is made a list in set_macros().

The solution: Replace each instance of client.keys[*] with client.has_key(*):
client
// returns 1 if the key is down
proc/has_key(k)
return istype(keys) && keys[k]
The errors are gone now! but now it wont recognize any of my keys so i cant move or anything in game. do i have to redefine the keys or something now?
In response to Panda dude XD
Oops, typo. I fixed it.
Oh lol. Yay my lag is pretty much gone now thanks!