Posted: 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
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...
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
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?
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). _________________ QUICK_EDIT
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
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? QUICK_EDIT
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)
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
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