OFPEC Forum
Addons & Mods Depot => OFP - Addons & Mods General => Topic started by: remcen 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?
-
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.
-
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 (http://www.ofpec.com/editors/resource_view.php?id=131).
ok now what about my problem, mates ??? any specialist in animated textures around?
-
Have you tried looking at the cfgCloudlets section in the game config, it might hold some clues for you.
Planck
-
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.
-
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?
-
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
-
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.
-
@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 ;)
-
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
-
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.
-
@ 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.
-
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.
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...
-
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
-
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 "" instead :P
@ Planck
I've seen texture animations work in everything I've tried, from on vehicles to weapons and the sky.
-
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:
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.
-
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 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
btw I understood a lot better where you were coming from after seeing the addon itself :)
-
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.
-
OK......Great
Glad you got it working. ;D ;D
Planck
-
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
-
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
-
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].
-
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.