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 Tue Mar 19, 2024 7:22 am
All times are UTC + 0
Advanced debris logic
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
SuperJoe
Commander


Joined: 03 Sep 2009

PostPosted: Sun Sep 30, 2012 4:07 am    Post subject:  Advanced debris logic Reply with quote  Mark this post and the followings unread

If you've ever tried to create some sort of weapon using art.ini debris, you've probably noticed how completely random it can be. You can only define the max amount of debris to spawn with the SpawnCount key, but the minimum cannot be changed. It can be as low as 0, completely stopping your weapon from being used. This simple tutorial will show you how to get rid of the randomness in debris spawning. You will get consistent and guaranteed results with it.

If you aren't familiar with debris logics in art.ini, check this tutorial which covers all the needed keys.


The trick is to never use the Spawns or SpawnCount keys, instead we use the TrailerAnim and TrailerSeperation keys.

To start the spawning, define:

Code:

; Debris spawner 1
[SPAWNER1]
Image=EMPTYANIM         ; INVISO or NULL won't work here
TrailerAnim=DEBRIS1     ; Spawn the 1st set of debris
TrailerSeperation=3     ; This defines how quickly debris is spawned (lower value = faster. Minimum is 1)
Rate=200                ; These can be used to define for how long debris will be spawned
LoopStart=0
LoopEnd=8
LoopCount=1
;Next=                  ; Could be used to play another anim at the site of debris spawning


You need to of course attach this anim to a warhead or somewhere else where it will be played. EMPTYANIM is just an invisible 10 frame animation I have created myself, INVISO or NULL don't seem to work for it. The TrailerAnim will keep spawning / throwing debris around, at the speed defined in TrailerSeperation (lower value = faster spawning). Debris will be spawned for as long as this animation plays (so adjust the rate / loop keys).

Next up the debris itself (this deals the damage):

Code:

; Debris 1
[DEBRIS1]
Image=NULL ;METSMALL    ; Enable for testing
ExpireAnim=SPAWNER2     ; Next debris spawner animation
;Spawns=                ; Don't use these keys for spawning!
;SpawnCount=            ; Don't use these keys for spawning!
Damage=250
DamageRadius=5000
Warhead=AP
Elasticity=0.0
MaxXYVel=24.0
MinZVel=10.0
LoopStart=0
LoopEnd=8
LoopCount=-1
Rate=500
Bouncer=yes


Adjust the damage and other values to your liking. The important key here is ExpireAnim. Attach another debris spawner animation to it, so more debris will be spawned from where the old debris landed.

Code:

; Debris spawner 2
[SPAWNER2]
Image=EMPTYANIM
TrailerAnim=DEBRIS2 ; Spawn the 2nd set of debris
TrailerSeperation=3
Rate=200
Start=0
End=8
;Next=

; Debris 2
[DEBRIS2]
Image=NULL ;METSMALL
ExpireAnim=SPAWNER3 ; Next debris spawner animation
;Spawns=
;SpawnCount=
Damage=250
DamageRadius=5000
Warhead=AP
Elasticity=0.0
MaxXYVel=24.0
MinZVel=10.0
LoopStart=0
LoopEnd=8
LoopCount=-1
Rate=500
Bouncer=yes


If you want more debris spawned, just keep adding more of these spawner / debris pairs. When we get to the final debris:

Code:

[DEBRISX]
Image=NULL ;METSMALL
ExpireAnim=STOPDEBRIS
;Spawns=
;SpawnCount=
Damage=250
DamageRadius=5000
Warhead=AP
Elasticity=0.0
MaxXYVel=24.0
MinZVel=10.0
LoopStart=0
LoopEnd=8
LoopCount=-1
Rate=500
Bouncer=yes

[STOPDEBRIS]
Image=NULL
Damage=0
Warhead=AP
Start=0
End=1
DamageRadius=0



The STOPDEBRIS is needed for the last set of debris to deal damage, since an ExpireAnim is always required for a debris to deal damage. INVISO might work for it too, didn't test it myself.

That should cover it. The Next key can be used on the debris spawner animations to play more animations. That is if you have a big explosion animation, you probably don't want to use the actual animation itself to spawn debris. That would mean it would keep spawning debris until the very last frame, thus damage would keep happening long after the explosion is gone. Instead, give [SPAWNER1] the first few frames of the animation, and give it Next=BIGEXPLOSION. Debris will now be spawned only for the first few frames of BIGEXPLOSION, then the rest animation will play out without spawning any further debris.


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

_________________

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


Joined: 16 Aug 2006
Location: Germany

PostPosted: Sun Sep 30, 2012 7:35 am    Post subject: Reply with quote  Mark this post and the followings unread

INVISO isn't good, as it deals already by default 1 damage. IIRC this was even hardcoded to do 1 damage.

Instead of STOPDEBRIS i would also suggest using EMPTYANIM, so this one is reused and the game doesn't has to load another animation. But this is just my personal opinion. Someone could also say that the few frames of STOPDEBRIS are better working.


A small note for those who use this: Beware that this kind of damage does not work for anti-air and anti-water weaponry!
When used against air, the debris will fall to the ground and do the damage there.
When used against water targets, the debris will only cause a splash in the water and don't do any damage at all.

_________________
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
kenosis
Commander


Joined: 19 Aug 2009
Location: Moscow State University

PostPosted: Mon Oct 01, 2012 4:45 pm    Post subject: Reply with quote  Mark this post and the followings unread

debris cannot damage air units but,can a trailer animation,which always holds its position,damage air units?

_________________
Tired of grabbing my random SHP conversions? Why not learn to create SHPs for yourself?

Back to top
View user's profile Send private message Send e-mail Visit poster's website Skype Account Yahoo Messenger Account
Lin Kuei Ominae
Seth


Joined: 16 Aug 2006
Location: Germany

PostPosted: Mon Oct 01, 2012 5:09 pm    Post subject: Reply with quote  Mark this post and the followings unread

afaik no. The traileranim will do the damage on the ground below it instead.
AFAIK do all the animations simply have no z value and only xy, except for debris of course which unfortunately can only hit ground.

_________________
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.1448s ][ Queries: 11 (0.0072s) ][ Debug on ]