:: Home :: Get Hosted :: PPM FAQ :: Forum FAQ :: Privacy Policy :: Search :: Memberlist :: Usergroups :: Register :: Profile :: Log in to check your private messages :: Log in ::
Do you want to advertise at Project Perfect Mod. Find out how to do it HERE.

The time now is Mon Dec 17, 2018 10:08 am
All times are UTC + 0
 Forum index » Modding Central » Tiberian Sun Editing Forum » Tutorials Factory
Animations and art.ini debris
Moderators: Global Moderators, Tiberian Sun Moderators
Post new topic   Reply to topic Page 1 of 1 [1 Post] View previous topic :: View next topic
Author Message
Lin Kuei Ominae
Seth


Joined: 16 Aug 2006
Location: Germany

PostPosted: Thu Aug 04, 2011 1:13 pm    Post subject:  Animations and art.ini debris Reply with quote

This tutorial explains the differences between normal animations and art.ini debris, their usage and how they can work together to create cool effects.

What is an animation?
An animation is using an SHP, that has a correspondingly named section in art.ini, which defines how the frames of the SHP are shown ingame. For that it can use keys to set the transparency, framerate, start and end frame, looped frames and also damage.

What is an art.ini debris?
It's basically an animation which has an additional 3D information stored and which can interact with the environment in that way, that it is spawned, flies for a certain distance and then hits the ground. In contrary to the normal animation this usually can't play in an infinite loop, as it sooner or later always hits the ground and thus ends its existence.

A normal animation turns into an art.ini debris as soon as the following keys are present in its section in art.ini
Elasticity= ;how strong can it bounce off the ground (0.0 no bounce; 1.0 infinite bounce)
MaxXYVel= ;how fast does the debris move in a random horizontal direction when it is spawned
MinZVel= ;how fast does the debris move upwards when it is spawned
Bouncer=yes ;set this animation as an art.ini debris

MaxXYVel and MinZVel together define how far the debris can fly away from the point where it is spawned.

While art.ini debris can use basically all keys that work for normal animations, there are several keys which work only on art.ini debris.
Spawns= ;when the debris hits the ground, which other debris should be spawned
SpawnCount= ;spawns randomly a number of debris from 0 to the specified value
ExpireAnim= ;the animation that should be played when the debris hits the ground.
Warhead= ;(on normal anims the key is ignored and the warhead that is set in rules.ini on FlameDamage2 is used)
IsMeteor=true ;use the special meteor logic, which makes the debris spawn in midair instead of the ground
IsTiberium=true ;allows the debris to spawn an overlaytype via TiberiumSpawnType when it hits the ground.
TiberiumRadius= ;the amount of cells around the impact point that should get the spawned overlaytype (max is 9 as only a max 3x3 area can be affected)
TiberiumSpawnType= ;the overlaytype (often tiberium) that should be spawned. For each cell it chooses randomly one between the defined overlay and the next 3 overlays in the rules.ini [OverlayTypes] list (e.g. TiberiumSpawnType=BTIB01 will spawn randomly BTIB01, BTIB02, BTIB03 and BTIB04).

How can we use them?
Normal anims and art.ini debris can't switch directly from one to the other and only certain keys allow one type of them to start the other one.
To start a debris from a normal anim you can only use TrailerAnim.
To start a normal anim from a debris you can only use ExpireAnim and TrailerAnim.
The Next key is a special one, as it plays the next anim in the type of the one on which it is used. That means a normal anim will play the Next anim as a normal one too (even if it's defined as debris) and an art.ini debris will play the Next anim as an art.ini debris too (even if it's defined as a normal anim).

In rules.ini the type doesn't matter and you can assign them as usual to the unit Explosion key, warhead AnimList and any other Key that should play an animation.


How does the code look like?
With this knowledge you can now create an animation that spawns several small debris as well as playing a normal animation at the same time.

As an example, lets create a simple harvester explosion using anims that exist already in vanilla TS. This one shows how an initial art.ini debris, that is only used as a dummy, creates a normal animation as well as several debris.

art.ini
Code:
[HARVEXPL]
Image=none ;this is only a dummy
ExpireAnim=TWLT100 ;the normal animation that should be played
Elasticity=0.0
MaxXYVel=1.0
MinZVel=-10.0 ;hit instantly the ground when anim is supposed to be played
Spawns=CRYSTAL1 ;lets spawn some tiberium crystal debris
SpawnCount=6
Bouncer=yes

rules.ini
Code:
[Animations]
;don't forget to have here the firestorm animations listed before the new anims
xx=HARVEXPL

[HARV]
Explosion=HARVEXPL

This example will show ingame a big explosion that spawns at the same time a random amount of 0-6 tiberium crystal debris.


And now an example showing how a normal animation creates debris as well as another normal animation.

art.ini
Code:
;this is a simple 10x10pixel SHP with 10 empty/blank frames
[CLRANIM]
Start=0
End=10

;this is a dummy stage which makes sure that only 1 debris is spawned and a normal anim played almost at the same time
[NORMINIT]
Image=CLRANIM ; we need an invisible SHP as Image=none doesn't works reliable here
Start=0
End=2
Rate=900
Next=TWLT100
TrailerAnim=CRYSTAL1
TrailerSeperation=2

Instead of CRYSTAL1 you can use on TrailerAnim another normal anim (to create this way 3 or more simultaneously played anims) or you can use a debris (to spawn this way 2 different types of debris simultaneously)

rules.ini
Code:
[Animations]
;don't forget to have here the firestorm animations listed before the new anims
xx=CLRANIM
yy=NORMINIT

[HARV]
Explosion=NORMINIT


Are there any restrictions?
Yes, unfortunately there are some.
The most important one is, that art.ini debris can only explode when they hit the ground. It is not possible to create a debris that explodes in midair. It can only end its animation in midair if the end frame is reached, but will then not use ExpireAnim or any damage.
This is especially important to keep in mind, if you plan to give an explosion with art.ini debris to an anti-air weapon. Due to the debris logic, the debris explosion won't appear in midair, but instead on the ground under the aircraft.

Another one is, that the debris will always create a water splash if they hit water. If they hit water, the debris will also not use the ExpireAnim and also don't spawn any other debris.

Key Words: #Tutorials #Modding #TiberianSun #Firestorm #Art.INI 

_________________
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 [1 Post] View previous topic :: View next topic
 Forum index » Modding Central » Tiberian Sun Editing Forum » Tutorials Factory
Jump to:  
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

Wildcard SSL Certificates
[ Time: 2.4317s ][ Queries: 11 (2.3108s) ][ Debug on ]