Files
Bubberstation/code/__HELPERS/see_through_maps.dm
SkyratBot 68e962fa21 [MIRROR] Adds seethrough component [MDB IGNORE] (#16421)
* Adds seethrough component (#69642)

Adds a seethrough component!
Standing behind a big object with this component will make the object transparent:

https://youtu.be/nnyWMJakVtE

And no one else can see it:

And yes you can click through it thanks to the power of plane masters!

Standing behind a tree is a pretty big meme and people will have to either shift right click or bump into you to ever find you. This makes it so much better to implement big objects, since they no longer obscure the tiles behind them
It's also useful for existing big objects, like billboards and the likes

🆑
qol: You can now see through big trees when you stand behind them!
refactor: Adds a seethrough component to make it easier to add big stationairy objects without reducing visibility
/🆑

Info

This is done by sending an override overlay to the user that obscures the normal object and plays an animation.

It registers an ENTERED signal on specific turfs. Those tiles in which it hides stuff is defined as a list of list coordinates, for which I made a global list with some defines. It's really crappy and I'd appreciate some feedback on that

* Adds seethrough component

Co-authored-by: Time-Green <timkoster1@hotmail.com>
2022-09-25 14:56:36 -07:00

62 lines
1.9 KiB
Plaintext

//For these defines, check also above for their actual shapes in-game and maybe get a better idea
///Default shape. It's one tile above the atom
#define SEE_THROUGH_MAP_DEFAULT "default"
///A 3x3 area 2 tiles above the atom (trees love to be this shape)
#define SEE_THROUGH_MAP_THREE_X_THREE "3x3"
///2 tiles above the atom
#define SEE_THROUGH_MAP_DEFAULT_TWO_TALL "default_two_tall"
///two rows of three tiles above the atom (small but thick trees love these)
#define SEE_THROUGH_MAP_THREE_X_TWO "3x2"
///One row of three tiles above the atom, but offset one tile to the left because of how billboards work
#define SEE_THROUGH_MAP_BILLBOARD "billboard"
/**global statics for the see_through_component coordinate maps
* For ease of use, include a comment in the shape of the coordinate map, where O is nothing, X is a hidden tile and A is the object
* List-coordinate layout is list(relative_x, relative_y, relative_z)
* Turf finding algorithm needs the z and you can totally use it, but I can't think of any reason to ever do it
* Also it'd be really cool if you could keep the list-coordinates in here represent their actual relative coords, dont use tabs though since their spacing can differ
*/
GLOBAL_LIST_INIT(see_through_maps, list(
// X
// A
SEE_THROUGH_MAP_DEFAULT = list(
/*----------------*/list(0, 1, 0)
),
// XXX
// XXX
// XXX
// OAO
SEE_THROUGH_MAP_THREE_X_THREE = list(
list(-1, 3, 0), list(0, 3, 0), list(1, 3, 0),
list(-1, 2, 0), list(0, 2, 0), list(1, 2, 0),
list(-1, 1, 0), list(0, 1, 0), list(1, 1, 0)
),
// X
// X
// A
SEE_THROUGH_MAP_DEFAULT_TWO_TALL = list(
/*----------------*/list(0, 2, 0),
/*----------------*/list(0, 1, 0)
),
// XXX
// XXX
// OAO
SEE_THROUGH_MAP_THREE_X_TWO = list(
list(-1, 2, 0), list(0, 2, 0), list(1, 2, 0),
list(-1, 1, 0), list(0, 1, 0), list(1, 1, 0)
),
/// XXX
/// OAO
SEE_THROUGH_MAP_BILLBOARD = list(
list(0, 1, 0), list(1, 1, 0), list(2, 1, 0)
)
))