Home   Help Search Login Register  

Author Topic: animated textures for drop-particles  (Read 3734 times)

0 Members and 2 Guests are viewing this topic.

Offline remcen

  • Contributing Member
  • **
  • a.k.a. hottentotten_mike
    • IM:UC
animated textures for drop-particles
« on: 28 May 2005, 01:04:54 »
i know basically how to make animated textures, but all i've done so far in this field is a new muzzle flash for my bmd-1 - that worked fine.

what i want to do now is to add an animated texture to a new particle (shall become: little gnat particle with animated wings ;)). i have three different textures named mosquito.00.paa to 02.paa, i made the new particle, put it all ingame with a little script, but the wings are not moving hence the texture is not animated.

my questions: are animated textures resctricted to muzzle flashs? (guess not... ???)
if not, are they restricted to any other type of model/vehicle? (config entry for particles? - haven't seen any yet)
and finally: how do i solve this to have my little mosquitos spread their wings?
we're looking for members: IM:UC MOD

Offline RujiK

  • Members
  • *
  • KoKo Puh-Fizzles!
Re:animated textures for drop-particles
« Reply #1 on: 28 May 2005, 04:32:36 »
I have no idea, however how did you make a custom texture drop?

Ask a question and get asked one... Not what you wanted im sure.
I like your approach, lets see your departure.
Download the New Flashlight Script!

Offline remcen

  • Contributing Member
  • **
  • a.k.a. hottentotten_mike
    • IM:UC
Re:animated textures for drop-particles
« Reply #2 on: 28 May 2005, 10:52:33 »
hehe - the three standard drop effects are the only models that are solely designed for being drop-effected.
in fact you can have little tanks come up from the ground, inflated them and finally burst them in mid air for example - the drop command is completely free concerning what model you take. instead of cl_basic you can insert abrams for example or of course your own particle. NB. always without the p3b suffix!
to make a new one make a two-sided plane, texture it, pbo it and off you go ;)
(btw. would anyone try this inflated&burst tank thing for a LSD-trip cutscene? ;D)

take a look at vektorboson's tut on the drop command for more info:  here.

ok now what about my problem, mates ??? any specialist in animated textures around?

 
« Last Edit: 28 May 2005, 10:53:36 by remcen »
we're looking for members: IM:UC MOD

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:animated textures for drop-particles
« Reply #3 on: 28 May 2005, 11:25:29 »
Have you tried looking at the cfgCloudlets section in the game config, it might hold some clues for you.


Planck
I know a little about a lot, and a lot about a little.

Offline remcen

  • Contributing Member
  • **
  • a.k.a. hottentotten_mike
    • IM:UC
Re:animated textures for drop-particles
« Reply #4 on: 28 May 2005, 11:46:14 »
errr no, there you find how the cloudlets that appear when a shell hits the ground shall behave, right? and only the standard particles are used there, namely cl_basic, cl_water and cl_fire.
no, this is not about how a particle is animated/moved/etc. but how i get animated textures working on particles - meaning a sequence of three textures.
we're looking for members: IM:UC MOD

Lean Bear

  • Guest
Re:animated textures for drop-particles
« Reply #5 on: 28 May 2005, 12:06:19 »
I don't really understand the question.

Do you want the plane the textures are on to be animated, or just the textures on a fixed plane?

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:animated textures for drop-particles
« Reply #6 on: 28 May 2005, 12:20:29 »
I know one object that has animated textures, however they never seem to work, it was maybe never fully implemented.

kasna.p3d.......the fountain has kasna_voda.01 as a texture and there are are further 5 textures in that sequence.....up to .06.

I can see nothing in the p3d model that implements the animation, which leads me to suspect that it was never finished, or, if it is working, it is handled by the game engine.

Having said all that, it does have animated=0 and animPeriod =1.33 in its config entry.

kasna_new which came with Resistance, has animPeriod=2.
And they both use simulation 'fountain'

I don't know if any of that info is useful to you, but personally I suspect it is the game engine that would handle that sort of thing, if it works fully at all.


Planck
I know a little about a lot, and a lot about a little.

Lean Bear

  • Guest
Re:animated textures for drop-particles
« Reply #7 on: 28 May 2005, 12:25:15 »
If what Planck is saying is what you want, then I'd recommend you take a look at the FDF Northern Lights script.

That is a simple plane up in the sky, which uses drop to create an animated texture of the northern lights.

It looks perty too :D

If you don't have FDF and don't want to d/l it - I can post some snippits of the code for you.

Offline remcen

  • Contributing Member
  • **
  • a.k.a. hottentotten_mike
    • IM:UC
Re:animated textures for drop-particles
« Reply #8 on: 28 May 2005, 16:27:58 »
@lean bear:  the drop command itself is not the problem. what i want is not about changing the size, colour, opacity or whatever, but to apply an animated texture to a fixed plane. i know this works somehow - i just don't know how exactly. for the muzzle flash of my bmd-1 it worked perfectly. imagine animated textures like a .gif-animation which is not stored in one file but consists - in the case of ofp - of two or more single files numbered from texture.00.paa to texture.0n.paa

planck knows what i mean - there are some examples, like the muzzle flash the water texture, that fountain, and i think seb müller's dune buggy had an animated fan which was done with animated textures as well afaik.
will unpack the buggies asap and let you know what i find out.

oh yes, and i remember - long ago - there was a tutorial on how to do this, not here on ofpec, but on some mod's page. i searched for it for hours but couldn't find it. if someone has the link...  thanks ;)  
we're looking for members: IM:UC MOD

DBR_ONIX

  • Guest
Re:animated textures for drop-particles
« Reply #9 on: 28 May 2005, 16:35:11 »
The most obvious example of animated textures is the night-vision, no?
Maybe someone could try adding .07 .08 etc, and see if the game looks at them?
- Ben

Offline remcen

  • Contributing Member
  • **
  • a.k.a. hottentotten_mike
    • IM:UC
Re:animated textures for drop-particles
« Reply #10 on: 28 May 2005, 16:42:11 »
yeah, right, i forgot that example.
that's what i've done. i textured the plane with mosquito.00.paa and named the other ones mosquito.01.paa and mosquito.02.paa (i also tried .01.paa to .03.paa btw ) - it doesn't work, that's my problem as i wrote in my first post in this thread.
« Last Edit: 28 May 2005, 16:43:34 by remcen »
we're looking for members: IM:UC MOD

Lean Bear

  • Guest
Re:animated textures for drop-particles
« Reply #11 on: 28 May 2005, 19:22:30 »
@ remcen

Yeah, that's what I was trying to get at.

Here's how I always do it:

1. Make you textures (which you've done) and name them in the following format:

name.01.paa

btw It always starts with 01 not 00 (might be part of the problem). Also, although I don't know if its necessary, try to keep the names short - it seems to work better for me.

2. Make the .p3d file - a simple plane. Name it something different to the textures (eg. if your textures are: tex.01, tex.02 etc. call your .p3d something like texture.p3d)

3. Write the script using the drop command.

An example:

btw you'll either need a different script, or a different part of a script to do this. You can't make the paticle for the gnat and animate the wings using the same drop.

#Loop

drop ["YourAddonFolder\moswing", "", Billboard, ~~~etc.~~~~]

goto "Loop"


Follow these simple steps and it should work :) . You might not want it to be a "billboard" type though.

edit

The script is probably the most important bit. If the animation isn't timed right, you aint gonna see nowt.
« Last Edit: 28 May 2005, 19:24:46 by Lean Bear »

Offline remcen

  • Contributing Member
  • **
  • a.k.a. hottentotten_mike
    • IM:UC
Re:animated textures for drop-particles
« Reply #12 on: 29 May 2005, 14:19:53 »
i just had a look at the data folder and saw that the textures for the cl_water and the cl_basic particles also have these animated textures (starting with basic.06.paa for cl_basic - odd enough).

however, when you drop-create these particles only one texture is displayed hence the texture animation does not work. first i thought that the animationname parameter is responsible for this, but this is not the case. so i think there is no way to get this working.

i don't know if that applies to drop-created particles only or to all particles including those created by defining a new cfgcloudlets class, fireplace or whatever.

btw. what's the animationname parameter for? in the official command reference it reads "Name of the animation of the shape" and by shape the 3d object is meant obviously. vektorboson's tut says that is must be a classname...
but this parameter is mostly left empty as far as i know.

@lb.
Quote
btw you'll either need a different script, or a different part of a script to do this. You can't make the paticle for the gnat and animate the wings using the same drop.
this confuses me. the animations are done by the textures here and should display automatically...
« Last Edit: 29 May 2005, 14:24:40 by remcen »
we're looking for members: IM:UC MOD

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:animated textures for drop-particles
« Reply #13 on: 29 May 2005, 14:34:58 »
This is just a pure guess......but possibly the animationname parameter was meant to be for an animation created for a particular  drop particle, which is not used because it was never fully implemented.

Or if there is an anmimation it is entirely handled by the engine using preset defaults.

As I said before, I don't think texture animations is fully implemented, although in some cases it works, i.e. NVG and of course the sea, but the engine handles all that.


Planck
I know a little about a lot, and a lot about a little.

Lean Bear

  • Guest
Re:animated textures for drop-particles
« Reply #14 on: 29 May 2005, 16:05:04 »
remcen,

The animated textures have to be first put on their own particle (a normal 2d plane) and scripted before they can be added on the particle of the gnat.

I've rarely seen animationName actually used, I normally just put
Code: [Select]
"" instead :P

@ Planck

I've seen texture animations work in everything I've tried, from on vehicles to weapons and the sky.

Offline remcen

  • Contributing Member
  • **
  • a.k.a. hottentotten_mike
    • IM:UC
Re:animated textures for drop-particles
« Reply #15 on: 29 May 2005, 20:23:53 »
nono - lean bear, you misunderstand me!
the wings and the mosquito are one texture file, applied to a simple, flat plane. the animation is the sequence of the textures - that does not work.
a grown-out config-scripted animation would be a bit too much for such a tiny, nasty gnat IMO ;)

for a better understanding i've put it all in a separate pbo, together with the script i'd like to use.  see attachment
start the script by placing a trigger on a map, Activation: anybody, OnActivation: [] exec "\mosquito\mosquitos.sqs", then walk straight into the covered zone and the gnats should appear around you ;)

for having a closer look at the mosquito itself put this e.g. in the onactivation field:
Code: [Select]
drop ["\mosquito\mosquito", "", "Billboard", 1,  20, [getpos player select 0 , getpos player select 1, 1], [0,0,0],  1,     1.275,  1,  0, [1,1], [[1,1,1,1], [1,1,1,1], [1,1,1,0.6], [1,1,1,0]], [0],   0,   0,   "",    "",     "player"]
//edit: vektorboson told me that AnimationName stands for an animation class of a vehicle. so if you have a car with openable doors and drop-create it, you can thereby difine if the doors shall be open or not e.g. - if i understood him right.
« Last Edit: 29 May 2005, 20:29:23 by remcen »
we're looking for members: IM:UC MOD

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:animated textures for drop-particles
« Reply #16 on: 29 May 2005, 21:01:33 »
I was looking at kasna.p3d in Oxygen, and especially the face that had the kasna_voda.01.paa applied.

I also looked at the optika_night.p3d and the face that had the night_sum.01.paa applied.

In both cases the user number in the face properties was 1, I'm not even sure if this makes any difference to anything, just thought I would point it out.   ;D

The user number on your 2 faces is 0 btw.


Planck
I know a little about a lot, and a lot about a little.

Lean Bear

  • Guest
Re:animated textures for drop-particles
« Reply #17 on: 29 May 2005, 22:47:00 »
I had a look at the addon.

I'm sure this was just something you missed when you put it in a folder called "mosquito", but the mostquito's looked more like paper ones to me ;)

So, I quickly tidied that up and went back in-game.

The mosquitos looked pretty good, and personally, I don't think it would matter if they were animated or not as they're so small anyway. I'm sure Planck had to squint real hard to see them ;)

But after a while, I was that they weren't animated and just flew around. The problem seems to be in the script. Where you've put "
  • ", the 6th part of the array from the end is actually the most important for the animation to work. Its the animation phase. Set to 0 means no animation :P 1 means animated. So, [0,1] would mean they would start off on whatever texture they're set at (prob mosqu.01.paa) and animate through all the numbers (mosqu.02, mosqu.03 etc.) until it reaches the end. Then it would start again.


I put [0,1,0,1] just to be sure :P

edit

The stupid forum code makes the "0" in between this [ and this ] make it look like this
  • :P


btw I understood a lot better where you were coming from after seeing the addon itself :)
« Last Edit: 29 May 2005, 22:50:54 by Lean Bear »

Offline remcen

  • Contributing Member
  • **
  • a.k.a. hottentotten_mike
    • IM:UC
Re:animated textures for drop-particles
« Reply #18 on: 30 May 2005, 00:44:31 »
YES!! it works - in principle.
replace the [0,1,0,1] by [0,1,2,0,1,2,0,1,2] and it works perfectly for one particle. all three different textures are displayed and the repetition makes the animation faster - and that's the next unsolvable question: a script drop-creating one gnat every 0.1 seconds living for 2 seconds makes ofp crash instantly ;D

but thanks alot to you two guys :D

i'll tweak the script tomorrow, make the animation slower, see what changes to lifetime adds to playability and make the script create the particles only in front of the player.
« Last Edit: 30 May 2005, 00:45:29 by remcen »
we're looking for members: IM:UC MOD

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:animated textures for drop-particles
« Reply #19 on: 30 May 2005, 00:51:58 »
OK......Great

Glad you got it working.  ;D ;D


Planck
I know a little about a lot, and a lot about a little.

Lean Bear

  • Guest
Re:animated textures for drop-particles
« Reply #20 on: 30 May 2005, 12:18:00 »
Glad you got it working :D

I'm surprised [0,1,2,0,1,2,0,1,2] actually works. I didn't think that 2 would be recognised by OFP as 0 = no animation and 1 = animated. What does 2 mean? :P

Offline remcen

  • Contributing Member
  • **
  • a.k.a. hottentotten_mike
    • IM:UC
Re:animated textures for drop-particles
« Reply #21 on: 30 May 2005, 13:19:53 »
it means that the first three textures are displayed as far as i reckon. when i inserted [0,1,2,3] a white plane was displayed when '3' was due-
obviously it has nothing to do with animated or not - even though i also thought it has due to vektorboson's tutorial ;)

i think [0,2] will be enough for my purposes here, cos 0 (=mosquito.01.paa) has the wings in the rear position and 2 (=mosquito.03.paa) has it in the very front position.
i'll post the completed addon here as soon as it is playable. will be also available in one of the next im:uc releases :)

//edit: bummer -- all test with animated textures failed. either game freeze or crashtodesktop.
so i have to use non-animated textures for obvious reasons  :P
« Last Edit: 30 May 2005, 14:01:24 by remcen »
we're looking for members: IM:UC MOD

Lean Bear

  • Guest
Re:animated textures for drop-particles
« Reply #22 on: 30 May 2005, 17:16:11 »
I don't think the [0,1,2,3...etc] will work (probably the cause of the ctds you are experienceing).

I have various animated particle effects that I use in some of my addons with up to 20 animated textures, all of which have worked with merely [0,1,0,1,0,1].

Offline remcen

  • Contributing Member
  • **
  • a.k.a. hottentotten_mike
    • IM:UC
Re:animated textures for drop-particles
« Reply #23 on: 30 May 2005, 20:29:49 »
well... no and yes ;)
1. the CTDs were due to a stupid beginner's mistake of mine: i put a zero in for the timerperiod parameter.
2. first i put an additional texture into the folder which was identical with the first one. i thought the animation needs it to run smoothly. it actually doesn't but it let me wrongly think that something was wrong with the animationphase-array so i changed it to [0,1,2].
it works the same way with [0,1] as LB correctly said. perhaps ofp simply ignores the '2'.
ok, i'll make the mosquitos a bit slower, cos some of them really shoot around like rockets and post the finished mini addon here.
« Last Edit: 30 May 2005, 20:30:34 by remcen »
we're looking for members: IM:UC MOD