Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Library: Try-It-On Script

Codswallop Cassidy
Registered User
Join date: 30 Dec 2003
Posts: 53
09-04-2004 19:22
CODE
/////////////////////
//Try On Script by
//Codswallop Cassidy
// Public Domain/FREE!
///////////////////////

float TIME = 30; // number of seconds till object

expires
string TRYON = "James Miller's lovechild :D "// change what's inbetween the " " to set the name of the object to try on

default
{
state_entry()
{
llSay(0, "Hi you are trying " + TRYON);
llSetTimerEvent(1.0);
}

// comment out touch start event if your object uses touch_start and to show the time left, you can comment back in the llSay line in timer
touch_start(integer total_number)
{
llSay(0, "You have " + (string)TIME + "seconds left to try this on");
}

timer()
{
// llSay(0, "Time left = " + (string)TIME);
TIME--;
if (TIME <= (float)0)
{
if (llGetAttached() !=0) // if the object is attached to someone
llDetachFromAvatar(); // detach before suiciding
llSay(0, "Your tryon of " + TRYON + " has expired. Thank for trying!");
llDie();
}

}

attach(key attached)
{
if (attached != NULL_KEY) // object has been attached
{
llRequestPermissions(attached, PERMISSION_ATTACH);
}
}


}


---------------------------------------------------------------------

It's been killing me how ridiculously simple an idea this is yet nobody's done it, so I posted a Tryon script. You can stick this into any vehicle, jewellery, attachment, furniture etc. Edit the top two variables for name of the object and number of seconds you want to let them try on for.

I'd love to see tryon's all over SL, all you need to do is make a tryon copy of what you're sellign and set the box or vendor to give that tryon copy (with this script inside it) for whoever's interested in trying on. It should Just Work (Tm). Hopefully this will do something for vehicle sales at least :D
Francis Chung
This sentence no verb.
Join date: 22 Sep 2003
Posts: 918
09-08-2004 10:31
I just wanted to warn people that this trick can, unfortunately, be overcome.

Rez this object in a no-script parcel, delete the try-on script :(
_____________________
--
~If you lived here, you would be home by now~
Codswallop Cassidy
Registered User
Join date: 30 Dec 2003
Posts: 53
09-11-2004 04:36
ack. Okay good headsup. No script parcels automatically delete scripts? shouldnt they just be disabled? that would mean any scripted object becomes useless which doesnt sound right.

I'll play with this some more, nice exploit to get free items on no script land but since the majority of SL land is script enabled this seems to be a pretty small problem unless the person is one of those never leave their land/scripter types ;)
Steve Patel
Registered User
Join date: 4 May 2004
Posts: 39
09-12-2004 20:05
They don't automaticly delete scripts, no. However, if rezzed on a no script section of land, the script will not run. This allows the owner to open the edit menu on the object, and remove the script from it. (Yes, even if the object and script are no mod, unfortunately.)
Synergy Belvedere
Prim Reaper
Join date: 7 Jul 2004
Posts: 253
Ummm
09-22-2004 13:37
I'm sure I'm being dimwitted here, but why would you want this script in a no script parcel anyway? Wouldn't the main reason for using this be for showing items off that you want to sell, and wouldn't most sellers be using a scripted vendor to sell the items in the first place?

I realize you don't need scripts to sell items but that seems to be the major trend.

Will this work on skins? I'd like to use it to let people try on my skins for 30 seconds or so b4 they buy....
Synergy Belvedere
Prim Reaper
Join date: 7 Jul 2004
Posts: 253
09-22-2004 13:55
What if the person TP's out of sim before time expires?
Steve Patel
Registered User
Join date: 4 May 2004
Posts: 39
09-23-2004 17:21
Because if the person has the object in their inventory, and they keep it there and take it out on no script land, they will have no problem wearing it ?

Also, I'm pretty sure llDie() doesn't work on an attachment. As another problem, even if the person didn't go to no script land, they could still just edit it and remove the script.
Codswallop Cassidy
Registered User
Join date: 30 Dec 2003
Posts: 53
09-25-2004 05:40
valid question synergy.. the script should be activated again once the object is rezzed again and the majority of areas in SL are scripted areas so this person would not be able to exploit this for very much fun at all. I said *should* because Ive not verified this for myself. Too many other projects.

and skin no, it falls under the same category as clothes, body parts etc. All of those are not considered objects, or volumes. :(
Lash Xevious
Gooberly
Join date: 8 May 2004
Posts: 1,348
10-09-2004 15:40
From: Synergy Belvedere
I'm sure I'm being dimwitted here, but why would you want this script in a no script parcel anyway? Wouldn't the main reason for using this be for showing items off that you want to sell, and wouldn't most sellers be using a scripted vendor to sell the items in the first place?



No one is suggesting to use this on a no script parcel. It's just a warning to the creators in how it can be gamed.
_____________________
Heratiki Turnbull
Juggalo Ninja Master
Join date: 2 Mar 2005
Posts: 81
03-21-2006 04:55
So here's a small fix... Make it try on right... But once you leave your parcel of land that it was bought on have it land scan and as soon as you leave the area it llDie()'s... Or have it run so that you can only have it 20 or 30 m away from the Vendo... Ok so they try to TP... On Rez or De Rez have it llDie... I still think it's possible... Just going to really have to be thoughout...

Let's make this a thread that could really get it started... Think of all possible ways that it can happen... The "theft" would happen that is... Granted Vehicles would be a little harder but you could give them a bit more space and then you would just have to worry if there was any land around your store that is no script... It's possible... If we could only detect no script land... I'm lost on how to figure this out...

The only way I can think of to subvert this tactic I'm talking about is for them to purchase it... Then teleport to no script land and open it up and delete the try on script... What does the Temp on Rez option in the build dialog allow... Is there a set time that it will run and then die... So... Write down your thoughts... There still might be a way...

Heratiki

Don't worry about halfway through my ramblings I did realize the whole teleport thing... But I just wanted to put those out there regardless... Anyways...
_____________________
"Don't place faith in human beings
human beings are unreliable things
don't place faith in human beings
human beings or butterfly's wings

You can't place faith in a new regime
that fascist faith will kill you
a hurricane triggered by a butterfly's wings
your conspirators betray you"

MOLG - Butterfly Wings
Jura Rosewood
Registered User
Join date: 15 Feb 2006
Posts: 1
For Safety
03-23-2006 02:14
I think to safe guard against any of these problems you could write demo over the item and make it no mod - even if the item that you are selling will be mod.
Patch Lamington
Blumfield SLuburban
Join date: 2 Nov 2005
Posts: 188
03-25-2006 03:18
From: Steve Patel
They don't automaticly delete scripts, no. However, if rezzed on a no script section of land, the script will not run. This allows the owner to open the edit menu on the object, and remove the script from it. (Yes, even if the object and script are no mod, unfortunately.)


Sounds like a feature/bug to me... should be fixed.
_____________________
Blumfield - a regular everyday kind of 'burb in an irregular world.
This notice brought to you by the Blumfield Visitors and Residents Bureau.
Heratiki Turnbull
Juggalo Ninja Master
Join date: 2 Mar 2005
Posts: 81
03-26-2006 03:04
From: Jura Rosewood
I think to safe guard against any of these problems you could write demo over the item and make it no mod - even if the item that you are selling will be mod.


That's what alot of ppl do now but the only problem with that is you don't really get the full effect of owning the item... Just like when you test drive a car you aren't driving a car with limited abilities... Your driving the car your most likely gonna be buying... However the Demo/Sample idea works great on most things... I've seen some hair that has gone a little overboard... And if you script an item designed to do something then the demo or sample system just won't really work... They'll still get the functions of the item it just won't look the way that it was intended... For instance you wouldn't want to demo or sample an AO of sorts by wearing it... If we could just have one command in LSL that would run regardless or maybe have the ability to set the script to invisible within the prim once it's been placed in there... That would be very helpful... The only thing I could think of that would defeat it would be the Set Scripts to Not Running... But then you run into clothing not being able to be tried on so on and so forth... I really hope the lindens have come to some special agreement on this... On their side it would be feasibly possible to have Try On / Demo properties that would be available to the creator... Which no matter where you are would result in destroying the item in your inventory or on no script land and wouldn't be affected by any type of runtime environment... Albeit it would have to be extensively tested so that there were NO bugs whatsoever...

Heratiki Turnbull
_____________________
"Don't place faith in human beings
human beings are unreliable things
don't place faith in human beings
human beings or butterfly's wings

You can't place faith in a new regime
that fascist faith will kill you
a hurricane triggered by a butterfly's wings
your conspirators betray you"

MOLG - Butterfly Wings
Zuleica Sartre
Registered User
Join date: 27 Sep 2005
Posts: 105
04-03-2006 19:00
The drawback is easy to overcome if the object has other scripts in it that are necessary to the functionality.

Simply add an llLinkedMessage ping from the script with the main functionality that the tryon script must answer within some small time period. Make it respond with a long string for security.

If someone removes the tryon script then the moment the main script runs and doesn't reiceve it's respons from the tryon script the main script llDies as well.

If the person removes the main script then they've destroyed the functionality of the object anyway.
Velox Severine
Network Slave
Join date: 19 May 2005
Posts: 73
04-07-2006 22:15
Zuleica's suggestion is really the only viable solution there...almost a licencing. However, make sure it is no-mod, or the point will be moot when your "licence" strings are intercepted and then sent by a dummy script.
_____________________
--BEGIN SIGNATURE STRING--
IkkgY2FtZSwgSSBzYXcsIEkgY29ucXVlcmVkLiIgLS1KdWxpdXMgQ2Flc2Fy
--END SIGNATURE STRING--
Naberius Merit
Registered User
Join date: 13 May 2006
Posts: 1
Well I know a good trick for that :)
05-24-2006 07:14
From: Steve Patel
Because if the person has the object in their inventory, and they keep it there and take it out on no script land, they will have no problem wearing it ?

Also, I'm pretty sure llDie() doesn't work on an attachment. As another problem, even if the person didn't go to no script land, they could still just edit it and remove the script.



11Die wont work if you put it in the main Part of the Item but if you edit linked parts and place it in an alternate spot where it would take a bit of time to find it , that would be a hassel for them and if its an item with many parts, well by the tim ethey find the llDie script its already dead hehe..
I dunno maybe.
Fred Extraordinaire
Weapons Specialist
Join date: 29 Jun 2004
Posts: 134
simple fixes
05-31-2006 14:59
my theory on this topic, read after the caution at the bottom, cant log in to test this right now
CODE

//variables used
integer x;
integer rez_limit = 3;
integer rez_count;
//global to stop the main program
dead()
{
for (x = 0; x < 1; x = x - 1)
{
//infinite loop
}
}


on_rez(integer start)
{
rez_count = rez_count + 1;
if(rez_count >= rez_limit)
{
llDie();
// or
dead();
//or even
llSetScriptState(llGetScriptName(), FALSE);
}
}

it would be easier to make a counter in your origional script to count the number of rezzes in the on_rez, when the limit is hit-- deletesorz. this way deleteing the part that makes it a demo also makes it useless. i'd also rather let them use the product until theyre ready to buy it or demo another one :p (sadly teleports will use one of the rezzes) so 1 probabily isnt enough to allow them to test say a gun.

!!!!!! CAUTION: READ BELOW !!!!!!
not even sure this works though...i have a sinking suspiscion that script counters lose their variables when de-rezzed. but i DID put in 2 other ways to shut down the main script that would make the product useless in case llDie doesnt work.
_____________________
-----

<3 LL :D
Fred Extraordinaire
Weapons Specialist
Join date: 29 Jun 2004
Posts: 134
05-31-2006 15:02
i just wrote a looooong post to do this with a snippet inside your main script but apparently forums suck and all of it just plain poofed.
_____________________
-----

<3 LL :D
Tiarnalalon Sismondi
Registered User
Join date: 1 Jun 2006
Posts: 402
06-01-2006 09:12
In regards to vehicles, I've seen a much better way to demo an item, though still exploitable.

I forget what parcel it was on, but this shop would allow you to "Test Drive" in that it would res a copy of the vehicle in the world that would allow you to fly it. The vehicle would act as normal as it would if you owned it in your inventory, but as soon as you get out of the vehicle, it dies.

It also has a timer set that if you don't get in it after so long of requesting the demo it will die so it won't litter the launchpad.
Graham Genosse
Registered User
Join date: 18 May 2006
Posts: 12
an idea
06-08-2006 14:14
What about, if you have the vendor have a script that emits something along a channel, that the try-on item has to recieve to keep rezzed, say every 10 seconds or so, and if they are away from the main try on base, it will die once it does NOT recieve the mssage that tells it to keep going, im not a practical scripter, but i understand most of the logic, is this a viable option?
Ixtab Supplee
Registered User
Join date: 19 Jul 2006
Posts: 3
Ummmmm...
07-19-2006 16:45
Why dont you just place the script in a child prim, rather than the main prim so that they cant delete it?
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
07-20-2006 05:19
From: Tiarnalalon Sismondi
In regards to vehicles, I've seen a much better way to demo an item, though still exploitable.

I forget what parcel it was on, but this shop would allow you to "Test Drive" in that it would res a copy of the vehicle in the world that would allow you to fly it. The vehicle would act as normal as it would if you owned it in your inventory, but as soon as you get out of the vehicle, it dies.

It also has a timer set that if you don't get in it after so long of requesting the demo it will die so it won't litter the launchpad.



That sounds similar to the 'Guest Pilot' feature built into the helo I bought at abbotts Aerodrome.

From: Graham Genosse
What about, if you have the vendor have a script that emits something along a channel, that the try-on item has to recieve to keep rezzed, say every 10 seconds or so, and if they are away from the main try on base, it will die once it does NOT recieve the mssage that tells it to keep going, im not a practical scripter, but i understand most of the logic, is this a viable option?


I think the biggest problem would be distance, even llShout has a limit of 100m, which would be fine for most stuff but rather limiting for vehicles.
James Udal
Registered User
Join date: 26 Nov 2005
Posts: 0
Logging
07-20-2006 11:44
Push lsl voting to support writing to notecards.

That way your vendor can log sales and your temp on rez trial objects can email the server. Server checks purchased log, if not on list poof.

Side benifit: You have a log of every sale, very benificial when sending out updates!

Side benifit: Owners can pickup new versions (ie: multigadget) if they accidently deleted theirs etc...

---

For the more talented, have the object call a webservice to validate sales. This is available now.

---

Imagine this... I have a dominus shadow my friend thinks is too cool, or an outfit that rocks.... So I just give him a copy.

The clothing/vehicle validates ownership, and puts itself into trial mode. Pick your flavor of marketing, notecard, popups, chat spam "James is driving a trial Dominus and can only rez it 1 more time, 30 seconds left, will self destruct... etc."

That way your script is the same in all your objects, the object is exactly what you will buy, and OH MY GOSH, the object is it's own vendor! Have it accpet payment, it tells the webservice it was bought, and poof no more trial... no stores needed.

I'd love to hear thoughts on this!

ps. I can host that service, contact me if it's a bit much for you.
Catdaddy12 Towradgi
Registered User
Join date: 22 Jun 2006
Posts: 4
cant!?
08-04-2006 08:45
cant you just make the object temporary
Silje Russell
lsl geek
Join date: 2 Oct 2005
Posts: 63
08-05-2006 07:26
if seting script to copy premision and object to nomod.
they cant drag out script to remove it.
and they cant right click and delete the script (not online so cant comfirm that)

but sins the object is nomod they cant change on inventory other then drag out scripts
but wid copy premision on script they wud only drag out a copy of the script
_____________________
Yes i know i got typos..
I got writing and reading problems.
but i am still a humen!!
1 2