ID:164861
Apr 5 2007, 7:10 am
|
|
Hi, i am gonna make this short because im on my friend's comp and its lagging like hell, but i want a list called target of things the usr has selected, and there are two problems. One, adding an overlay to src when you click it doesn't work. and 2, how come set src in usr.contents works, but set src in usr.target doesn't?
|
In response to GhostAnime
|
|
obviously, i have:
mob/var/list/target[0] and when i put: set src in usr.target it says "unsupported src setting". |
In response to Adam753
|
|
I bet you didn't look at the link I provided properly... "set src in List".. the thing is, you can't use any /list but lists that are listed in the argument definition for List (eh, that's a bit of a confusion neh?).
The reference states that the only supported "list" usable are: view(), oview(), world, world.contents, usr, usr.contents, or usr.loc Meaning you can't use anything else but one of those... for now. The reason why "list" is in quotes is usr.loc is not really a list, now is it? :O Well, unless it's referring to usr.loc.contents <_<; - GhostAnime |
In response to GhostAnime
|
|
Wait... so is there ANY way to do this? to do something like setting src in usr.target?
|
In response to Adam753
|
|
for(var/mob/x in oview())
if(usr.target==x) src=x //continue coding using src as you wanted OR to be more accurate, var/mob/T //t for target get it, for(var/mob/x in oview()) if(usr.target==x) T=x then outside of the for statement you can still use that reference to the mob and do whatever. I recomend using an image for the target code and having it only show up on the person who targetes screen, so look up the help for image. Ive done this exact system already with the same variable name and it works very well. in all honesty your a tad to vague, you want target to be a list? so you target multiple mobs and then do some action to them? well i suppose thats easy enough but youd just call whatever action proc to each mob in oview that is contained in target. Ehm yeah anyway next time if your going to ask for help put some time into stating the question a little more thoroughly |
In response to Adam753
|
|
As of yet, nope :/ However, you can work around by adding verbs or taking them away, depending on the target list.
var/list/target[] That's just an example though - GhostAnime |
In response to Adam753
|
|
There are more valid lists that can be used with it (the src setting) than that ref entry mentions, I believe; group,client.screen and maybe a few more. Perhaps you could try to workaround this by using some of those extra usable lists; maybe you don't use the group var otherwise in your game, and you can also do with having objects with no screen_loc in client.screen.
|
2) It doesn't work because there's no such setting (usr.target) for the verb.. Click here for more information
- GhostAnime