Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Remote Particle Issues

Dioxide DeSantis
Registered User
Join date: 2 Feb 2007
Posts: 63
03-13-2008 13:06
Ok so I am at a loss here I am attempting to script a particle system that is controllable by a HUD or remote. However I only get the system to shout some words and the particles do not go on. Its gotta be some stupid thing i forgot of messed up any one have any ideas?

Any help would be appreciated

Thanks

CODE


//Main Prim Code
//Houses the Particle System

list My_Particle_Def;
integer hudChan = -12345;
integer mode = 0;

default {
state_entry() {
My_Particle_Def = [

PSYS_SRC_TEXTURE,
llGetInventoryName
(INVENTORY_TEXTURE, 0),
PSYS_PART_START_SCALE, <0.2, .2, 0>,
PSYS_PART_END_SCALE, <4,4, 0>,
PSYS_PART_START_COLOR, <1,1,1>,
PSYS_PART_END_COLOR, <1,1,1>,
PSYS_PART_START_ALPHA, .8,
PSYS_PART_END_ALPHA, .0,
PSYS_SRC_BURST_PART_COUNT, 500,
PSYS_SRC_BURST_RATE, 0.1,
PSYS_PART_MAX_AGE, 8.5,
PSYS_SRC_MAX_AGE, 0.0,
PSYS_SRC_PATTERN, 2, // 1=DROP, 2=EXPLODE, 4=ANGLE, 8=ANGLE_CONE,
PSYS_SRC_ACCEL, <0.0,0.0,0.2>,
PSYS_SRC_BURST_RADIUS, 3.5,
PSYS_SRC_BURST_SPEED_MIN, 0.01,
PSYS_SRC_BURST_SPEED_MAX, 0.2,
// PSYS_SRC_ANGLE_BEGIN, 18*DEG_TO_RAD,
// PSYS_SRC_ANGLE_END, 0*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

)];
}
state_entry()
{
llListen(hudChan, "", NULL_KEY, "");
}

listen(integer channel, string name, key id, string message)
{ llShout(0, "TESTING SHOUT"); // Shouts a Message
mode = ! mode;
if ( mode ) {
llParticleSystem( My_Particle_Def );
} else {
llParticleSystem( [ ] );
}
}
}



Here is the HUD Control

CODE


//This is the HUD Control For Particles
integer hudChan = -12345;

default
{
touch_start(integer total_number)
{
llSay(hudChan, llGetLinkName(llDetectedLinkNumber(0)));
}
}

Daten Thielt
Registered User
Join date: 1 Dec 2006
Posts: 104
03-13-2008 15:14
ok first thing you have 2 state entrys thats a nono
second of all your listen event needs a handler eg
if(message == "objec";)
Dioxide DeSantis
Registered User
Join date: 2 Feb 2007
Posts: 63
03-14-2008 05:31
From: Daten Thielt
ok first thing you have 2 state entrys thats a nono
second of all your listen event needs a handler eg
if(message == "objec";)



You will have to bear with me this is the first time I have attempted to "build" a script using a touch particle script i had. I wanted to see if I could use a HUD to turn it on and off.

I am trying to learn as I go. :)



So if I take out the state_entry that comes second and add a line like the following am I on the right track?


if(message == "particle";);
llParticleSystem( My_Particle_Def );
}
else {
llParticleSystem( [ ] );
}
ArchTx Edo
Mystic/Artist/Architect
Join date: 13 Feb 2005
Posts: 1,993
03-14-2008 10:21
Your llSay() in the HUD does not appear to be saying anything that the llListen() is set to listen for.

I'm totally baffled by why you have
llGetLinkName(llDetectedLinkNumber(0) in the llSay() call. Why not have it say a simple message like "particles_on"? and have the llListen() call listen for that same message?

A side comment: llSay is only good for a distance of 20 meters, so if you want the HUD command to be heard farther you might want to use llShout in the HUD. llShout can be heard for 100 meters. Your use of llShout in the particle emitter suggests to me that you think the avatar with the HUD may be more then 20 meters away. However please note that llShout will spam everyone within 100 meters with text spam that they may not appreciate.
_____________________

VRchitecture Model Homes at http://slurl.com/secondlife/Shona/60/220/30
http://www.slexchange.com/modules.php?name=Marketplace&MerchantID=2240
http://shop.onrez.com/Archtx_Edo
Debbie Trilling
Our Lady of Peenemünde
Join date: 17 Oct 2006
Posts: 434
03-14-2008 12:13
I just saw this thread 5 mins after completing a Particle HUD System.
Here is a much chopped down version that you can look at as an example...

EDIT:
Just realised that you are not using a dialog menu, and are responding to touch only. Doesn't really matter, the underling principles are the same :)

CODE


// HUD SCRIPT

integer ListenChannel;
integer ShoutChannel = -97531;
key ObjectOwner = "";
list MenuItems = ["Effect1", "Effect2", "Effect3", "Effect4", "Effect5", "Effect6", "Effect7", "Effect8", "Effect9", "StopAll"];

default
{
state_entry()
{
ObjectOwner = llGetOwner();
}

touch_start(integer total_number)
{
integer CommChannel = (-200000 - ((integer)llFrand(12345) * -1));
ListenChannel = llListen(CommChannel, "", ObjectOwner, "");
string MenuText = "OWNER OPERATION MENU: Please make a selection:";
llDialog(ObjectOwner, MenuText, MenuItems + (list)"Close", CommChannel);
}

listen(integer channel, string name, key id, string message)
{
if (llListFindList(MenuItems, (list)message) != -1)
{
llRegionSay(ShoutChannel, message);
}
else if (message == "Close")
{
// let fall thro'
}
else
{
llOwnerSay("Unrecognised menu option");
}
llListenRemove(ListenChannel);
}
}


__________________


CODE


// EMITTER SCRIPT

integer ShoutChannel = -97531;

default
{
state_entry()
{
llParticleSystem([]);
llListen(ShoutChannel, "", "", "");
}

listen(integer channel, string name, key id, string message)
{
if (message == "StopAll")
{
llParticleSystem([]);
}
else if (message == "Effect1")
{
// do effect 1
}
else if (message == "Effect2")
{
// do effect 2
}
// else if etc etc
// {
// }
}
}

_____________________
http://wiki.secondlife.com/wiki/User:debbie_Trilling
Dioxide DeSantis
Registered User
Join date: 2 Feb 2007
Posts: 63
03-15-2008 10:54
Well I decided to scrap that mess i tried to piece together.

So now my only issue is I want the item to be off when i rez it not on. I am sure this is an easy fix like I just have a statement in the wrong place or something?

Thanks again to all helping!

Dioxide
Haplo Voss
Registered User
Join date: 18 Nov 2006
Posts: 137
03-15-2008 11:10
on_rez(integer whatever)
{
llParticleSystem([]);
}

That will stop any particle system that may be running any time you rez it.
Dioxide DeSantis
Registered User
Join date: 2 Feb 2007
Posts: 63
03-15-2008 12:04
From: Haplo Voss
on_rez(integer whatever)
{
llParticleSystem([]);
}

That will stop any particle system that may be running any time you rez it.


Of course
wow that was a duh moment.

Thanks Haplo!