ID:261806
 
Well, I've started using parameters and I need help. I'll start off with this.
atom
//vars to hold the directions
var/list/enterdeny = new()
var/list/exitdeny = new()
var/list/enterallow = new()
var/list/exitallow = new()
//Params vars to covert the lists into
var/enterparams
var/exitparams
var/enteraparams
var/exitaparams


Those are the vars. And what my library does to define the list vars is this.
turf
icon = 'icons.dmi'
cave
icon_state = "cave"
layer = MOB_LAYER+1
enterdeny = list(EAST,WEST)

Then next comes the proc that adds sets up the lists manually so the user doesn't have to but I won't put that on here. But here's where I think the problem is.
<dm> Enter()
if(Rl_enter(usr))
enterparams = list2params(enterdeny)
enteraparams = list2params(enterallow)
return 0
else
enterparams = list2params(enterdeny)
enteraparams = list2params(enterallow)
return ..()

Exit()
if(Rl_exit(usr))
exitparams = list2params(exitdeny)
exitaparams = list2params(exitallow)
del(enterdeny)
del(enterallow)
return 0
else
exitparams = list2params(exitdeny)
exitaparams = list2params(exitallow)
del(exitdeny)
del(exitallow)
return ..()

atom/proc/Rl_convert() //This takes care of turning the lists inot params at runtime
enterparams = list2params(enterdeny)
exitparams = list2params(exitdeny)
enteraparams = list2params(enterallow)
exitaparams = list2params(exitallow)
del(enterdeny)
del(exitdeny)
del(enterallow)
del(exitallow)

atom/proc/Rl_enter(mob/M) //This and Rl_exit() control the allowance of movement
enterdeny = params2list(enterparams)
enterallow = params2list(enteraparams)
var/direc = get_dir(src,M)
if(direc in enterdeny)
if(direc in enterallow)
return 0
else return 1
else return 0

atom/proc/Rl_exit(mob/M)
exitdeny = params2list(exitparams)
exitallow = params2list(exitaparams)
var/direc = M.dir
if(direc in exitdeny)
if(direc in exitallow)
return 0
else return 1
else return 0


Sorry for so much code, but I'm pretty sure I had to put all that. So anyways, what it does is it calls the Rl_convert() proc at runtime to convert the lists to params, then the other procs take care of the rest. But I don't think that it's restoring the lists when they're needed because it let's you move through anything. And that's it really.

Sorry the message isn't put together very well, I'm in a hurry.

Resonating Light
No put usr in proc. Ungh.

Lummox JR
In response to Lummox JR
Ahhh! You're right, I hadn't really noticed that. Stupid mistake on my behalf.

Resonating Light

P.S. I really could use some with this, lol