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 Wed Apr 09, 2025 2:42 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 [7 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  
Exley
Commander


Joined: 09 May 2011
Location: Approaching the Great Pyramid

PostPosted: Sun Apr 06, 2025 10:26 am    Post subject: Reply with quote  Mark this post and the followings unread

well something isn't right...

i have this 1 squared building that has 2 active anims
yet none of them work when i build it

in expand02\ecache02 i have them shp's
in RULES i have them on the list

Code:

790=FORCEWALL
791=FORCEWALL_A
792=FORCEWALL_B


in ART i have this
Code:

[FORCEWALL]
Cameo=FSPICON
Image=FORCEWALL
Remapable=no
Foundation=1x1
Buildup=FORCEWALLMK
ActiveAnim=FORCEWALL_A
ActiveAnimTwo=FORCEWALL_B
ActiveAnimZAdjust=-50
ActiveAnimTwoZAdjust=-75   ;was -25
DemandLoad=false
DemandLoadBuildup=true

[FORCEWALL_A]
LoopStart=0
LoopEnd=3
LoopCount=-1
Rate=250

; firestorm sparks
[FORCEWALL_B]
ShouldUseCellDrawer=false   ; fixes bug where game loads anim.pal and not unittem.pal by default
LoopStart=0
LoopEnd=20
LoopCount=-1
Rate=800
Report=FIRSTRM1
YDrawOffset=-20

_________________
Quote:

how did we end up here ?

this place is horrible ...

smells like balls ...


Back to top
View user's profile Send private message  
Mig Eater
Defense Minister


Joined: 13 Nov 2003
Location: Eindhoven

PostPosted: Sun Apr 06, 2025 1:15 pm    Post subject: Reply with quote  Mark this post and the followings unread

Exley wrote:

Code:
790=FORCEWALL
791=FORCEWALL_A
792=FORCEWALL_B



FORCEWALL goes in the [BuildingTypes] list and FORCEWALL_A and FORCEWALL_B should be added to the [Animations] list.

_________________



Back to top
View user's profile Send private message Visit poster's website ModDB Profile ID YouTube User URL Facebook Profile URL Twitter Channel URL  
Exley
Commander


Joined: 09 May 2011
Location: Approaching the Great Pyramid

PostPosted: Sun Apr 06, 2025 1:58 pm    Post subject: Reply with quote  Mark this post and the followings unread

i have all those #Tongue
i just didnt post the forcewall building from rules.ini bcoz it has different name
but it is in correct list

Code:

; Force Wall
[DNWALL]
Image=FORCEWALL
Name=Force Wall
...
...
...


Code:
192=DNWALL



unless there is conflict with names ? (vs shp)

_________________
Quote:

how did we end up here ?

this place is horrible ...

smells like balls ...


Back to top
View user's profile Send private message  
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [7 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.1832s ][ Queries: 9 (0.0066s) ][ Debug on ]