OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: RedHouse on 17 Dec 2004, 01:30:21

Title: Particle scripting. What's wrong?
Post by: RedHouse on 17 Dec 2004, 01:30:21
Ok I'm fairly new to the particle side of scripting, I created this line of code to create a particle but it does not work. Can anyone see any errors in this line of code?

All the letters (eg _a, _b, _c) stand for numbers

Drop ["cl_basic","","Billboard",2,15,[_a,_b,_c],[0,0,0],0,_d,0.77,_e,[0.01,0.02,0],[0.1,0,_f],[0],1,0.5,"","",""]

the error is type number expect array. But I can't see where anymore arrays are needed.
Title: Re:Particle scripting. What's wrong?
Post by: Planck on 17 Dec 2004, 01:44:17
Where exactly in there does the error crop up.......I mean where is the '#' placed?


Planck
Title: Re:Particle scripting. What's wrong?
Post by: MI_Fred on 17 Dec 2004, 01:55:01
Hm strange what is that round thingy there? I ... can't ... copy ith! ;D

Anywayho,

Drop ["cl_basic","","Billboard",2,15,[_a,_b,_c],[0,0,0],0,_d,0.77,_e,[0.01,0.02,0],[[[0.1,0,_f]]],
,1,0.5,"","",""]


Missing brackets from the colour array. Ironically I couldn't colour them. grr.
Title: Re:Particle scripting. What's wrong?
Post by: Planck on 17 Dec 2004, 01:56:31
I was wondering about that too.   ;D ;D


Planck
Title: Re:Particle scripting. What's wrong?
Post by: RedHouse on 17 Dec 2004, 02:45:04
Ok i've just relized why theres that round thingy if you type but with a 0 or a o instead of an i you get this

but anyway heres the line of code with an i instead of a 0. I've put the # thing in to show where the error message comes up but being at the end suggests theres nothing wrong with whats in the middle, so what is wrong? Even if you check the disable smilies box you still get the
  • its probably for a bullet point or something



Drop ["cl_basic","","Billboard",2,15,[_a,_b,_c],[0,0,0],0,_d,0.77,_e,[0.01,0.02,0],[[0.1,0,_f]],,1,0.5,"","",""]#

@MI_Fred
It just says generic error
Title: Re:Particle scripting. What's wrong?
Post by: Planck on 17 Dec 2004, 02:52:34
What value does 'i' have.

The color array is supposed to be of the form [Red,Green.Blue,Alpha].........I least that is my understanding.

e.g. [1.0,0.5,0.5,0.0]

Planck
Title: Re:Particle scripting. What's wrong?
Post by: Planck on 17 Dec 2004, 03:03:46
Forgot to mention...........

There is a demo for the drop command in the Editors Depot........Tutorials section.

It uses a dialog for you to change various parameters.......try it out.

Here:
http://www.ofpec.com/editors/browse.php?browsewhat=1&start=50

Drop [] Tutorial by VektorBoson


Planck
Title: Re:Particle scripting. What's wrong?
Post by: MI_Fred on 17 Dec 2004, 03:09:57
If you look closely, or simply copy&paste the line I gave, it should atleast be different, if not even work.

The difference, double brackets in the colour array. See, the colour array has arrays inside it, for the colour and opacity transitions. When you have a shift from a colour to another you'd notice your fault easier:
[[[0.5,0.5,0.5,0.5],[0.5,0.5,0.5,0.5]]]

Atleast with close eye'ing that's what I'd slap you for  ;D

And now I understand the I, or I think I do. You have 1 too many elements... perhaps your trying to use I as a colour?
Drop ["cl_basic","","Billboard",2,15,[_a,_b,_c],[0,0,0],0,_d,0.77,_e,[0.01,0.02,0],[[[0.1,0,_f],]],1,0.5,"","",""]
Now you should see it.
Title: Re:Particle scripting. What's wrong?
Post by: RedHouse on 17 Dec 2004, 03:26:23
maybe i didnt explain what i meant clearly enough the i is a 0 its just if i type a 0 in [] you get

And that part is the AnimationPhase, and i had already d/l the tut, i understand the 4 values in the array [red,green,blue,alpha] alpha is transparancey. but i don't understand what you mean by double brackets
Title: Re:Particle scripting. What's wrong?
Post by: MI_Fred on 17 Dec 2004, 03:37:17
Oh, yea yabb is buggy that way. And makes my task difficult too. For all I know you might already have double brackets there. But try copy&pasting this:
Code: [Select]
Drop ["cl_basic","","Billboard",2,15,[_a,_b,_c],[0,0,0],0,_d,0.77,_e,[0.01,0.02,0],[[0.1,0,0,_f]],[0],1,0.5,"","",""]

Note that you were still missing 1 element from the colour arrays first and only array. b from r g b.

And the code tag helps in this case of yabb.
Title: Re:Particle scripting. What's wrong?
Post by: RedHouse on 17 Dec 2004, 03:45:43
it works! your a geneius. Cheers, thanks alot