ID:160190
 
Ok I have two problems that i cant seem to figure out. First one is I have my skils defined as objects and add to a define list skills for every player. I display the skills in a grid. Every works fine for using the skills with click, but what i cant get to do is I have an assign verb to assign it to one of the hotkeys, but I cant figure out how to be able to right click and see the verb. Because its not the contents list i cant use set src in usr. I tried in view(0) in usr.loc and none of them work. Is this possible.


Next I have a system where when a player dies they are transported to the closest dead spawn point. I was wondering whats the best way to do this cause right now im using tags but it just goes to the same one every time.
Ok I have two problems that i cant seem to figure out. First one is I have my skils defined as objects and add to a define list skills for every player. I display the skills in a grid. Every works fine for using the skills with click, but what i cant get to do is I have an assign verb to assign it to one of the hotkeys, but I cant figure out how to be able to right click and see the verb. Because its not the contents list i cant use set src in usr. I tried in view(0) in usr.loc and none of them work. Is this possible.

You can either add them to the screen, too, but place them so low in layer that they can't be seen, etc. (recommended) or...you know what, I'm not even going to say my other idea. It's just rather bad.


Next I have a system where when a player dies they are transported to the closest dead spawn point. I was wondering whats the best way to do this cause right now im using tags but it just goes to the same one every time.

Find all the turfs, and place them in a list with an association that will equal their distance from the player. Then use some form of sorting algorithm to find which one is closest. Keep in mind there may a better method, I've never done this.
In response to Jeff8500
You could just do something like this:
var/list/respawn_turfs = (...)
//...
proc/get_spawnpoint(turf/death_turf)
//returns closest spawnpoint turf to death_turf
var
turf/closest_turf
closest_dist = 99 //high value for the 1st iteration
for(var/turf/T in respawn_turfs)
var/distance = get_dist(death_turf,T)
if(distance < closest_dist)
closest_turf = T
closest_dist = distance
return closest_turf
In response to Kaioken
Yeah, that's probably the better option there. I didn't think of just looping through them.