Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Library: Reverse Camping Chair

Adz Childs
Artificial Boy
Join date: 6 Apr 2006
Posts: 865
02-24-2008 10:09
Frequenly, newbs appear at Boy Scout Camp thinking that there will be camping chairs and free money. I suppose they search for "camp" and "Scout Camp" is a sufficient match. In any case, sometimes there is just no talking them out of it, no way to convince them that this is not the camping paradise they had in mind.
So, I created a Reverse Camping Chair.
It is just like a normal camping chair, except you pay it for the privilege of sitting there. You see, after a certain amount of time the chair unsits you and tells you to pay up! It accepts money. The more you pay, the longer you can sit or continue to sit. The first 2 units of time are free. If you stand up before you balance has ticked down to 0, the balance is lost.

Someone interacting with this chair is supposed to go like this:

Camping chair hovertext says "L$2 for 1 minute".
Person: Ooo a camping chair! money money money
Person Sits on it. Camping chair hovertext says "Money:2".
Person: Ooo yeah 2L already!
60 Seconds pass.
Reverse Camping Chair: Get off!
Reverse Camping Chair: Deposit L$2 to continue using this chair.
Person: *whimper* :(

Based on /15/60/75612/1.html

Place root prim of chair. Adjust sitTarget to match the kind of seat, but be careful not to set the offset field to <0,0,0>.

It's not the best design. I tried to whip it up as quickly as possible. Improvements can be made that reduce code repetition.

From: Fix BBCode
integer initCampMoney = 2;
integer campmoney = 2;
integer campsubtract = 2;
integer camptime = 60;
string reciever;
vector offset = <0.0, 0.0, 0.1>;
rotation rot = <0.0, 0.0, 0.0, 0.0>;

default {
state_entry() {
llSetText("\nL$"+(string)campsubtract+" for 1 minute",<0,1,0>,1);
llSitTarget(offset,rot);
llSetPayPrice(PAY_HIDE, [campsubtract, campsubtract*2, campsubtract*4, campsubtract*8]);
}

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);
if (campmoney <= 0) {
//balance below zero. get out!
llSay(0, "Get off!";);
llUnSit(llAvatarOnSitTarget()); // unsit him
} else {
llSetTimerEvent(camptime);
}
} else {;
reciever="";
campmoney=initCampMoney;
llSetText("L$"+(string)campsubtract+" for 1 minute",<0,1,0>,1);
llSetTimerEvent(0);
}
}
}

money(key id, integer amount)
{
campmoney = campmoney + amount;
llSetText("Money:"+(string)campmoney,<0,1,0>,1);

}

timer() {
campmoney = campmoney-campsubtract;
llSetText("Money:"+(string)campmoney,<0,1,0>,1);
llSleep(0.5); // llUnSit works better with this delay
if (llAvatarOnSitTarget() != NULL_KEY) {
if (campmoney <= 0) {
//balance below zero. get out!
llSay(0, "Get off!";);
llUnSit(llAvatarOnSitTarget()); // unsit him
llSay(0,"Deposit L$"+(string)campsubtract+" to continue using this chair.";);
}
} else {
reciever="";
campmoney=initCampMoney;
llSetText("L$"+(string)campsubtract+" for 1 minute",<0,1,0>,1);
llSetTimerEvent(0);
}
}
}
_____________________
http://slnamewatch.com — Second Life Last Name Tracking — Email Alerts — Famous People Lookup — http://adz.secondlifekid.com/ — Artificial Boy — Personal Blog
From: Tofu Linden
Hmm, there's nothing really helpful there, but thanks for pasting.
Seth Mandelbrot
Registered User
Join date: 18 May 2006
Posts: 17
02-24-2008 10:34
Hilarious!
Very Keynes
LSL is a Virus
Join date: 6 May 2006
Posts: 484
02-24-2008 12:04
I Love it. Pity we can't drop it into a few genuine camping chairs :) but it will not deter Bots alas.
Smithy Zeno
ownes 9 pet cacti
Join date: 3 Aug 2006
Posts: 52
02-24-2008 12:47
Very nice idea :D
_____________________
-Smithy
Debbie Trilling
Our Lady of Peenemünde
Join date: 17 Oct 2006
Posts: 434
02-24-2008 13:20
Very funny :)