Jump to content

Turn On Particles Function In A Linked Prim


joeyblueyes
 Share

You are about to reply to a thread that has been inactive for 351 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

I am trying to turn on and off particles in a linked prim!

I have my "StartFireParticles ()" function in one prim and want to control it from another prim.....

Can't figure out how to call this function from the linked prim!

Any help is appreciated.... Thanks!

Link to comment
Share on other sites

Read here:

LlParticleSystem - Second Life Wiki

a quick example of the llLinkParticleSystem function in a rootprim but targetting another prim to emit the particles -

where the 2 after llLinkParticleSystem is the link number of the prim you want to emit the particles- :

 

llLinkParticleSystem(2, [
        PSYS_PART_FLAGS,       PSYS_PART_WIND_MASK | PSYS_PART_EMISSIVE_MASK,
        PSYS_SRC_PATTERN,      PSYS_SRC_PATTERN_EXPLODE, 
        PSYS_PART_START_COLOR, <1.0, 0.0, 0.0>
    ] );
Link to comment
Share on other sites

51 minutes ago, Emma Krokus said:

Read here:

LlParticleSystem - Second Life Wiki

a quick example of the llLinkParticleSystem function in a rootprim but targetting another prim to emit the particles -

where the 2 after llLinkParticleSystem is the link number of the prim you want to emit the particles- :

 

llLinkParticleSystem(2, [
        PSYS_PART_FLAGS,       PSYS_PART_WIND_MASK | PSYS_PART_EMISSIVE_MASK,
        PSYS_SRC_PATTERN,      PSYS_SRC_PATTERN_EXPLODE, 
        PSYS_PART_START_COLOR, <1.0, 0.0, 0.0>
    ] );

Thanks for that reply, Emma!  

Since my particle script is in the prim where the particles will come from, is it possible to just call my function .....StartFireParticles ()... from another prim??

Something like this??

llLinkParticleSystem( 2,  [ updateParticles() ] );

Link to comment
Share on other sites

Yes, that's the main purpose of the "linked" variants of functions: the ability to make them target a different prim in the linkset instead of just the prim that the script itself is in.

This of course depends on you knowing the link number of the prim you wish to target. There are many ways to do this, but a quick method is to use the example from the llDetectedLinkNumber wiki page. The script there will report the link number of the prim you click on. Give it a try.

  • Like 1
Link to comment
Share on other sites

you'll define the particles parameters and the link number of the target prim for the particles in your updateParticles() user defined function (UDF) - example here:

updateParticles() //this is the "trigger name" for your function
llLinkParticleSystem(2, [ PSYS_PART_FLAGS, PSYS_PART_WIND_MASK | PSYS_PART_EMISSIVE_MASK, PSYS_SRC_PATTERN, PSYS_SRC_PATTERN_EXPLODE, PSYS_PART_START_COLOR, <1.0, 0.0, 0.0> ] );

then in your script event (state_entry, touch, collision whatever), you'll simply need to state the name of the UDF - e.g.

state_entry()

{

updateParticles(); //your function's "trigger name" stated as a command to run the UDF

}

Edited by Emma Krokus
Link to comment
Share on other sites

3 hours ago, Emma Krokus said:

Read here:

LlParticleSystem - Second Life Wiki

a quick example of the llLinkParticleSystem function in a rootprim but targetting another prim to emit the particles -

where the 2 after llLinkParticleSystem is the link number of the prim you want to emit the particles- :

 

llLinkParticleSystem(2, [
        PSYS_PART_FLAGS,       PSYS_PART_WIND_MASK | PSYS_PART_EMISSIVE_MASK,
        PSYS_SRC_PATTERN,      PSYS_SRC_PATTERN_EXPLODE, 
        PSYS_PART_START_COLOR, <1.0, 0.0, 0.0>
    ] );

Thanks again Emma,

I do understand that.  My particle script is a lot and was just hoping to call it from another prim with just the function call....

Maybe I'm just not explaining it right....

 

Link to comment
Share on other sites

54 minutes ago, joeyblueyes said:

llLinkParticleSystem( 2,  [ StartFireParticles () ] );

But I get a "name not defined" error

Seems I missed the last portion of your previous post. That code probably isn't working because "StartFireParticles ()", is not the correct way to call a function - the space between the function and the () is the issue. But also, unless StartFireParticles() returns a list, that probably isn't going to do what you want either.

46 minutes ago, joeyblueyes said:

My particle script is a lot and was just hoping to call it from another prim with just the function call....

You cannot call user defined functions that exist in other scripts - a script only knows about what is within itself. You could have it be triggered via chat commands, either from yourself, or another script - but then you'd need to alter the particle script to support listening for said chat commands.

Edited by Fenix Eldritch
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 351 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...