Project Perfect Mod Forums
:: Home :: Get Hosted :: PPM FAQ :: Forum FAQ :: Privacy Policy :: Search :: Memberlist :: Usergroups :: Register :: Profile :: Log in to check your private messages :: Log in ::


The time now is Fri Apr 04, 2025 7:41 pm
All times are UTC + 0
difference between ActiveAnimZAdjust and YDrawOffset ?
Moderators: Global Moderators, Tiberian Sun Moderators
Post new topic   Reply to topic Page 1 of 1 [4 Posts] Mark the topic unread ::  View previous topic :: View next topic
Author Message
Exley
Commander


Joined: 09 May 2011
Location: Approaching the Great Pyramid

PostPosted: Sat Mar 29, 2025 8:33 pm    Post subject:  difference between ActiveAnimZAdjust and YDrawOffset ? Reply with quote  Mark this post and the followings unread

modenc shows that ZAdjust isn't used by TS/FS while YDraw is
yet again Art/FS.ini shows otherwise

but confuses me alot when to use one and when another ?

_________________
Quote:

how did we end up here ?

this place is horrible ...

smells like balls ...


Back to top
View user's profile Send private message  
Lin Kuei Ominae
Seth


Joined: 16 Aug 2006
Location: Germany

PostPosted: Sun Mar 30, 2025 9:11 pm    Post subject: Reply with quote  Mark this post and the followings unread

***ZAdjust changes the render layer while keeping the image position.
YDrawOffset changes the image position (up/down) which in turn also affects its render layer.
If you have only the animation section in art.ini (no accompanying logic like a buildings ActiveAnim*** keys), then you can use YDrawOffset to force the animation into a different render layer, but you have to compensate this by shifting the animation in the opposite direction in the SHP.
e.g.
You want an explosion to always play above everything else,
you can use YDrawOffset=-75 (or less) to move the animation 3 height levels upwards (to be rendered above other anims) but to keep its position ingame the same, you have to move it 75 pixel down in the SHP.
While ***ZAdjust keys are limited to min -127, YDrawOffset can shift an animation way beyond that limit. IIRC I once used it to move an animation 500 layers to make sure it's truly rendered ever on top of everything else.

A pure ZAdjust key (without any prefix) doesn't exist in TS.
Open game.exe with a text editor and search for ZAdjust to find all available variants.

_________________
SHP Artist of Twisted Insurrection:  Nod buildings

Public SHPs
X-Mech Calendar (28 Mechs for GDI and Nod)
5 GDI, 5 Nod, 1 Mutant, 1 Scrin unit, 1 GDI building

Tools
Image Shaper______TMP Shop______C&C Executable Modifier

Back to top
View user's profile Send private message  
Exley
Commander


Joined: 09 May 2011
Location: Approaching the Great Pyramid

PostPosted: Mon Mar 31, 2025 7:52 pm    Post subject: Reply with quote  Mark this post and the followings unread

so lets see if i got this correct...

Ydraw is used for buildings without any animation (active anim)
and just pure animation
while you must move shp image

while Zadjust is for both ?
but better because you don't have to shift shp itself ?

and another question, because there is confusing explanation (mod enc wrote it weirdly)

because we are in isometric view does Ydraw move layer
up or down, (as in toward sky) or forward/backward ?

or Zadjust does something of these ? (and which)

_________________
Quote:

how did we end up here ?

this place is horrible ...

smells like balls ...


Back to top
View user's profile Send private message  
Lin Kuei Ominae
Seth


Joined: 16 Aug 2006
Location: Germany

PostPosted: Mon Mar 31, 2025 10:41 pm    Post subject: Reply with quote  Mark this post and the followings unread

Exley wrote:
Ydraw is used for buildings without any animation (active anim)

No, it's used for animations only. While you could use it on a buildings ActiveAnim, it causes unnecessary work since you also have to shift the anim in the SHP. So in this case use ActiveAnimZAdjust. Easier, faster.

***ZAdjust has many different keys for different purposes (art.ini NormalZAdjust for the Building itself, ActiveAnimZAdjust for the anim, TurretAnimZAdjust as a rules.ini key for turrets etc), so you can't say for both.
e.g. there is no ZAdjust key that works for a lone/separate animation like an explosion. (NormalZAdjust doesn't work on an explosion IIRC, but I could be wrong, feel free to test it)
If you want to move an explosion into a different layer, you have to use YDrawOffset or YSortAdjust (see the Tunnel Top animations)

Though to make it more confusing
YDrawOffset needs negative values to move into higher render layers
YSortAdjust needs positive values to move into a higher render layer.


So in simple terms
Buildings and their anims
-use ***ZAdjust

Lone/Separate anims (like explosions)
-use YDrawOffset or YSortAdjust


Exley wrote:
and another question, because there is confusing explanation (mod enc wrote it weirdly)

because we are in isometric view does Ydraw move layer
up or down, (as in toward sky) or forward/backward ?

or Zadjust does something of these ? (and which)

YDraw moves the anim by the set amount in Pixel upwards/downwards.
e.g. YDrawOffset=-100 moves the animation 100 pixel up on the screen, while the center of the animation is still the cell on which it is spawned.
Due to this visual shift, it in turn also moves in front of animations that are centered on cells further north -> thus moving it in a higher render layer.

As a general rule: If you have 2 anims, the one centered on a more southern cell is the one rendered in front of the other.
Big anims that go beyond the cell border sometimes need a render layer shift, to make sure they are not cut off by other anims close by.
Via shifting the render layer, you could achieve a more southern centered anim to be played behind a more northern cell centered anim.

***ZAdjust keys don't move anything pixel wise. Only render layer wise.

_________________
SHP Artist of Twisted Insurrection:  Nod buildings

Public SHPs
X-Mech Calendar (28 Mechs for GDI and Nod)
5 GDI, 5 Nod, 1 Mutant, 1 Scrin unit, 1 GDI building

Tools
Image Shaper______TMP Shop______C&C Executable Modifier

Back to top
View user's profile Send private message  
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [4 Posts] Mark the topic unread ::  View previous topic :: View next topic
 
Share on TwitterShare on FacebookShare on Google+Share on DiggShare on RedditShare on PInterestShare on Del.icio.usShare on Stumble Upon
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © phpBB Group

[ Time: 0.1674s ][ Queries: 11 (0.0074s) ][ Debug on ]