RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
[XP] Script Help Request - ZIndex for Sprites

0 Members and 1 Guest are viewing this topic.

***
Rep:
Level 70
RMRK Junior
I'll do my best to explain.  I have a Caterpillar thing going on, and I am trying to adjust the ZIndex (.z) of those Events, due to a couple quirks with em, essencially so the layer correctly.  Basically, the first guy to follow your main character should be on top of the 2nd guy following your character, and the 2nd guy is on top of the 3rd.  That is, when they are all stacked up in the same place.

I remember that I'd have to add an attr_accessor :z to access that property for that Class, however .z appears to be added in multiple spots (thinking class Sprite_Character < RPG::Sprite) but I cant figure out how to access self.z from a Different Class.

Im also not sure how much to adjust the value by.  As far as I can tell, the value is 63 when I mess with the Sprite_Character class, so should I drop it down by the height of the graphic, or will -1 and +1 suffice?

Hoping the end result would be something like this:

event.Caterpillar_Guy_1.z += 2 #orig is 63
event.Caterpillar_Guy_2.z += 1
event.Caterpillar_Guy_3.z (no change)

Does that make any sort of sense?

ZIndex being like HTML where the highest ZIndexed block appears on TOP of anything with a lower ZIndex.  Or did I totally not understand what the .z property is?  Oh, and the Caterpillar Class I am working with is NOT an extension of any other classes.  If that helps, and I think that is why I am stuck.
Heretic's Vehicles XP (Boat and Magic Carpet)

Heretic's Collection XP Ver 2.3 - Updated to include Dynamic Lighting, Moving Platforms, Vehicles, and much much more!