ID:159111
 
Ive tried a few different ways to do this but nothing works, can someone help me out with this?
Tatenen wrote:
Ive tried a few different ways to do this but nothing works, can someone help me out with this?

mob/NPCs
Monster_Head
name="Monster"
density=0
Monster
icon='Monster.dmi'
density=1
New()
var/mob/NPCs/Monster_Head/T = new()
T.loc=locate(src.x,src.y,src.z)
T.pixel_y=32 //1 Tile Offset to the North
while(src)
step_rand(src) // Move in a random direction
T.loc=locate(src.x,src.y,src.z) //Keep the head in motion
sleep(5)
del T // If the src doesn't exist anymore, the head is no longer needed


That should do the trick.
In response to Mista-mage123
Mista-mage123 wrote:
That should do the trick.

No, it wouldn't, really. Other than your code itself not being proper, that's a bad design to do it in, and doing it properly is more complex than that anyway (unless you just use a library, like hub://Shadowdarke.BigAtom, but that alone will still not be 'proper' enough for your game).
In response to Kaioken
Kaioken wrote:
Mista-mage123 wrote:
That should do the trick.

No, it wouldn't, really. Other than your code itself not being proper, that's a bad design to do it in

It would do the trick for it would work perfectly fine.
Saying it doesn't work because it does work just isn't 'proper' is an oxymoron

Think before you speak, please.

Anyway; BigAtom is indeed probably more preferable. Sorry if I tried to help the OP learn something out of making this topic instead of giving them an easy way out.
In response to Mista-mage123
Mista-mage123 wrote:
It would do the trick for it would work perfectly fine.

If you call not even compiling and additionally having flaws beyond that "work perfectly fine", then sure, I agree. =)

Saying it doesn't work because it does work just isn't 'proper' is an oxymoron

Suggesting I said it works is a falsification. I said that, other than the design being bad, the code itself wasn't right, so obviously I wasn't implying that it would work.

Think before you speak, please.

The above stresses this enough, but right back at you. People don't usually say things "just because" with no reason. You also shouldn't disregard what people say with no reason. I had a basis for what I've said.

Sorry if I tried to help the OP learn something out of making this topic instead of giving them an easy way out.

Huh? I didn't even reply to the OP myself, and the above is exactly what you did here. You just made the code for him, never guiding him through the underlying concept or giving him an opportunity to try it on his own first. And you gave him code that's bad and wrong, with misleading comments saying it should work fine. Not what you call "an easy way out"? Well, of course it isn't actually easy in actuality since it wouldn't work, but you didn't know that at the time.
In response to Kaioken
Ah. I see.

step_rand(src). My bad. :P Fixing main post.

All is well, thanks for that.
In response to Mista-mage123
Uh, as I've already said, there are flaws beyond the compiling error. For example, the head part will still not be deleted after the main one is, neither will it be linked to (and keep in synch) with the main part other than being updated after the random movement done right there.
In response to Kaioken
Kaioken wrote:
Uh, as I've already said, there are flaws beyond the compiling error. For example, the head part will still not be deleted after the main one is, neither will it be linked to (and keep in synch) with the main part other than being updated after the random movement done right there.

Correct. Never did I say it would work right without that random movement either. Those are changes the OP can make himself. Hence me saying this way, the OP learns something out of it. I was giving him an example that 'probably' won't work correctly if he just pastes it into his game. (Which is the 'luxury' BigAtom seems to have, at least, most of the time)

Please stop being forcing me to make redundant statements. It's sort of annoying, and distracting from this topic.
In response to Mista-mage123
Mista-mage123 wrote:
Correct. Never did I say it would work right without that random movement either.

Oh, that's funny seeing as just before you've said how it should work perfectly fine as is after I pointed out it won't. You've also clearly attempted to do things with bad code, some of which that fails, and with such ability you shouldn't be posting trying to help others anyway, especially if you don't test your code first.

Those are changes the OP can make himself.

Changes being fixing your broken and bad code, which shouldn't have been posted in the first place...

Hence me saying this way, the OP learns something out of it.

This isn't necessarily a good thing. If he learns from your code itself, all he'll learn is how to write bad code, which is counterproductive.

I was giving him an example that 'probably' won't work correctly if he just pastes it into his game.

I'll disregard your previous claims of it "working perfectly fine", but working as plug-n-play in a game is a different matter from working at all, regardless of the game it's in.

Please stop being forcing me to make redundant statements.

Really, am I forcing you? Holding you at gunpoint? ;) I'm merely correcting your claims so people aren't misinformed. Since this has been done and my point has been expressed, there's no need for me to carry on this discussion. Doing so would be pointless anyway if you still haven't gotten the point.
In response to Kaioken
Hmmmm..that's wierd.

For a second there, it almost seemed like the topic title turned to 'ITT: Massive Argument GOGOGO!'

I'll be the mature one and Drop it. Move on. We helped the OP, so there. No more need be said.