Question on Z axis

Started by ChaosChronicler, May 04, 2017, 06:56:13 PM

Previous topic - Next topic

ChaosChronicler

what would it take to create a z axis or the illusion of one for buildings? Had an idea for a gun tower or plane watch tower.

Jaxxa

From reading the title I was about to post the standard response that Z Levels are unrealistic and that you would have to change the entire game.
But it may be feasible to fake it, What would you want those building to do?

It should be easy to draw the texture larger than the squares the building actually takes up.

What would you think these buildings should do?
You maybe could use indirect fire to allow a tower to fire over walls.

jamaicancastle

Quote from: Jaxxa on May 04, 2017, 10:37:15 PMIt should be easy to draw the texture larger than the squares the building actually takes up.

This part is very straightforward. You can use the "drawSize" property to control how large the graphic is drawn in a rectangle, just like "size". (In fact it defaults to size if you don't set a drawSize.)

So let's say you want a tower with a 2x2 base, and its total "height" will occupy 5 tiles visually. You set the size equal to (2, 2), which controls how large of an area it actually takes up. Then you set the drawSize equal to (2, 8). The "8" is because the graphic is automatically centered, so in order to have three extra rows "above" the base, you need three extra rows below as well. Your graphic will likewise be 2x8. The top 5/8ths contains the tower, and the lower 3/8s is left blank. Obviously you can adjust these numbers as needed to accommodate whatever size tower you want.

This should produce a tower that works like a building in one of the old Zelda games, where you can walk behind the upper part. You might have to fiddle with the altitudeLayer to prevent items from showing up on top of it. "Item" should be the layer you want, although I'm not 100% on that.

As far as I know, the game strictly bases the hitbox and collision on the size, not drawSize (a lot of very basic furniture has a larger drawSize, for instance) so there shouldn't be any problems with not being able to reach or select things "behind" the tower, although I don't recommend putting anything critical there for reasons that should be fairly obvious.

Giving a turret's gun indirect fire should be easy, but I don't know if the turret's AI is set up to actually make use of it. If not, that would probably require significant coding to replace, especially if you want to put limits on it like not shooting over mountains.

mrofa

Rimword already have a Z axis, thrugh its mostly a missliding name since the game uses "X" and "Z" for two dimensions. What you area looking is "Y" axis which exist under the name of altitude layer in xml.
All i do is clutter all around.

ChaosChronicler

Was thinking of a manned gun tower like the one below:

And as for how to go about doing it I forgot that there is already a gun tower from the mod More Vanilla Turrets.
But I'm not going to worry too much about this yet as I still want to focus on other things. Just wanted others input on if it was possible

mrofa

To make something appear to be high is easy, thrugh you will see the funny side of it when pawns will pass next to it.
Proper way will require some codding for two textures display.
Nice drawing btw :D
All i do is clutter all around.

ChaosChronicler

Quote from: mrofa on May 05, 2017, 04:46:56 PM
To make something appear to be high is easy, thrugh you will see the funny side of it when pawns will pass next to it.
Proper way will require some codding for two textures display.
Nice drawing btw :D
Not mine it was from an artist that doesn't have their DA account anymore.