Click(M as mob in view(1))
But it keeps coming up with M set as 'the turf'. Could someone please help me.
ID:269632
Aug 19 2005, 1:57 pm
|
|
I want to make it that when you click on a mob it sets M to another mob thats in view(1). This is the code im using:
Click(M as mob in view(1)) But it keeps coming up with M set as 'the turf'. Could someone please help me. |
In response to Jp
|
|
I just found a easier way. I am trying to make it that if a player is next to the football they can pick it up and it goes in there inventory.
mob |
In response to ADT_CLONE
|
|
No. Naughty boy. No put usr in proc.
obj/Football That should work. |
In response to Jp
|
|
Thanks it worked perfectly
|
In response to Jp
|
|
usr is most certainly fine in Click().
|
In response to ADT_CLONE
|
|
I am now trying to make it so that when you click on another player, If you have the ball it moves into the other players inventory and sets the other players hasball variable to 1. This is the code I thought would work:
obj But it comes up with the error undefined var. Could someone help me. |
In response to Airjoe
|
|
He had it in is pickup() proc. As a debugging statement, I know, but best not to get into bad habits.
|
In response to ADT_CLONE
|
|
That indentation is off.
You need to define hasball for mobs. So, somewhere in your code, you need these lines: mob Then, set hasball to one when clicking the ball and moving it into your inventory. Then you can do this: mob/Click() |
In response to Jp
|
|
I thought you said usr was bad in procs
|
In response to ADT_CLONE
|
|
Usr is fine in Click() Dont put in...other procs...
|
In response to Jp
|
|
What does this actually do. I dont want it to create a new ball.
Also this error comes up: runtime error: Cannot modify null.loc. proc name: Click (/mob/player1/G2/Click) usr: G1 (/mob/player1/G1) src: G2 (/mob/player1/G2) call stack: G2 (/mob/player1/G2): Click(the turf (1,1,1) (/turf)) This is what I do: 1: Select G1 2:Click ball 3:Click G2 (G2 gets ball) 4:Click G1(selects G1 but doesnt get ball) 5:Click G2(Comes up with this error message |
I'm not even sure what you're asking, but I'm afraid you can't get click to work with the way you have arguments set up.
I'm not sure if that's what you're looking for, but it does something.
Oh, and you have probably seen people being told not to use ur in procs. I'd just like to point out that usr is safe in Click() and DblClick(), unless you alter usr in client/Click()/DblClick(), in which case usr isn't valid in atom/Click()/DblClick()