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 19, 2024 9:03 am
All times are UTC + 0
Need help with a code or work around?
Moderators: Global Moderators, Tiberian Sun Moderators
Post new topic   Reply to topic Page 1 of 1 [10 Posts] Mark the topic unread ::  View previous topic :: View next topic
Author Message
Slavack
Soldier


Joined: 07 Jan 2008

PostPosted: Sat Aug 15, 2015 7:28 pm    Post subject:  Need help with a code or work around?
Subject description: Pop up style laser turret/Obelisk
Reply with quote  Mark this post and the followings unread

Would be the best way to approach this code? I have one large 100 frame or so animation
Which consists of the turret popping up, charging(firing) and then popping down..

1st attempt : applyed my  turret shp to turretanim in the rules with the charges=yes tag.. worked but my weapon only fires after all frames expire..timing is off!

2nd attempt: broke large 100 frame shp into 3 parts... turretanim on structure rules(up and fire), and a weapon anim charged and turret back down. ..

nothing is working perfectly so any help or recommendations would help...

Thanks!

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


Joined: 16 Aug 2006
Location: Germany

PostPosted: Sat Aug 15, 2015 9:59 pm    Post subject: Reply with quote  Mark this post and the followings unread

Your 2nd attempt is already the best and only solution to this.
There is no other way to create what you want.
However, you only have to split the anim in 2 parts.
1. TurretAnim for the charging anim
2. Weapon muzzle flash anim used for the uncharging anim.

Also keep in mind, that the animation you put on the weapon (charged and going down) can't use remap colors.

_________________
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
Slavack
Soldier


Joined: 07 Jan 2008

PostPosted: Sat Aug 15, 2015 11:19 pm    Post subject: Reply with quote  Mark this post and the followings unread

thank you as always!

I fixed the remap on the muzzle anim, but what keys do i need to have in place to ensure that the 2nd anim (turret coming down) plays over my building?



; Obelisk Up animation
[PILLAR_B]
Normalized=yes
LoopStart=0
LoopEnd=33
LoopCount=1
Rate=200
Surface=yes
NewTheater=no
AltPalette=yes
DetailLevel=0

; Obelisk Down animation
[PILLAR_B2]
Image=PILLAR_B2
Normalized=yes
LoopStart=0
LoopEnd=33
LoopCount=1
Rate=200
Surface=yes
NewTheater=no
AltPalette=yes
DetailLevel=0

; Pillar charging animation
[PILLAR_C]
Normalized=yes
LoopStart=0
LoopEnd=1
LoopCount=-1
Rate=350
Surface=yes
NewTheater=no
AltPalette=yes
DetailLevel=2

Back to top
View user's profile Send private message
Bittah Commander
Defense Minister


Joined: 21 May 2003
Location: The Netherlands

PostPosted: Sat Aug 15, 2015 11:49 pm    Post subject: Reply with quote  Mark this post and the followings unread

Try Surface=no and if that doesn't work, try adding YSortAdjust=64 to the anim (or use a higher value if that isn't enough).

_________________

Back to top
View user's profile Send private message ModDB Profile ID YouTube User URL Facebook Profile URL
Lin Kuei Ominae
Seth


Joined: 16 Aug 2006
Location: Germany

PostPosted: Sat Aug 15, 2015 11:55 pm    Post subject: Reply with quote  Mark this post and the followings unread

I prefer using YDrawOffset, as it is imo the most reliable/exact working key that can be assigned directly to an anim (zadjust keys unfortunately work on the building, not the anim itself)

There is however a little (bad) sideeffect: YDrawOffset not only puts the anim in a higher render layer,
it also moves the anim visually upwards by the specified amount of pixel.
e.g.
YDrawOffset=-100 moves the anim 100 pixel up (north), so you have to move it in the SHP 100 pixel down (south) to compensate this.
As a raw/imprecise example i would say
-25 to -50 to compensate a 1x1 building
-50 to -100 to compensate a 2x2 building (depending on building height, this can also vary)

But YDrawOffset is the best key imo to really ensure an anim is always rendered on top of something.


\Edit
as Bittah mentioned, you can also try first Surface=no and YSortAdjust.
Though in the past i often found YSortAdjust a bit strange, as it sometimes worked, sometimes not, and sometimes only with some ridiculous high/low values like YSortAdjust=-2000

_________________
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
Slavack
Soldier


Joined: 07 Jan 2008

PostPosted: Sun Aug 16, 2015 6:08 am    Post subject: Reply with quote  Mark this post and the followings unread

Thank you both! I tested both options and I managed to get it to work nicely!  I really appreciate how quick
ya'll always come to my rescue..

One last question if I may?.. The muzzle anim is super bright compared to the turret anim? I played with the usenormallight tag in the art section with no success. Any way to adjust light level on a specific art entry without having to darken the actual shp file?

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


Joined: 16 Aug 2006
Location: Germany

PostPosted: Sun Aug 16, 2015 8:33 am    Post subject: Reply with quote  Mark this post and the followings unread

hmm, that is strange. Muzzle flash anims should by default follow the same lighting behaviour as activeanims.
Only when you set UseNormalLight=yes, such an anim can glow on dark maps (while being the same brightness as the building on normal day light maps)

Can you show a small screenshot and your current ini code?

_________________
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
Slavack
Soldier


Joined: 07 Jan 2008

PostPosted: Sun Aug 16, 2015 8:54 pm    Post subject: Reply with quote  Mark this post and the followings unread

thanks for looking at it sir



Laser Column.txt
 Description:

Download
 Filename:  Laser Column.txt
 Filesize:  1.71 KB
 Downloaded:  8 Time(s)


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


Joined: 16 Aug 2006
Location: Germany

PostPosted: Mon Aug 17, 2015 6:17 am    Post subject: Reply with quote  Mark this post and the followings unread

Hard to tell why it doesn't work. Might be an issue of the weapon code (which you haven't posted) or some strange side effect of the Gate logic which you also applied. (i never tested if a gate works well with a charging weapon)

\Edit
ah wait
I think I found the issue.
AltPalette is not only making it use unittem.pal, but it also makes it use UseNormalLight=yes by default (hardcoded side effect of using AltPalette)

Change the palette of the SHP to anim.pal and remove the key, then it should work.

_________________
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
Slavack
Soldier


Joined: 07 Jan 2008

PostPosted: Tue Aug 18, 2015 12:56 pm    Post subject: Reply with quote  Mark this post and the followings unread

As always LKO, it works perfectly... Thank you!

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