How can I reroute client.Center() to some sort of mob command, without changing code in the client? I have an interface mob (/mob/clay) who's movment proc takes care of moving around a cursor in a window with different choices. I'd like to have client.Center() select one of the choices. Unlike the client movment procs (Center() isn't really a movment proc, I guess) it doesn't send any command to the mob. Instead, it calls walk(mob,0), which doesn't send a command to the mob, either (or does it?).
So, as I said, I'm looking for a way to have client.Center() send a command to the mob, without my having to rewrite any of the client's code. Anyone have any ideas?
ID:168664
![]() Sep 11 2005, 4:33 pm
|
|
I could do the above, but the clay mob is used just for the log in process; I don't want log in specific code being carried by the client for the rest of the players time connected, even if that code was made to do nothing outside of the log in process.
[edit: Kudos on the use of brackets and semicolons; I use them as well, and used to get flak for it.] |
Why don't you do an if() check for the src.mob, and do .=.() at the beginning. I am pretty sure that will make it do what it is supposed to do, after the if().
|
Then set a variable for it.
var still_checking=1; Just to give you an idea of how that could be implemented. itanium |
This is still an extra if() statment being executed everytime the center key is pressed (something that is going to be done quite often in my game). This is something that is going to be used once durring gameplay, and is specific to the mob, not the client. For that reason, I don't want to consider any code placed inside the client.
Basically, I'm asking if I've overlooked something, if there's some sort of background command or handshake that's being passed around that I don't know of. It's the sort of thing Lummox JR or Deadron normally know about, either that or it doesn't exist. :/ P.S. Thanks for trying to help out, though. :) |
Depending on how strict you are about editing Center() you could always try this.
client/var/centerhooks[] Then just dynamically add the desired proc in the list or remove one already in. |
That's the catch, I'm absolutely strict. My design philosophy is to never misplace functionality; if a certain function belongs to one object, it should not be placed in another object. So, though I could write up a working system very quickly using the client.Center() proc, I don't allow myself to do that sort of thing. So, any code here belonging to the client doesn't really help me at all. :/
|
Any chance you'd be able to just go with a simple:
mob/proc/Center() It's not what you want, but I'm extremely confident that there's no way you'll get client.Center() to send a command to the mob without changing the client.Center() proc. Unless you assign a keyboard macro to .center that goes directly to the mob.Center() proc, and completely cut out the call to client.Center(). Although I doubt that's up your ally either. |
But I do know of a way so that instead of over ride it adds to the clients code.
Itanium