When I program I like to give players their own sub-type of /mob, and as such all of the relevant variables are stored somewhere like /mob/Player... This creates problems because whenever I try to make a client proc that refers to a client.mob.var it doesn't recognize it. I don't particularly want to define another variable for this if I don't have to. (Though as I was typing this I realized I could just create a new var called var/mob/Player/Mob and use that... and then I wouldn't have to worry about setting and resetting the var...
But ANYWAY~ Is it possible to set the type of mob client mob refers to? And if not... could it be? ... Actually, realizing how simple it is to just create another var... Ignore the second half of that. But is it possible currently to change client.mob to recognize other typecasts?
ID:132944
![]() Jul 22 2009, 12:51 am
|
|
AJX wrote:
But ANYWAY~ Is it possible to set the type of mob client mob refers to? And if not... could it be? ... Actually, realizing how simple it is to just create another var... Ignore the second half of that. But is it possible currently to change client.mob to recognize other typecasts? Nope. The type for usr and client/mob is hard-coded. It would be quite difficult to change this, if it's possible at all. But since a simple type-cast makes this moot, that's what I recommend using. Lummox JR |
Lummox JR wrote:
AJX wrote: Yep. Figured I'd ask anyway. |
However, the point for such a suggestion is the hassle in typecasting vars again and again, yes? Then maybe a shortcut #define would be satisfactory?
You could name 'playercast()' shorter if you really wanted to save some typing, and maybe even made versions specifically for 'usr' and 'mob', but eh. You might even want to incorporate a type check in there, while you're at it.