Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

New to SL; Three Simple Coding Questions

Vilkacis Mason
Registered User
Join date: 30 Aug 2005
Posts: 49
08-31-2005 02:42
I cannot play at the moment, or I would try to find someone in-game who could answer these questions. But I have three questions concerning the in-game code that I need answered. Note that I'm basically entirely new. I know quite little, and did not get a chance to get past the third step in the newbie training island. I'll get back to it tomorrow, but until then assume that much needs to be explained to be properly understood.

Firstly, can programming loop infinitely? Can I make some sort of small lemming creature which wanders aimlessly and will never stop due to it's code 'running out'? (I can understand it being destroyed or removed physically by others.)

Secondly, if I log off, do the things I leave behind stay where I set them? Does it stay there until, say, the land-owner wishes them away? What happens if they become 'wished away'? Relatively, if programming can loop infinitely, can it loop infinitely while I am not logged on? Could I make a set of lemmings that wander my own land, and they would wander and greet people or whatnot while I am not logged in?

Lastly, what is the limit on how much 'stuff' I can build? Is this based on how many basic-building-blocks I use, or the processing time on the code, or what? If I were to make lemmings, how many could I make? Is this directly related to how much land I own? If so, in what way? How does this work? How would it affect a Basic Account?

I appreciate any answers you can give me, in whatever way you can. It will help me decide what I'm going to do once I get things rolling. Please note, I am likely not making a herd of uselessly wandering Lemmings; they just made a good analogy for autonomous little critters doing autonomous little things.
Elberg Control
Wandering Loon
Join date: 24 Aug 2005
Posts: 79
08-31-2005 03:15
From: Vilkacis Mason
I cannot play at the moment, or I would try to find someone in-game who could answer these questions. But I have three questions concerning the in-game code that I need answered. Note that I'm basically entirely new. I know quite little, and did not get a chance to get past the third step in the newbie training island. I'll get back to it tomorrow, but until then assume that much needs to be explained to be properly understood.


I'm a bit new myself, but at least I read the forums so I'll try to answer these. I'll probably even be right.

From: Vilkacis Mason
Firstly, can programming loop infinitely? Can I make some sort of small lemming creature which wanders aimlessly and will never stop due to it's code 'running out'? (I can understand it being destroyed or removed physically by others.)


Yep. Infinite loops are no problem at all. Infinite replication just takes a little more work, and it's repercussions are pretty nasty. You Have Been Warned. No one likes people who crash the world.


From: Vilkacis Mason
Secondly, if I log off, do the things I leave behind stay where I set them? Does it stay there until, say, the land-owner wishes them away? What happens if they become 'wished away'? Relatively, if programming can loop infinitely, can it loop infinitely while I am not logged on? Could I make a set of lemmings that wander my own land, and they would wander and greet people or whatnot while I am not logged in?


They stay where they are subject to a few limits. Sandboxes get wiped at regular intervals, and most people's land is set to automatically return items (ie. get rid of them) that don't belong to them in a few minutes' time. Making things that wander around your own land indefinitely is no problem at all, since it's your land. The only thing you have to worry about (aside from wasting computing resources if you're sloppy) is that there's an upper limit to the total number of primitives your land can host like that. I'm not *certain* about what happens to the excess items, but I'm pretty sure they just get chucked out of the world and back into your inventory after a few minutes.

From: Vilkacis Mason
Lastly, what is the limit on how much 'stuff' I can build? Is this based on how many basic-building-blocks I use, or the processing time on the code, or what? If I were to make lemmings, how many could I make? Is this directly related to how much land I own? If so, in what way? How does this work? How would it affect a Basic Account?

Well, you can't own land with a Basic Account. If you get a Premium account you can then own up to 512 square meters of land and have up to 117 prims on it before you start to incur land maintenance fees (which require you to upgrade your plan account and pay a little more real money per month). Somewhere the various tiers are documented in the Wiki, and even though I untangled some of the explanations last night while I was looking at it, I've no idea what the URL is for that at the moment, Sorry.

From: Vilkacis Mason
I appreciate any answers you can give me, in whatever way you can. It will help me decide what I'm going to do once I get things rolling. Please note, I am likely not making a herd of uselessly wandering Lemmings; they just made a good analogy for autonomous little critters doing autonomous little things.


I've seen enough written about herds of things while reading the LSL dox that I'm positively petrified I'm going to wind up creating something that goes berzerk. Considering the number of "gotchas" I've also found with many of the functions, I suggest you follow my lead and stick with singular objects for awhile. ;) It seems like it's just way too easy to have things go out of control in a white-hot hurry.
Vilkacis Mason
Registered User
Join date: 30 Aug 2005
Posts: 49
08-31-2005 03:32
What is a 'prim'? I've heard this word before, but never in any context I could understand. And how many can I have if I own no land?
CrystalShard Foo
1+1=10
Join date: 6 Feb 2004
Posts: 682
08-31-2005 04:37
A prim, short for Primitive, is the "basic-building-block" you've refered to earlier.

SecondLife object construction works by rezzing ("creating";) several prims, editing their shape, and sticking them together to create a bigger object.

Each parcel can hold up to a specific number of prims, based on its size. An object made of 3 prims will take 3 prims out of the parcel's prim limit.

Script-wise, prims act as containers or hosts. A script can modify its local prim container, or affect the entire linked-set (the whole object and all of its prims).

When the prim hosting the script is not rezzed in the world, the script it holds does not execute.

Taking a prim into inventory does not reset the script inside unless the script is specificly designed to do so. The default behavior for a script is to simply freeze and have its state saved entirely along with the object.

The next time you rez the object in-world, the script will resume from the last point it stopped at according to the prim's template in your inventory.
Keknehv Psaltery
Hacker
Join date: 11 Apr 2005
Posts: 1,185
08-31-2005 10:19
Maybe some screenshots would help?


Prims are just basic shapes. Cubes, spheres, tori, cylinders, and a few others. They DO have some special modifiers (hollow, cut), and can be colored and textured.
A few different prims:

Prims

Linked objects are, of course, just a bunch of prims stuck together. They are treated by the physics engine as one object, and many complex things can be made. Each prim has its own inventory, and they can communicate amongst themselves.
A few linked objects:

Linked Prims

The thing is, land can't exceed its limit. When it reaches it, you simply can't rez things.

When objects are removed by the land owner, you get an IM about it and it's stuck into a folder in your inventory.

(Note to self: Don't launch Photoshop and Second Life at the same time)
a lost user
Join date: ?
Posts: ?
Wow!
08-31-2005 16:37
From: someone

Taking a prim into inventory does not reset the script inside unless the script is specificly designed to do so. The default behavior for a script is to simply freeze and have its state saved entirely along with the object.

The next time you rez the object in-world, the script will resume from the last point it stopped at according to the prim's template in your inventory


THAT I didn't know. That explains a LOT of why some of My scripts have been acting...well, goofy.

Thanks.
a lost user
Join date: ?
Posts: ?
08-31-2005 19:57
From: Elberg Control
Well, you can't own land with a Basic Account.
From: someone


True. However, you can lease land from others in which they give you permissions on the land to edit and build items there.

So you can have a Basic Account and still have (but not own) land with your own prims on it.
a lost user
Join date: ?
Posts: ?
08-31-2005 20:00
From: Elberg Control

Well, you can't own land with a Basic Account.

True. However, you can lease land from others in which they give you permissions on the land to edit and build items there.

So you can have a Basic Account and still have (but not own) land with your own prims on it.