Perwin Rambler
Registered User
Join date: 24 Mar 2005
Posts: 152
|
04-18-2005 11:06
I have a object that I made listen to the owner and depending on the commands I give it, it will produce different particles.
Now It works fine but I gave a copy of the item to a friend, (No copy, No modify) but it will not listen to them.
I was told about a reset option in the script but all attempts have met with syntax errors.
any help would be appreciated.
|
Catherine Omega
Geometry Ninja
Join date: 10 Jan 2003
Posts: 2,053
|
04-18-2005 11:15
You want to add an on_rez event like so: on_rez(integer start_param) { llResetScript(); }
|
Perwin Rambler
Registered User
Join date: 24 Mar 2005
Posts: 152
|
thanks but...
04-18-2005 11:21
I was given a bit of code only a little bit different then that but they both give me a syntax error.
I can't quite figure out why yet. Could there be something that the on_rez needs?
|
Catherine Omega
Geometry Ninja
Join date: 10 Jan 2003
Posts: 2,053
|
04-18-2005 11:30
Is it possible you're attempting to put the on_rez event inside another event or function or outside a state? It should look similar to this: default { state_entry() { llListen(0,"",llGetOwner(),""); } listen(integer channel, string name, key id, string message) { if (message == "hello") { llSay(0,"Hello."); } } on_rez(integer start_param) { llResetScript(); } } Note that it doesn't matter the order in which your events (state_entry, listen, on_rez) go, but that they all must be within a single set of braces (curly brackets) inside the state (default). Does that make sense?
|
Perwin Rambler
Registered User
Join date: 24 Mar 2005
Posts: 152
|
ahh!!!
04-18-2005 11:41
Yes!!! ok, it does make sence.
One of those little pesky brackets got past me. Pollock+3-4 hours sleep+lots of code= poorcode!
ya'll are the best! Thanks
|
lmho Impfondo
Registered User
Join date: 7 Apr 2005
Posts: 31
|
04-18-2005 16:29
alternately you can set up an initialization function in your state_entry event. call init(), which would include something like this:
key init() { return llGetOwner(); }
state_entry() { key owner = init(); llListen(0, "", owner, ""); }
it might be useful to do this for various reasons, if you wanted data or settings to persist through owner changes. Unless i'm sadly mistaken, this will work. but i might be sadly mistaken. Please correct my wrongness.
|