Yo, Ive been messing with a multi-tile demo I found aggeeees ago, but I keep getting one error I cant track down.. the demo itself goes about using multiple tiles as one mob, but it tends to be rather complex, seing as how its a 2x2 tile mob, and the coder goes through a while pile of calculations to check for density...

Im not gonna bother asking for the fix for my error, instead Im gonna ask for a peice of code I know how to go about doing it, my coding skills just arent 1337 enough to do it *L*

So what I want, is a way to get a non dense mob to stay above a dense one . Id also, if at allpossible like the head to be displayed on a higher layer then the body, or of mobs around it... All verbs and whatnot should be applied to the body, so in essence all the head does is sit there ^^

I know I sound like a stupid lamer.. but Im -really- stumped. Even if you just point me in the right direction, maybe I could code it myself ^^

Yo, Ive been messing with a multi-tile demo I found aggeeees ago, but I keep getting one error I cant track down.. the demo itself goes about using multiple tiles as one mob, but it tends to be rather complex, seing as how its a 2x2 tile mob, and the coder goes through a while pile of calculations to check for density...

Im not gonna bother asking for the fix for my error, instead Im gonna ask for a peice of code I know how to go about doing it, my coding skills just arent 1337 enough to do it *L*

So what I want, is a way to get a non dense mob <the head> to stay above a dense one <the body>. Id also, if at allpossible like the head to be displayed on a higher layer then the body, or of mobs around it... All verbs and whatnot should be applied to the body, so in essence all the head does is sit there ^^

I know I sound like a stupid lamer.. but Im -really- stumped. Even if you just point me in the right direction, maybe I could code it myself ^^

Thanks in advance! ^-^

Elorien, supan00b

Same theory as a turret sitting atop a tank ;) The head doesn't even have to be non-dense.

Make the head's layer 4.5, so it appears above the body.

Make a /mob/head/Head variable on the body, that is a reference to the it's head.

In the body New() proc, create a new head and assign it to the body's Head variable.

In the body's Move() code, make sure to add the line:
Head.loc = loc
near the end to keep the head on top of the body (unless beheading is a game feature ;)

Yea, I want the head to be non-dense anyways. think something along the lines of FF3, walk the body up to the wall, the head is still displayed, even if it is on the wall tile, keeping the illusion of the head being -above- the body, rather then just to the north ^^

Thanks a bunch! Now lets see if I can get it to work... this is something that Ive been wanting to get working for awhile ^_^

Elorien

Shadowdarke wrote:

Elorien wrote:

Anyways, I think -part- of what I was trying to ask got screwed up with teh way I asked it. ^^;;;

By above, I meant 'one tile to the north' @.@ *L* I know, I should think about what Im trying to say before I say it..

The only difference would be in the Move() proc. You would want to change it to

Head.loc = locate(x,y+1,z)

Note that if you walk to the top edge of the map using this, you're head will disappear until you walk away from the edge. It would be a good idea to make the head non-dense in this scenario.

I recomend leaving the layer at a high setting, so that your head doesn't get stomped by items to the north. You may even want to set it higher than 4.5.

*pauses to watch the cat go nuts for no apparent reason*

Cats can see things that would drive mere humans insane if we could sense them. Just be glad they are here to protect our plane of existence! ;)

Yo, Ive been messing with a multi-tile demo I found aggeeees ago, but I keep getting one error I cant track down.. the demo itself goes about using multiple tiles as one mob, but it tends to be rather complex, seing as how its a 2x2 tile mob, and the coder goes through a while pile of calculations to check for density...

Im not gonna bother asking for the fix for my error, instead Im gonna ask for a peice of code I know how to go about doing it, my coding skills just arent 1337 enough to do it *L*

So what I want, is a way to get a non dense mob <the head> to stay above a dense one <the body>. Id also, if at allpossible like the head to be displayed on a higher layer then the body, or of mobs around it... All verbs and whatnot should be applied to the body, so in essence all the head does is sit there ^^

I know I sound like a stupid lamer.. but Im -really- stumped. Even if you just point me in the right direction, maybe I could code it myself ^^

Thanks in advance! ^-^

Elorien, supan00b

Same theory as a turret sitting atop a tank ;) The head doesn't even have to be non-dense.

Make the head's layer 4.5, so it appears above the body.

Make a /mob/head/Head variable on the body, that is a reference to the it's head.

In the body New() proc, create a new head and assign it to the body's Head variable.

In the body's Move() code, make sure to add the line:

Head.loc = loc
near the end to keep the head on top of the body (unless beheading is a game feature ;)

Any time the body verbs act on the head, simply reference the Head var. For example:

Also, avoid using < and > in the BYOND forum. The forum thinks they mark HTML tags and readers can see what is inside them. Parenthesis () work nicely however. ;)

Okay, waitasec here.

Is it possible to do this with an overlay? Setting it up so another mobs -body- can go under the overlay? That help to simplify the verb thing. If I can make the head an overlay which cant be teh target of a verb, then I wont have to bother with describing it to the body ^^;;

Uhm.. and one more question.. this is gonna sound sooo stupid.. but how would you go about setting the head to pop up when a user logs in? I know it has something to do with the new command.. but Im not exactly sure of how to go about it ^^;;;;;

So what I want, is a way to get a non dense mob <the head> to stay above a dense one <the body>. Id also, if at allpossible like the head to be displayed on a higher layer then the body, or of mobs around it... All verbs and whatnot should be applied to the body, so in essence all the head does is sit there ^^

I'll be releasing a library for all this in the near future. The code started in DragonSnot, has been enhanced a bunch for Living & Dead, and it about to be turned into its own library for Sneak II, at which point I'll also release it publically.

Is it possible to do this with an overlay? Setting it up so another mobs -body- can go under the overlay? That help to simplify the verb thing. If I can make the head an overlay which cant be teh target of a verb, then I wont have to bother with describing it to the body ^^;;

Uhm.. and one more question.. this is gonna sound sooo stupid.. but how would you go about setting the head to pop up when a user logs in? I know it has something to do with the new command.. but Im not exactly sure of how to go about it ^^;;;;;

Sorry for being such a pain ;;

Elorien

You could use an overlay, but you would have to add and subtract the overlays from turfs each time the mob moves. An overlay will also be stuck on the layer of the item it's attached to, so it might end up underneath objs or mobs in the turf. That is why you need to alter the layer variable of the head mob.

You could use an obj instead of a mob for the head if you wish. That wouldn't really change the theory. You could make it so that whenever someone acts on a head mob, it acts on the head's body. That's how I did it in tanks, if you damage a turret the damage is transfered to the primary body of the tank.

If you create and attach the head in the body's New() proc, it should show up when the mob is created. If you directly set the loc of the body without using Move() the head's loc won't move to match, so anyplace you set the body's loc you should be certain to set the head's loc as well.

// find the space one step north of the mob
var/turf/T = get_step(src,NORTH)
if (T) // if that space exists...
top.loc = T // move the top there
else
top.loc = null // if not, hide the top
playerstate("")

New(Loc)
..() // do normal New() stuff
top = new() // and create a new top when the mob is made

joe // a typical player
icon = 'joe.dmi' // the typical player's icon

New()
..() // do everything you do for another New player mob
top.icon = 'joetop.dmi' // and make the top icon 'joetop.dmi'

Im really starting to think of just giving up on byond in general x.x;;;; I just suck too much at this..

Thanks for the help ShadowDarke, once again..

Upon making a new dm file to test this, and puting it in (with proper indentation (see, no greater or less then signs this time around XD )) I got no less then 27 errors @.@ oh, and 2 warnings.. *sigh*

im just looking for a library to tie everything together. once i get the multimob thing happening, my game will be in full effect as of what i wanted it to be, well of course, except the grand master spell that i have been working on forever.(when elements collide)

im just looking for a library to tie everything together. once i get the multimob thing happening, my game will be in full effect as of what i wanted it to be, well of course, except the grand master spell that i have been working on forever.(when elements collide)

Oh. Anyhow, here's the code I used, exactly, in a brand new environment.

Im really starting to think of just giving up on byond in general x.x;;;; I just suck too much at this..

Thanks for the help ShadowDarke, once again..

Upon making a new dm file to test this, and puting it in (with proper indentation (see, no greater or less then signs this time around XD )) I got no less then 27 errors @.@ oh, and 2 warnings.. *sigh*

Oh well.. thanks again x.x;;; *closes it*

Elorien

Most likely the first error is the one making it think there are others. Fix it, then you can see which ones were just shadows of the first error. I've been known to get 30 or more errors from one simple mistake before.

Tell me the first error, and give me a chunk of code around the error line (usually 2 lines of code (not whitespace) above and below the error line are all you need). We'll get it fixed. :)

I'll work on it. I have several libraries in a half complete state. My map maker, movement modes (like Darke Dungeon where you can select quick, directional, and rotational modes), and now the tall mobs library. I just don't feel right releasing them as libraries until they are nearly foolproof. (Nearly foolproof, because anything can be ruined by a sufficiently qualified fool!)

Map maker will be a while, but the others aren't so hard. I'll just have to set aside Tanks for a couple hours and work on them.