I am applying this script to various items, but there are two broken lines of code:
llGiveMoney(reciever,campmoney);
I don't want to post the entire script here, but if anyone can help me finger this out, I'll be most obliged!
These forums are CLOSED. Please visit the new forums HERE
Camping script busted |
|
|
Davin Romano
jerk
Join date: 21 Mar 2008
Posts: 384
|
04-16-2008 12:35
I am applying this script to various items, but there are two broken lines of code:
llGiveMoney(reciever,campmoney); I don't want to post the entire script here, but if anyone can help me finger this out, I'll be most obliged! |
|
Borat Kungler
Registered User
Join date: 13 Apr 2007
Posts: 33
|
04-16-2008 12:43
Are you requesting and granting debit permissions? llGiveMoney wont function without it.
llRequestPermissions(llGetOwner(), PERMISSION_DEBIT) |
|
Ordinal Malaprop
really very ordinary
Join date: 9 Sep 2005
Posts: 4,607
|
04-16-2008 13:07
I have to say that it will be pretty much impossible to diagnose your scripting issue without seeing just a tad more of said script.
_____________________
http://ordinalmalaprop.com/forum/ - visit Ordinal's Scripting Colloquium for scripting discussion with actual working BBCode!
http://ordinalmalaprop.com/engine/ - An Engine Fit For My Proceeding, my Aethernet Journal http://www.flickr.com/groups/slgriefbuild/ - Second Life Griefbuild Digest, pictures of horrible ad griefing and land spam, and the naming of names |
|
Davin Romano
jerk
Join date: 21 Mar 2008
Posts: 384
|
04-16-2008 13:08
this is what I am getting now:
Bean Bag: NULL_KEY destination for llGiveMoney(). Another wierd thing, even after I removed the script from the object, there is still hovering text.. wth? |
|
Ordinal Malaprop
really very ordinary
Join date: 9 Sep 2005
Posts: 4,607
|
04-16-2008 13:09
(a) It means that your "receiver" key is not being populated for some reason.
(b) Float text is a prim property, so stays until one removes it by using llSetText with an empty string. _____________________
http://ordinalmalaprop.com/forum/ - visit Ordinal's Scripting Colloquium for scripting discussion with actual working BBCode!
http://ordinalmalaprop.com/engine/ - An Engine Fit For My Proceeding, my Aethernet Journal http://www.flickr.com/groups/slgriefbuild/ - Second Life Griefbuild Digest, pictures of horrible ad griefing and land spam, and the naming of names |
|
Davin Romano
jerk
Join date: 21 Mar 2008
Posts: 384
|
04-16-2008 13:13
I have to say that it will be pretty much impossible to diagnose your scripting issue without seeing just a tad more of said script. I guess I should post the whole thing, since I found it googling LSL camping anyway.. integer campmoney = 0; integer campadd = 1; integer camptime = 900; string reciever; default { state_entry() { llRequestPermissions(llGetOwner(),PERMISSION_DEBIT ); llSetText("Get Paid to Chill!,\nL$"+(string)campadd+" every 15 minutes",<0,1,0>,1); llSitTarget(<0, 0, 0>, ZERO_ROTATION); // needed for llAvatarOnSitTarget to work // Note that if both the vector and the rotation are zero, // the SitTarget is removed instead of set and the following will not 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 if (llAvatarOnSitTarget() != NULL_KEY) { // somebody is sitting on me reciever = llAvatarOnSitTarget(); llSetText("Money:"+(string)campmoney,<0,1,0>,1); llSetTimerEvent(camptime); //llSay(0, "Get off!" ;//llUnSit(llAvatarOnSitTarget()); // unsit him } else{ llGiveMoney(reciever,campmoney); reciever=""; campmoney=0; llSetText("Get Paid to Chill!,\nL$"+(string)campadd+" every 15 minutes",<0,1,0>,1); llSetTimerEvent(100000000); } } } timer() { campmoney = campmoney+campadd; llSetText("Money:"+(string)campmoney,<0,1,0>,1); if (llAvatarOnSitTarget() != NULL_KEY) { } else { reciever=""; campmoney=0; llSetText("Get Paid to Chill!,\nL$"+(string)campadd+" every 15 minutes",<0,1,0>,1); llSetTimerEvent(100000000); } } } |
|
Viktoria Dovgal
…
Join date: 29 Jul 2007
Posts: 3,593
|
04-16-2008 13:15
llSitTarget(<0, 0, 0>, ZERO_ROTATION); // needed for llAvatarOnSitTarget to work
That will not work. At least one of the numbers in that vector needs to be nonzero. _____________________
|
|
Ordinal Malaprop
really very ordinary
Join date: 9 Sep 2005
Posts: 4,607
|
04-16-2008 13:18
I imagine that that won't work as
llSitTarget(<0, 0, 0>, ZERO_ROTATION); actually _removes_ the sit target. It has to have a non-zero-vector first component. Something like llSitTarget(<0, 0, 0.01>, ZERO_ROTATION); will do. Also, "receiver" is spelt incorrectly, though that wouldn't actually stop it working. (It is a messy script generally but not inefficiently so.) _____________________
http://ordinalmalaprop.com/forum/ - visit Ordinal's Scripting Colloquium for scripting discussion with actual working BBCode!
http://ordinalmalaprop.com/engine/ - An Engine Fit For My Proceeding, my Aethernet Journal http://www.flickr.com/groups/slgriefbuild/ - Second Life Griefbuild Digest, pictures of horrible ad griefing and land spam, and the naming of names |
|
Davin Romano
jerk
Join date: 21 Mar 2008
Posts: 384
|
04-16-2008 13:25
Something like llSitTarget(<0, 0, 0.01>, ZERO_ROTATION); will do. thx. I set this to 0,0,0.1 and I'm sitting face down now.. I'll fiddle with it until I finger out how to make it look ok.. perhaps I need to place a sitting poseball on the beanbag, and apply the script to that. (b) Float text is a prim property, so stays until one removes it by using llSetText with an empty string. I've tried this a few ways with a new script, but I keep getting a syntax error.. I appreciate the help, guys! I've done html, css, and php for a decade but this is my first time diving into LSL.. seems to be eaasy to pick up tho! |
|
Meade Paravane
Hedgehog
Join date: 21 Nov 2006
Posts: 4,845
|
04-16-2008 13:30
Also, use llSetTimerEvent(0.0) to cancel the timer - don't give it a ginormous number.
_____________________
Tired of shouting clubs and lucky chairs? Vote for llParcelSay!!!
- Go here: http://jira.secondlife.com/browse/SVC-1224 - If you see "if you were logged in.." on the left, click it and log in - Click the "Vote for it" link on the left |
|
Ordinal Malaprop
really very ordinary
Join date: 9 Sep 2005
Posts: 4,607
|
04-16-2008 13:30
llSetText("", ZERO_VECTOR, 0.0) should remove float text from a prim - you can just put that into state_entry, then delete it.
llSitTarget defines both the position and the rotation of whoever sits on the object relative to the prim the script is in, so if that prim is rotated oddly then yes, you could end up sitting in an odd position. The best solution is usually to just rotate the prim back. Alternatively, you can play with the rotation parameter of llSitTarget (the second one) - something like, oh, llSitTarget(<0.0, 0.0, 0.01>, llEuler2Rot(<PI_BY_TWO, 0.0, 0.0> ) - but that does mean knowing a bit about rotations, which are a pig, so I would rotate the prim if I were you._____________________
http://ordinalmalaprop.com/forum/ - visit Ordinal's Scripting Colloquium for scripting discussion with actual working BBCode!
http://ordinalmalaprop.com/engine/ - An Engine Fit For My Proceeding, my Aethernet Journal http://www.flickr.com/groups/slgriefbuild/ - Second Life Griefbuild Digest, pictures of horrible ad griefing and land spam, and the naming of names |
|
Pale Spectre
Registered User
Join date: 2 Sep 2005
Posts: 586
|
04-16-2008 13:32
For the text thing: llSetText("", <0,0,0>, 0);
...I also think: string reciever; should be declared as: key reciever; |
|
Meade Paravane
Hedgehog
Join date: 21 Nov 2006
Posts: 4,845
|
04-16-2008 13:33
I've tried this a few ways with a new script, but I keep getting a syntax error.. The same error you got before?? One thing not mentioned about the sit target is that if you remove it, llAvatarOnSitTarget will _always_ return NULL_KEY, even if there's somebody sitting on the object. _____________________
Tired of shouting clubs and lucky chairs? Vote for llParcelSay!!!
- Go here: http://jira.secondlife.com/browse/SVC-1224 - If you see "if you were logged in.." on the left, click it and log in - Click the "Vote for it" link on the left |
|
Jake24 Numanox
Registered User
Join date: 3 Apr 2008
Posts: 6
|
04-16-2008 14:50
The reason you get a syntax error at llGiveMoney() is because your receiver variable has to be a key, you have it set as a string, so:
instead of: string receiver; use: key receiver; |