Multi-tile demo. in Developer Help
|
|
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 ^^
Thanks in advance! ^-^
Elorien, supan00b
|
Same theory as a turret sitting atop a tank ;) The head doesn't even have to be non-dense.
Head.loc = loc
near the end to keep the head on top of the body (unless beheading is a game feature ;)
mob/body/verb/shakehead()
for(var/loop = 0, loop <3, loop++) //shake the head three times
Head.dir = turn(dir,-45) // turn the head 45 deg left of the body direction
sleep() // pause briefly
Head.dir = dir // face forward
sleep()
Head.dir = turn(dir,45) // turn the head 45 deg right
sleep() // pause briefly
Head.dir = dir // face forward
sleep()
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. ;)