These forums are CLOSED. Please visit the new forums HERE
Sit on to Activate script in child Prim |
|
|
TanyaR Auer
Registered User
Join date: 25 Jun 2007
Posts: 8
|
05-14-2009 16:16
Using a standard touch_start particle emitter (emitting drops of blood). turning it into a candle with dripping wax, but the prob Im running into is the drip starts on rez when I need it to start when an object is sat on. any help, even if pointed in the proper direction will be greatly appreciated.
|
|
Ethari Hallstrom
Registered User
Join date: 4 May 2007
Posts: 14
|
05-14-2009 16:21
You'll need to use the 'changed' event (http://lslwiki.net/lslwiki/wakka.php?wakka=changed), specifically CHANGED_LINK, to detect when someone sits on the object. There is actually a good example on that page that explains to detect when someone sits on it. You can then start and stop your particles from that.
|
|
TanyaR Auer
Registered User
Join date: 25 Jun 2007
Posts: 8
|
Scratching head ...
05-14-2009 17:17
May be I read the wiki wrong or perhaps just didnt read it right .. does this go in the particle script that is in the child prim?
|
|
TanyaR Auer
Registered User
Join date: 25 Jun 2007
Posts: 8
|
Syntax Error
05-14-2009 17:44
Adding this:
{ state_entry() { llSitTarget(<0, 0, 0.1>, ZERO_ROTATION); // needed for llAvatarOnSitTarget to work } changed(integer change) { // something changed if (change & CHANGED_LINK) { // and it was a link change // llSleep(0.5); // llUnSit works better with this delay key av = llAvatarOnSitTarget(); if (av) { // somebody is sitting on me llSay(0, "Get waxed!" ;} gives me a Syntax error with this line: } touch_start(integer total_number) { |
|
ashtangajoy Kanya
Registered User
Join date: 27 Jan 2009
Posts: 11
|
missing bracket
05-15-2009 06:54
it looks as if you are missing a bracket for an IF - harder to see in forum without indentation. I always think that the style placing first bracket on same line as finction or IF or whatever, is not helpful and , personally , would always go for first bracket on next line in column of first letter and then last bracket in same column as first - visually much clearer in my view
![]() |
|
ashtangajoy Kanya
Registered User
Join date: 27 Jan 2009
Posts: 11
|
and more
05-15-2009 07:00
I suppose changed( ) must register change of avatar linking and so must be in prim which is being sat on. Then can particle system change be trigggered from that changed( ) content? I imagine so but not sure of your details
|
|
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
|
05-15-2009 09:36
please use php tags, if you can't SEE php tags see my sig below for links to enable most bbcode on the forums here....
CODE
this will cause the scrip to active only when people sit on it (and reactivate for each sitter) and turn off when no one is sitting on it (if you see the tags, and not the indents, hit quote to see the indenting) _____________________
|
| . "Cat-Like Typing Detected" | . This post may contain errors in logic, spelling, and | . grammar known to the SL populace to cause confusion | | - Please Use PHP tags when posting scripts/code, Thanks. | - Can't See PHP or URL Tags Correctly? Check Out This Link... | - |
|
TanyaR Auer
Registered User
Join date: 25 Jun 2007
Posts: 8
|
Thank you!!!
05-15-2009 18:10
Thanks you all.. couldnt find the missing bracket, then again im not the brightest in the worlds smartest .. but the php is the bomb .. seriously thanks to everyone for taking the time to help me.
MUCH APPRECIATED!!! lil miss peaches! |
|
ashtangajoy Kanya
Registered User
Join date: 27 Jan 2009
Posts: 11
|
missing brackets
05-17-2009 02:43
unless there is a typo in your posting I can see 3 left curly brackets but only 2 right curly brackets. Are my eyes playing me up?
CODE
|
|
Sophia Debevec
Registered User
Join date: 26 Mar 2007
Posts: 27
|
05-19-2009 12:01
CODE
|