Autojoining

by Forum_account
Autojoining
Helpful procs for creating autojoining turfs and objects.
ID:1800492
 
Howdy. I love F_A's stuff, but I'm having a bit of an issue with bit flags and pixel_z. Does anyone know what bits come out to be above and below? Not actually looking for NORTH & SOUTH, but for other directions than what you'd find on a compass. I'm using his pixel movement too with this project, and thought about using on_ground and maybe the below procedure to get what I'm after. Ultimately I ended up doing this, and I'm not that satisfied. I might take a page from his pixel_movement.top-down demo and modify generate_top() with separate icons for each turfs height.

This is my tallest wall so far, and I'm using Autojoining normally in his ActionRPG-Framework.

turf
wall_05
icon = '96.dmi'
density = 1
pdepth = 64
icon_state = "05"
New()
..()

if(!density)
var/n = autojoin47("density")
if(n > 0)
overlays += image('shadow-47.dmi', "[n]", pixel_z = 48)
else
var/n = autojoin16("density")
if(n < 32)
overlays += image('96.dmi', "outline-[n]", pixel_z = 48)


The results:




Below is my next approach with my two tallest walls as demonstrated in his pixel_movement.top-down demo:

turf
proc
generate_top()
if(pdepth > 32) return

var/obj/o = new()
o.icon_state = icon_state
o.pixel_z = pdepth + pz
overlays += o

wall_04
icon = '64.dmi'
density = 1
pdepth = 48
icon_state = "wall"
New()
..()
var/n = 0
var/turf/t = locate(x,y+1,z)
if(t && istype(t,type)) n += 1
t = locate(x+1,y,z)
if(t && istype(t,type)) n += 2
t = locate(x,y-1,z)
if(t && istype(t,type)) n += 4
t = locate(x-1,y,z)
if(t && istype(t,type)) n += 8
icon_state = "wall-[n]"

generate_top()

wall_05
icon = '96.dmi'
density = 1
pdepth = 64
icon_state = "wall"
New()
..()
var/n = 0
var/turf/t = locate(x,y+1,z)
if(t && istype(t,type)) n += 1
t = locate(x+1,y,z)
if(t && istype(t,type)) n += 2
t = locate(x,y-1,z)
if(t && istype(t,type)) n += 4
t = locate(x-1,y,z)
if(t && istype(t,type)) n += 8
icon_state = "wall-[n]"

generate_top()

Results:


So, you see my dilemma perhaps. It would be cool to use one .dmi so those extra lines don't pop up, but at the same time, I'm not entirely sure how to go about this.