ID:172402
 
I've got little RC cars, and I was wondering how I'd call its Move() proc using src's move data while they're "driving" it.
mob
Move()
if(src.isdriving)
for(var/obj/inventory/rccar/R in world)
R.Move(???)
return 0
Enigmaster2002 wrote:
I've got little RC cars, and I was wondering how I'd call its Move() proc using src's move data while they're "driving" it.
mob
Move()
if(src.isdriving)
for(var/obj/inventory/rccar/R in world)
R.Move(???)
return 0


Well, I don't want to ignite a controversy, but I can tell you that some scientists have speculated on the existence--hypothetical, mind you--of "arguments" that procs may use to receive data. Some have even gone so far as to suggest that certain procs had known arguments, that were compiled in some sort of "reference". The most radical members of this camp theorize that Move() may have had as many as two arguments, telling it where the atom would go and, optionally, what direction it should face.

You could use those arguments, assuming of course that they exist, but surely there must be a more orthodox solution. Keep looking!

Lummox JR
In response to Lummox JR
Har har. How droll.

Let me clarify; I figured my problem was my calling Move() wrong, but on second thought, I guess not. I tried "R.Move(loc,dir)" before the default call to move (..()), and the RC Car would not move. I tried putting it after the default call to Move(), and src moves with it. How do I make the car move while src stays still?
In response to Enigmaster2002
Enigmaster2002 wrote:
Let me clarify; I figured my problem was my calling Move() wrong, but on second thought, I guess not. I tried "R.Move(loc,dir)" before the default call to move (..()), and the RC Car would not move. I tried putting it after the default call to Move(), and src moves with it. How do I make the car move while src stays still?

The aforementioned scientists speculated that arguments are used to receive data. Now assuming they're right, which really would be a huge leap, Move() might actually already receive some of those arguments about where the object was intended to go and which direction it should face. Now that would be highly useful, inasmuch as the current src.loc and src.dir would be rather useless for calling R.Move(), and obviously calling ..() to change those vars is wrong because you don't want src to move either.

So on the off chance that these strange "arguments" do in fact exist, and that the radicals are right about Move() having two of them, in theory you could just use those. But I'm glad to see you haven't caved yet to this lunacy, and are instead choosing to plow ahead using src's vars, however irrelevant they are to the problem at hand.

Lummox JR
In response to Lummox JR
Okay, I deserved that.

The car moves now, but now the client screen is being all weird. The RC car itself "glides" as it should, but the client's screen just "jumps" to the next tile, in the same fashion NO_STEPS would on a movable atom. The only thing I changed was setting the player's client.eye to the car and assigned client.perspective to EYE_PERSPECTIVE.