![]() Jan 8 2009, 11:55 am
In response to Armiris
|
|
Typecast! >.<
|
Didn't work.
obj Gives me a runtime error: 'cannot read null.ckey' |
And it should. It doesn't look like you quite understood my previous post: you need to tell DM the type of the var (painter) when you first declare it (with the var keyword); DM needs to know it refers to an object of /mob type in order for it to know it has mob properties (such as the ckey var).
Besides, why would you attempt to compare a mob reference (which usr contains, unless its null) to a ckey? |
When is this painter var even declared and used? I don't think you've shown this. As others said, it's straightforward: as the error says, it is set to null when DM tries to read its ckey, which it of course fails in doing.
|
...
Login() pl doesn't hold ckeys anymore. |
I defined painter under var/mob this time, and now it's not doing anything. I try to draw, nothing comes up. Here's the code now.
obj |
Stay away from semi-colon coding. I've had issues with it in the past doing the same thing you describe. Move it down a line and delete the semi-colon and I believe it'll work.
|
I know it's just that sometimes during runtime the programmed snippet won't work because of that semi-colon
|
The code with that semicolon worked before. It stopped working when I added the check for the painter.
|
Mizukouken Ketsu wrote:
Stay away from semi-colon coding. I've had issues with it in the past doing the same thing you describe. Move it down a line and delete the semi-colon and I believe it'll work. Please stop giving advice that is blatantly incorrect or completely useless. Its misleading people. This accounts for almost every single one of your posts attempting to help others; which is noble, but its doing more harm than good since you don't grasp enough of DM to be advising others on it. |
If any number, it'd be roughly one-third, not nine-tenths (or ten-tenths depending on what you mean by "almost every single one"). And my so-called-by-you "bad" advice is either on the really minor things such as this, or on the larger problems where I ask a question/confirmation on whether or not my way would work.
|