Not signed in (Sign In)

Vanilla 1.1.4 is a product of Lussumo. More Information: Documentation, Community Support.

    •  
      CommentAuthorsintrenton
    • CommentTimeOct 13th 2007 edited
     # 1

    I have always found the Bare Bones, the Particle lab of Teal a very good resource.
    This one is a bit modified from the original script, to make a "reasonable" candle flame. (My old candle sputtered like a drunken flamethrower).
    In addition I added that if you click on the prim, apart from the flame, it also gives off light (lines 59 to 66), which I thought was sort of a logical combination.

    // The BARE BONES Particle Script, Vers 4.0 - 10/23/2006 - Jopsy Pendragon // A sample script from the Particle Laboratory of Teal // You may copy, mod, sell, spindle, mutilate this script as you please. // If you distribute MOD derivatives of this script please include // a mention of The Particle Lab of Teal in the comments. Thanks! :) // Script will use the first texture from the prim's inventory, if it can. // For definitions, min/max values and special rules see below. // (Most parameters are already set to their 'default' value.) // // Copy and paste the contents of this notecard into your own script, // so that your name will be in the Creator field for the script! :) integer bLight=FALSE; list My_Particle_Def; default { state_entry() { My_Particle_Def = [ PSYS_SRC_TEXTURE, llGetInventoryName(INVENTORY_TEXTURE, 0), PSYS_PART_START_SCALE, <.05,.18, 0>, PSYS_PART_END_SCALE, <.05,.18, 0>, PSYS_PART_START_COLOR, <1,0.5,0>, PSYS_PART_END_COLOR, <0.9,0.9,0>, PSYS_PART_START_ALPHA, .8, PSYS_PART_END_ALPHA, .0, PSYS_SRC_BURST_PART_COUNT, 25, PSYS_SRC_BURST_RATE, 0.01, PSYS_PART_MAX_AGE, .5, PSYS_SRC_MAX_AGE, 0.0, PSYS_SRC_PATTERN, 8, // 1=DROP, 2=EXPLODE, 4=ANGLE, 8=ANGLE_CONE, PSYS_SRC_ACCEL, <0.0,0.0,0.5>, // PSYS_SRC_BURST_RADIUS, 0.0, PSYS_SRC_BURST_SPEED_MIN, .01, PSYS_SRC_BURST_SPEED_MAX, .01, PSYS_SRC_ANGLE_BEGIN, 1*DEG_TO_RAD, PSYS_SRC_ANGLE_END, 1*DEG_TO_RAD, // PSYS_SRC_OMEGA, <0,0,0>, // PSYS_SRC_TARGET_KEY, llGetLinkKey(llGetLinkNum() + 1), PSYS_PART_FLAGS, ( 0 | PSYS_PART_INTERP_COLOR_MASK | PSYS_PART_INTERP_SCALE_MASK | PSYS_PART_EMISSIVE_MASK | PSYS_PART_FOLLOW_VELOCITY_MASK // | PSYS_PART_WIND_MASK | PSYS_PART_BOUNCE_MASK // | PSYS_PART_FOLLOW_SRC_MASK // | PSYS_PART_TARGET_POS_MASK // | PSYS_PART_TARGET_LINEAR_MASK ) ]; llParticleSystem ( [ ] ); // Particles OFF at startup. } touch_start(integer total_number) { if (bLight==TRUE) { llSetPrimitiveParams([PRIM_POINT_LIGHT, FALSE, <0.9, 0.7, 0.3>, 1.0, 13.0, 0.00]); bLight=FALSE; llParticleSystem ( [ ] ); } else { llSetPrimitiveParams([PRIM_POINT_LIGHT, TRUE, <0.9, 0.7, 0.3>, 1.0, 13.0, 0.00]); bLight=TRUE; llParticleSystem ( My_Particle_Def + [] ); } } timer() { llParticleSystem ( [ ] ); llResetScript(); } }
    •  
      CommentAuthorsintrenton
    • CommentTimeOct 13th 2007 edited
     # 2

    The next thing I am trying to add is

    llParticleSystem
    then
    ( space
    [ space
    ] space
    )
    ;

    Writing without spaces gives the same effect. Not sure if it is the ( [ ] ) or the ; that is the culprit.

  1.  # 3

    You need to close this statement:

    llParticleSystem( [ ] 0; // Particles OFF at startup.

    •  
      CommentAuthorsintrenton
    • CommentTimeOct 13th 2007
     # 4

    Ok, it should be updated to the correct one, thanks for the help.

    Does this mean we have a built in quality control in the posting? ;)

  2.  # 5

    Well, I admit that I have my automatic parsing systems watching every post...

    ...or it could perhaps be something to do with either some very poor behaviour from my hosts, or there are some odd formatting issues there. You seem to have a lot of functions ending in 0 where I would expect a ). Did you mean to do that?

    •  
      CommentAuthorsintrenton
    • CommentTimeOct 14th 2007 edited
     # 6

    Well, they were not originally intended.

    Thing is, I can't write "llParticleSystem ( space [ space ] space );" without getting an error message when I try to save the code after an edit.

    I was a bit wondering about Jesse's post, wether he saw a 0 where I see a ) or if his post was the correct one. Which means that the correct code should be
    llParticleSystem( [ ] 0; (Since I don't an errormessage when trying to save).

    Problem is that the same goes for every "llParticleSystem ( space [ space ] space );", where I myself expected to have ) instead 0. Everytime I try to change one of them and save, the result is an error message. If I write 0 instead of ), everything is saved just fine.

  3.  # 7

    I am getting that error message as well now, but I have posted things with square brackets before, for example

    default { touch_start(integer n) { llGiveInventoryList(llDetectedKey(0), "Wonderful Shop Things", ["A Notecard", "A Landmark", "A Free Gift"]); } }
    •  
      CommentAuthorsintrenton
    • CommentTimeOct 14th 2007 edited
     # 8

    My first post didn't contain any square brackets, if I remember correctly, but the script above does, and it still worked. Up to that point, at least.

    And this one seems to work, too:

    integer bLight=FALSE; default { touch_start(integer total_number) { if (bLight==TRUE) { llSetPrimitiveParams([PRIM_POINT_LIGHT, FALSE, <0.9, 0.7, 0.3>, 1.0, 13.0, 0.00]); bLight=FALSE; } else { llSetPrimitiveParams([PRIM_POINT_LIGHT, TRUE, <0.9, 0.7, 0.3>, 1.0, 13.0, 0.00]); bLight=TRUE; } } }

    In the past (in the 90's, I admit), sometimes cut & paste could give you problems, since Win is using ASCII by default and not UTF-8. I have no idea if that would be the case here. Haven't met it in close to a decade and even when not copying, but writing the code straight into the post, I got the same error.

  4.  # 9

    <blockquote><cite>Posted By: sintrenton</cite>I was a bit wondering about Jesse's post, wether he saw a 0 where I see a )</blockquote>

    I saw what Ordianl saw which was a 0 instead of a closing bracket.

    Does seem as though your computer is putting out a font that neither the website here, reads correctly, or the script window in world. I might suggest downloading LSLEditer and trying it there and see what happens when you get it to check syntax. With it's autocomplete option it might just allow you to work around the problem. Either that or try posting the code into lslint and see what it says.

    ooooops! Hey Ordinal, quote isn't working correctly.

    But using the old QUOTE in brackets with bbcode works fine. I tried it with Markdown enabled also and it won't format the auto quote settings either

  5.  # 10

    Oh gawd, the whole thing is falling apart now. Actually, that quote button seems to just generate HTML code, rather than code appropriate for your format setting... I shall take a look to see if there is a better one anywhere.

  6.  # 11
    llParticleSystem ([]);
  7.  # 12
    Posted By: Ordinal Malaprop

    Oh gawd, the whole thing is falling apart now. Actually, that quote button seems to just generate HTML code, rather than code appropriate for your format setting... I shall take a look to see if there is a better one anywhere.

    Well, I've fixed the quote button anyway. I could only replicate Mr Trenton's problem by pasting his own code in, rather than writing my own. Infuriating.

  8.  # 13
    Posted By: Ordinal Malaprop llParticleSystem ([]);

    Aha! I have worked it out. Apparently anything with

    system ();

    (remove the space) causes that server error. Eh???? Clearly there is something horribly wrong there - I shall try disabling the extensions one by one.

  9.  # 14

    Well, I can't get it to go away, even by removing every extension. I shall query this on the Vanilla forums.

    Until that point, the error is avoidable by simply putting a space between llParticleSystem and the first bracket. According to lslint, this is not a syntax error and will still compile, though I am not sure whether this is true or not (and cannot check).

    •  
      CommentAuthorsintrenton
    • CommentTimeOct 14th 2007
     # 15
    Posted By: Ordinal Malaprop

    the error is avoidable by simply putting a space between llParticleSystem and the first bracket. According to lslint, this is not a syntax error and will still compile, though I am not sure whether this is true or not (and cannot check).

    I have put space in the code in the first post and it works, so everything should be all green in that one. I also tried to compile the script inworld and it worked as well.

  10.  # 16

    Good show. I have placed this in the new Sticky Introductory Thread With All Important Information In It, but there is obviously an error somewhere along the line there, and I will try to get it fixed.

    Sorry to make such a mess on your example thread....

    •  
      CommentAuthorsintrenton
    • CommentTimeOct 14th 2007
     # 17

    No worries about the mess, glad we caught this one "early". :)

    At the end of the script, there are some comments on the particles, mainly a very simple guide on the different variables. I was thinking of posting them here as well, in a more readable format, i.e. without the //.
    Of course those comments are more than basic for anyone moderately proficient in scripting, but 1. maybe they are of some assistance to newer scripters and 2. I have learned never to underestimate instructions. I like this forum and is looking forward to it growing, and being useful for scripters at any level.

    Opinions on this, anyone?

  11.  # 18

    The more information the better, I say.

    •  
      CommentAuthorsintrenton
    • CommentTimeOct 15th 2007 edited
     # 19

    I agree.

    These are the notes added at the bottom of the original script, edited for better readability in this forum:

    Particle appearance settings

    TEXTURE, can be an "Asset UUID" key copied from a modable texture, or the name of a texture in the prim's inventory.
    SCALE, vector's x and y can be 0.0 to 4.0. z is ignored. Values smaller than 0.04 might not get rendered.
    END_SCALE requires the INTERP_SCALE_MASK
    COLOR, red,green,blue values from 0,0,0(black) to 1,1,1 (white)
    ALPHA, 0.0 = invisible, less than 0.1 may not get seen, 1.0 = solid/opaque
    END_COLOR and END_ALPHA both require INTERP_COLOR_MASK

    Emitter controls

    BURST_PART_COUNT 1 to 4096
    BURST_RATE 0.0 to 60.0? # of seconds between bursts, smaller = faster
    PART_MAX_AGE, 0.0 to 30.0, particle lifespan in seconds
    SRC_MAX_AGE - emitter auto-off interval 0.0 never times out. 1.0 to 60.0.

    Placement and movement settings

    PATTERN,
    - DROP, no initial velocity, direction or distance from emitter
    - EXPLODE, spray in all directions
    - ANGLE, "fan" shape defined by ANGLE BEGIN and END values
    - ANGLE_CONE, "ring" or "cone" shapes defined by ANGLE BEGIN and END values

    ACCEL, x,y,z 0.0 to 50.0? sets a constant force, (affects all patterns)

    RADIUS 0.0 to 50.0? distance from emitter to create new particles
    (Useless with DROP pattern and FOLLOW_SRC option)

    SPEED, 0.01 to 50.0? Sets range of starting velocities. (Useless with DROP pattern.)

    ANGLE_BEGIN & END, 0.0 (up) to PI (down), (Only useful with ANGLE patterns)

    OMEGA, x,y,z 0.0 to PI? Sets distance to rotate emitter nozzle between bursts
    (Only useful with ANGLE patterns)

    TARGET_KEY, "key", (requires a TARGET option below) can be many things :
    - llGetOwner()
    - llGetKey() target self
    - llGetLinkKey(1) target parent prim
    - llGetLinkKey(llGetLinkNum() + 1) target next prim in link set

    On/off options that affect how particles look

    EMISSIVE identical to "full bright" setting on prims
    FOLLOW_VELOCITY particle texture 'tilts' towards the direction it's moving
    INTERP_COLOR causes color and alpha to change over time
    INTERP_SCALE causes particle size to change over time

    On/off options that affect how particles move

    BOUNCE particles can't go below altitude of emitter
    WIND sim's wind will push particles around
    FOLLOW_SRC makes particles move (but not rotate) if their emitter moves, (disables RADIUS)
    TARGET_POS causes particles to home in on a target object
    TARGET_LINEAR forces a DROP pattern like behavior and disables wind.

  12.  # 20

    I find that the key to a good particle effect is three things:
    1) fine tuning of the numbers
    2) more than one PSYS combining to appear as one effect.
    3) a known stable particle testing environment... a sim where there is no other particle emitters, and a client that has been restarted since the last time someone rezzed a massively excessive 'nuke' particle system in your presence. Then when its done, go and check how it looks in a sim with some other well designed particles (those which don't operate under the principle of 'more is better, even if it's so many they cant be rendered").

    here is an extract of a match i made.
    The UUID and its associated texture is a core part of the appearance of this...and no, i havent tested them independently of the original object,.. so i'm just hoping i copied out the correct sections :]
    ---------- match main flame---------------
    llParticleSystem([
    PSYS_PART_FLAGS , 0
    | PSYS_PART_WIND_MASK
    | PSYS_PART_INTERP_COLOR_MASK
    | PSYS_PART_INTERP_SCALE_MASK
    // | PSYS_PART_FOLLOW_SRC_MASK
    | PSYS_PART_FOLLOW_VELOCITY_MASK
    | PSYS_PART_EMISSIVE_MASK
    ,PSYS_SRC_PATTERN, PSYS_SRC_PATTERN_ANGLE_CONE
    ,PSYS_SRC_TEXTURE, "82969e6a-2844-a27f-52e9-ae43124e56f5"
    ,PSYS_SRC_MAX_AGE, 0.0
    ,PSYS_PART_MAX_AGE, 0.35
    ,PSYS_SRC_BURST_RATE, 0.0
    ,PSYS_SRC_BURST_PART_COUNT, 1
    ,PSYS_SRC_BURST_RADIUS, 0.0
    ,PSYS_SRC_BURST_SPEED_MIN, 0.0
    ,PSYS_SRC_BURST_SPEED_MAX, 0.0
    ,PSYS_SRC_ACCEL, <0.0, 0.0, 8.0>
    ,PSYS_PART_START_COLOR, <0.6, 0.3, 0.0>
    ,PSYS_PART_END_COLOR, <1.0, 1.0, 0.0>
    ,PSYS_PART_START_ALPHA, 0.00
    ,PSYS_PART_END_ALPHA, 0.025
    ,PSYS_PART_START_SCALE, <0.35, 0.5, 0.0>
    ,PSYS_PART_END_SCALE, <0.3, 1.25, 0.0>
    ,PSYS_SRC_ANGLE_BEGIN, 0.0
    ,PSYS_SRC_ANGLE_END, PI
    ,PSYS_SRC_OMEGA, <0.0, 0.0, 0.0>
    ]);

    ---------- match sub-flame---------------
    llParticleSystem([
    PSYS_PART_FLAGS , 0
    | PSYS_PART_WIND_MASK
    | PSYS_PART_INTERP_COLOR_MASK
    | PSYS_PART_INTERP_SCALE_MASK
    // | PSYS_PART_FOLLOW_SRC_MASK
    | PSYS_PART_FOLLOW_VELOCITY_MASK
    | PSYS_PART_EMISSIVE_MASK
    ,PSYS_SRC_PATTERN, PSYS_SRC_PATTERN_ANGLE_CONE
    ,PSYS_SRC_TEXTURE, ""
    ,PSYS_SRC_MAX_AGE, 0.0
    ,PSYS_PART_MAX_AGE, 0.9
    ,PSYS_SRC_BURST_RATE, 0.1
    ,PSYS_SRC_BURST_PART_COUNT, 1
    ,PSYS_SRC_BURST_RADIUS, 0.0
    ,PSYS_SRC_BURST_SPEED_MIN, 0.0
    ,PSYS_SRC_BURST_SPEED_MAX, 0.0
    ,PSYS_SRC_ACCEL, <0.0,0.0,1.0>
    ,PSYS_PART_START_COLOR, <0.0,0.0,0.6>
    ,PSYS_PART_END_COLOR, <1.0,1.0,0.0>
    ,PSYS_PART_START_ALPHA, 0.6
    ,PSYS_PART_END_ALPHA, 0.1
    ,PSYS_PART_START_SCALE, <0.6, 0.6, 0.0>
    ,PSYS_PART_END_SCALE, <0.2, 0.2, 0.0>
    ,PSYS_SRC_ANGLE_BEGIN, 0.0
    ,PSYS_SRC_ANGLE_END, PI
    ,PSYS_SRC_OMEGA, <0.0, 0.0, 0.0>
    ]);

    Also note that if you treat your PSYS code block as a list that requires special consideration, and pack everything, in the right sequence, you can use list functions to make alterations to it on the fly. (and don't need to define everything as a global variable first) ...theres 3 or so lines missing from the examples above, and im not sure its in the right sequence, but look up the wiki on particles and you will find the full list and its correct numeric sequence.