Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Expiring demo script

Ordinal Malaprop
really very ordinary
Join date: 9 Sep 2005
Posts: 4,607
03-11-2006 09:57
I am desirous of distributing "sample" versions of some of the products that I have been developing for actual purchase (rather than the L$1 articles that I also have, for which there is little need of a sample). These will all be no-mod no-copy.

Here is my initial code:
CODE
// Demonstration version expiry script
// Ordinal Malaprop
// 2006-03-11

integer gCountdown = 10;

nuke()
{
// Remove vital components from the item
llRemoveInventory("Main gun script");
llSetText("Expired", <1.0, 0.0, 0.0>, 1.0);
llGiveInventory(llGetOwner(), "Demo Expired Card");
}

default
{
state_entry()
{
llSetTimerEvent(60.0);
llOwnerSay("Time-limiting demo script initialised");
}

on_rez(integer p)
{
if (gCountdown <= 0) llOwnerSay("This demonstration version has expired");
else llOwnerSay("You have " + (string)gCountdown + " minute(s) left of this demonstration");
}

timer()
{
gCountdown--;
if (gCountdown == 1) llOwnerSay("One minute left!");
else if (gCountdown == 0) {
llOwnerSay("The demonstration is over - goodbye!");
nuke();
llSetTimerEvent(0.0);
}
}
}

Now, can anyone see anything wrong with that that might allow some rogue to get round the restrictions and half-inch my item?
Eloise Pasteur
Curious Individual
Join date: 14 Jul 2004
Posts: 1,952
03-11-2006 10:11
They take this script out of the item? I think you can do that with no mod items but the perms change so seemingly randomly I'm not 100% sure.

Since it's such a small script, why not add the function straight into the gun main script and use llRemoveInventory(llGetScriptName()); much harder to get around...
Ordinal Malaprop
really very ordinary
Join date: 9 Sep 2005
Posts: 4,607
03-11-2006 10:15
Well, they shouldn't be able to change anything about the object, or reset the scripts. "Shouldn't" being the operative word, I have all sorts of trouble with permissions myself. I've not seen anything going mod rather than no-mod, though.

I did it as a seperate script so that I could use it easily on more than one item - it's much easier to just drop this into the current version of whatever it is I'm working on than to make sure that I include it in the base script for whatever I'm selling, and also it's a bit wasteful to have it in the base script for the actual paid version.
Keknehv Psaltery
Hacker
Join date: 11 Apr 2005
Posts: 1,185
03-11-2006 12:37
I think you have to build it into the main script-- it shouldn't be too terribly difficult.

Personally, I would have it use llDie to delete the object completely, to avoid a few miscellaneous problems (give them a warning, of course).

With this script, someone could easily delete the protection and keep on using it. The main thing is to tie the countdown into the functionality to make it impossible to use without the timeout.

Unfortunately, there is currently no easy way to make something a demo object.
Eloise Pasteur
Curious Individual
Join date: 14 Jul 2004
Posts: 1,952
03-11-2006 13:40
I've just tested in world. You get a warning, but you can take a nc, nm script out of an nc, nm item I'm afraid.
Candide LeMay
Registered User
Join date: 30 Dec 2004
Posts: 538
03-11-2006 13:52
I would just add that you can't rely on scripts being run to check if inventory is changed 'cause people will just go to no-script zone to remove your demo/lock script.
_____________________
"If Mel Gibson and other cyberspace writers are right, one day the entire internet will be like Second Life." -- geldonyetich
Ordinal Malaprop
really very ordinary
Join date: 9 Sep 2005
Posts: 4,607
03-11-2006 14:59
From: Eloise Pasteur
I've just tested in world. You get a warning, but you can take a nc, nm script out of an nc, nm item I'm afraid.

Yes, I've just tried that myself - bother! It looks like I will have to put the function in the main script.

llDie doesn't seem to work on attachments - I tried that before, to no avail.

Perhaps I can just respond to people asking me for demonstrations as necessary.
Aliasi Stonebender
Return of Catbread
Join date: 30 Jan 2005
Posts: 1,858
03-11-2006 15:38
From: Ordinal Malaprop
Yes, I've just tried that myself - bother! It looks like I will have to put the function in the main script.

llDie doesn't seem to work on attachments - I tried that before, to no avail.

Perhaps I can just respond to people asking me for demonstrations as necessary.


Another way would be to have the main script check for the presence of the demo script and self-destruct if it doesn't exist. This would allow much smaller alterations to your main script, and you'd effectively have a "suicide pact" between the two scripts - the best someone could do is preserve the prims without any scripts by deleting them both in a no-script area.
_____________________
Red Mary says, softly, “How a man grows aggressive when his enemy displays propriety. He thinks: I will use this good behavior to enforce my advantage over her. Is it any wonder people hold good behavior in such disregard?”
Anything Surplus Home to the "Nuke the Crap Out of..." series of games and other stuff
Ordinal Malaprop
really very ordinary
Join date: 9 Sep 2005
Posts: 4,607
03-12-2006 00:03
That's a good idea!

Another thing I thought of would be to simply limit the number of permitted rezzes in the on_rez of the main script. That's quite easy to add to anything, and I don't have to change any of the timers, which is my main concern. I often start and stop timers and I don't want to have to rewrite everything.

Something like...
CODE

integer gRezzes = 1; // set to -1 for unlimited rezzes

on_rez(integer p)
{
if (gRezzes > -1) {
if (gRezzes == 0) {
llOwnerSay("You have reached the maximum number of rezzes - goodbye!");
// delete self and do other stuff
}
else {
gRezzes--;
if (gRezzes == 0) llOwnerSay("This is your final permitted rez");
else llOwnerSay("Rezzes left: " + (string)gRezzes);
}
}
}

edit: you have to watch this to make sure you never llResetScript, though

Someone could I suppose stay logged in forever and not teleport but if they're prepared to go to those lengths....

It would be possible to remove the scripts and just have the object, but since it's nomod nocopy people wouldn't be able to sell the item or re-script it. (You can't ADD to a nomod item even though you can delete from it, right?)
Eloise Pasteur
Curious Individual
Join date: 14 Jul 2004
Posts: 1,952
03-12-2006 00:36
I've never seen anyone successfully add to a no-mod object.
Lex Neva
wears dorky glasses
Join date: 27 Nov 2004
Posts: 1,361
03-12-2006 09:21
Even if you add the demo code to the main script, people can still get around it. They can take the script straight out of your gun (breaking it). Then they put the script into a new gun, and the script resets, and their demo starts over. Then they get as many demos as they want. Then again, if your object is no-mod, they can't put the script back into it, so if the design of the object is most of thepoint of buying the thing, then this problem doesn't apply.

People complain about the ability to do this kind of thing, but I think it makes a lot of sense. If you buy a car IRL, you're more than welcome to take the thing apart and break it if you really want to.
Yumi Murakami
DoIt!AttachTheEarOfACat!
Join date: 27 Sep 2005
Posts: 6,860
03-12-2006 09:52
Correct me if I'm wrong but..

If it's no-modify, won't it fail on the attempt to remove the script, since that would be a modification and it's running with their permissions?
Ordinal Malaprop
really very ordinary
Join date: 9 Sep 2005
Posts: 4,607
03-12-2006 10:52
Yeah, I would have thought that they couldn't copy a script from a no-mod no-copy item.

The script is the valuable thing here. The object, well, I spent some time designing it but it's nothing without the script to set off the animations and the sounds and the whole function. Those are the real selling point, I'm not the world's best builder.
Aliasi Stonebender
Return of Catbread
Join date: 30 Jan 2005
Posts: 1,858
03-12-2006 13:07
From: Ordinal Malaprop
Yeah, I would have thought that they couldn't copy a script from a no-mod no-copy item.

The script is the valuable thing here. The object, well, I spent some time designing it but it's nothing without the script to set off the animations and the sounds and the whole function. Those are the real selling point, I'm not the world's best builder.


Well, they can't copy the script if the script itself is no-copy. They best they could do is rip it out and place it in a plywood cube or whatever.
_____________________
Red Mary says, softly, “How a man grows aggressive when his enemy displays propriety. He thinks: I will use this good behavior to enforce my advantage over her. Is it any wonder people hold good behavior in such disregard?”
Anything Surplus Home to the "Nuke the Crap Out of..." series of games and other stuff
Ordinal Malaprop
really very ordinary
Join date: 9 Sep 2005
Posts: 4,607
03-12-2006 13:09
But they could rip it out? People can copy scripts from no-mod no-copy items? This is a bit worrying! The script is the item! Surely that can't be the case... I've not seen that on no-mod no-copy items that I possess.
Zapoteth Zaius
Is back
Join date: 14 Feb 2004
Posts: 5,634
03-12-2006 13:22
From: Ordinal Malaprop
But they could rip it out? People can copy scripts from no-mod no-copy items? This is a bit worrying! The script is the item! Surely that can't be the case... I've not seen that on no-mod no-copy items that I possess.


You can take it out, just drag the script from the item to the inventory, it gives you a warning, but you can do it to NoMod NoCopy items. But the permissions of the script remain the same..
_____________________
I have the right to remain silent. Anything I say will be misquoted and used against me.
---------------
Zapoteth Designs, Temotu (100,50)
---------------
Ordinal Malaprop
really very ordinary
Join date: 9 Sep 2005
Posts: 4,607
03-12-2006 13:26
Hold on - let me get this straight. You're saying that people can take the scripts out of no-mod no-copy items and put them in other items, albeit on a no-mod no-copy basis?

In what way is that "no-mod", one has to wonder?
Aliasi Stonebender
Return of Catbread
Join date: 30 Jan 2005
Posts: 1,858
03-12-2006 13:32
From: Ordinal Malaprop
But they could rip it out? People can copy scripts from no-mod no-copy items? This is a bit worrying! The script is the item! Surely that can't be the case... I've not seen that on no-mod no-copy items that I possess.


They can't copy it. They can REMOVE it, just as you might remove the engine from your automobile. However, this isn't necessarily a worrisome thing, even when "the script is the item", since most of the time people have to PAY for that item.

It's worrisome in YOUR case, since you're wanting to make a demo... the best I could figure is to perhaps hardcode some kind of limit in the demo version, or (if it's the kind of thing where it is possible) have one out that spits the output publically. (i.e, if a gun, set it up on a firing range and let people touch to shoot it without actually owning the gun.)(
_____________________
Red Mary says, softly, “How a man grows aggressive when his enemy displays propriety. He thinks: I will use this good behavior to enforce my advantage over her. Is it any wonder people hold good behavior in such disregard?”
Anything Surplus Home to the "Nuke the Crap Out of..." series of games and other stuff
Ordinal Malaprop
really very ordinary
Join date: 9 Sep 2005
Posts: 4,607
03-12-2006 14:49
You know what, I'm just going to go ahead and put the gun up for sale, and worry about demo versions later. I can't keep worrying about this issue.

I would like to have demo versions but if I can't be sure they're safe, I won't. People can contact me if they want a demonstration.
Laukosargas Svarog
Angel ?
Join date: 18 Aug 2004
Posts: 1,304
03-12-2006 16:01
Maybe irrelevant to your model but for demos of some things I give out smaller, no-mod, no transfer, temp-on-rez copies of the actual objects. Perhaps you don't need the script if you make it temp-on-rez + no-mod ?

[edit]
also helps to stamp the word DEMO with a texture somewhere highly visible.

I realise this doesn't fit all situations though, just adding an alternative pov.
_____________________
Geometry is music frozen...
Ziggy Puff
Registered User
Join date: 15 Jul 2005
Posts: 1,143
03-12-2006 17:37
I'm pretty sure that you're allowed to remove a script from the inventory of a no copy no mod object. If the script itself is no copy no mod as well, the you get only one copy of that script, and you can't read it. So you can put it into another object, but only one other object.

You could also add a check to see that the creator of the object is you. That way the buyer has to put it into an object built by you in order to be able to continue using it.

At the end of the day, I don't think it's possible to make it so that someone absolutely cannot steal something. The best you can hope to do is to make it not worth the effort :)
RJ Dumart
Registered User
Join date: 10 Aug 2006
Posts: 20
08-03-2007 08:33
Okay...ive done alot of searching to find back this topic.
Has anything been resolved yet? I'm highly interested in this too.

However, I'm not sure if, when this script would become available, if it can just be inserted right on the downside of the script... I'm not really a pro scripter at all, so...
Anyone?
Tiarnalalon Sismondi
Registered User
Join date: 1 Jun 2006
Posts: 402
08-03-2007 09:48
Well as shown above there are several ways to create demo objects...

The main danger comes from attachment demos as there really is no fool-proof way to prevent someone just taking that attachment with them since you cannot have it remove itself from inventory (I think adding a drop function to the attach commands instead of just attach and detach would be helpful as you could just have it drop and die)

This is one reason why all of my vehicles except the attachment vehicles have guest pilot...they cannot be a guest without wearing the attachment, and to do that they'd have to have a copy of it....

I've seen some that create a demo attachment that is alpha until you sit on the rest of the vehicle, and then it appears...when you get back up, it alphas again. Just a simple effort in the change section to send a message.

After it reaches the timeout phase for the demo, it goes to a state that automatically detaches it upon attach, which could be easily accomplished with an on_rez - if demo_over == TRUE - detach, and since it's alpha, even if they go to a no script area, they're still hosed. They could remove the scripts to keep the attachment on, but it's invisible and they can't mod it anyway.
Hg Beeks
llGetElement(80);
Join date: 13 Apr 2006
Posts: 134
08-03-2007 15:27
Something similar to what's been suggested:
Have a demo script as you do, but make it so that the function script (For tools, guns, etc) checks this script with a quick message. The script responds back with "Yes, they're still in their demo period" and the gun continues to work. If they are no longer in the trial period, or if the demo script is removed, then the gun either does not function, having not received the go-ahead from the demo script, or you could even have the main script llDetachFromAvatar() and then llDie() to ensure that it's destroyed completely.
If the object is a simple accessory (IE hair) then the best method might be something similar, but to decrement an integer every time it's rezzed or worn. When they reach the limit, it detaches. There are a number of ways that you could probably just.. Break the object when the time's up. Hiding scripts in various parts that all do the same thing, usually a llDetachFromAvatar() to get it off them and allow the object full control of itself. Then you can have it Die, Unlink, go physical and chase them around the sim... I think it's up to you at that point.
But yes, the best way to ensure that a tool or scripted object only works during the demo period would be to make the no-copy, no-mod demo version not function without the demo script.
Edit: More info on llDetachFromAvatar:
http://www.lslwiki.net/lslwiki/wakka.php?wakka=llDetachFromAvatar
Pale Spectre
Registered User
Join date: 2 Sep 2005
Posts: 586
Some more suggestions.
08-04-2007 04:20
Firstly, I can definitely confirm that scripts can always be ripped - not copied, but placed into your own objects. It can be a good way of reducing prim counts. :)

You can have the same script use different names: 'Main gun script' vs 'Main gun script demo'. In this way you only need maintain one code base. You can actually exploit this technique to have all sorts of 'features' conditioned on the name of the script but still only ever have to maintain one version of code.

The code can check its script name and 'know' that it's a demo using llGetScriptName(). As the script is no-mod it cannot be renamed.

You can code scripts so that they only reset 'properly' if llGetOwner() is you.

So, if the script detects that it is a demo, and state_entry() executes and you're not the owner, it disables itself.

If the script doesn't detect it is a demo it can be allowed to initialises as normal when reset.

If the script has detected it is a demo - as originally started by you - it can use the on_rez count technique you already described. Optionally, it might not count when you're the owner so that you can be sure the customer gets their full allocation, or just remember to reset the script one last time before you package it up.
1 2