Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Discussion: Builders' Buddy - Building Positioning/Rotation Tool

ed44 Gupte
Explorer (Retired)
Join date: 7 Oct 2005
Posts: 638
07-27-2006 05:36
Hi ArchTx Edo,

Newfie has made an interesting system. I have bought several houses that use his or similar rezzing systems.

I have largely overcome the "not dropping below ground level" problem by making the foundations the house rezzer. So when you rez your house you only get the basement. Because it is probably five meters high, you first lower it, and then you position it in the traditional way. This way your can see the corners of the foundation wrt the corners of your land from just about anywhere and it is very easy to come to a final position.

This basement then acts as your rezzer. I things go wrong, you will always be able to see your basement as it is the same size as the bottom of the house.

As i pointed out a couple of posts above, Newfie's component script does not correct for the base's rotation when the component position is first recorded so the base needs to have zero rotation when calibrating the house's position. By dividing the component's calibration ("record";) position vector by the base rotation, it does not matter what the base rotation is when you are calibrating. I have done some more experiments since that post and this has worked for me every time.

I will need to modify newfie's script some more to allow the basement to link to the house after everything is positioned, probably needing to ask the owner for link permissions.

Another problem I found was that when someone reset the component script and then called for another "position" from the menu, the house lost its calibration and dropped to sit square on top of the basement with both the basement and the house sharing the same centre. It was funny watching the doors open into the solid basement.

I have just posted a script in the script library which can put vectors into the component's description and I will attempt to modify newfie's script some more to incorporate that so that scripts in houses can be reset without losing the recorded vectors.

Anyway, I still think Newfie did a brilliant job with the concept.

Ed
ArchTx Edo
Mystic/Artist/Architect
Join date: 13 Feb 2005
Posts: 1,993
07-27-2006 19:26
Hello Ed,

That was interesting, I understand now why you installled the basement first. Then used it as the base prim for the rest of the house. I like the fact that it helps the buyer correctly locate the house in relation to the property lines. I too like to make my houses with thick foundations so they adapt to irregular terrain better.

For skyboxes I have made the base prim into a bench that buyers can sit on and ride up into the sky to install a skybox. I like the idea of linking some kind of markers with the bench to help locate it (and the skybox) withing the property lines.

Since my pervious post i have realized a work around for the problem of the base priim getting burried inside of other stuck objects on first rezz. Just make sure the edit window is open and the base prim selected before giving the menu build command. That way if it gets burried you can drag it up where it is visible to touch it for the Clean command.
_____________________

VRchitecture Model Homes at http://slurl.com/secondlife/Shona/60/220/30
http://www.slexchange.com/modules.php?name=Marketplace&MerchantID=2240
http://shop.onrez.com/Archtx_Edo
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
09-05-2006 17:28
Ah I am laughing pretty hard. Came in and deleted it all. Been awhile since I had posted this bit of code and looking back it is pretty nasty. Of course I can't imagine looking back 6 months from now and reading the scripts I am creating today also.

:-) But it is amusing!!!!!
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
09-05-2006 17:37
oooops I forgot I had add visibility functions in there also and they are not the final edit I am using. Should be corrected to:

if ( message == "BaseAlpha" )
{
llSetAlpha(0.0, ALL_SIDES);
llSetStatus(STATUS_PHANTOM, TRUE);
llOwnerSay ( "Base is Invisible" );
}
if ( message == "BaseVis" )
{
llSetAlpha(1.0, ALL_SIDES);
llSetStatus(STATUS_PHANTOM, FALSE);
llOwnerSay ( "Base is Visible" );
}
Instead of using Texture Keys
Seigmancer Nino
Builder, Engineer
Join date: 24 May 2005
Posts: 150
10-10-2006 08:01
I have yet to try this script, But i have a question for all you experienced builders who use this or any other rezzing/positioning product.

Is there any size/prim/object limit for this script or rezfoo? I build large structures liky skyscrapers and towers, some over 2000 prims and 100+ Linked objects. Not to mention heights of 250m + , is there a limiation on this? will i be able to save these large buildings without a problem with this or rezfoo?

thanks in advance for anyone who can help.
ArchTx Edo
Mystic/Artist/Architect
Join date: 13 Feb 2005
Posts: 1,993
10-10-2006 19:03
EDIT: Clarification, this post was in regard to the Version 1.7 that Newfie posted, it still contains the following text in the instructions, which is no longer correct. As Ed says below, Version 1.7 uses the menu script that changes the channels it communitcates on. /EDIT

CODE
// OTHER COMMANDS 
// - To reposition, move/rotate Base Prim Type: /12345 MOVE
// - To lock into position (removes scripts) Type: /12345 DONE
// - To delete building pieces: /12345 CLEAN


These commands do not work in the latest versions of the script as they no longer "say" on channel 12345.
_____________________

VRchitecture Model Homes at http://slurl.com/secondlife/Shona/60/220/30
http://www.slexchange.com/modules.php?name=Marketplace&MerchantID=2240
http://shop.onrez.com/Archtx_Edo
ed44 Gupte
Explorer (Retired)
Join date: 7 Oct 2005
Posts: 638
10-11-2006 02:31
ArchTx
From: someone
These commands do not work in the latest versions of the script as they no longer say on channel 12345


Use the menu version. Its channel number is dynamically generated.


Seigmancer
From: someone
Is there any size/prim/object limit for this script or rezfoo? I build large structures liky skyscrapers and towers, some over 2000 prims and 100+ Linked objects. Not to mention heights of 250m + , is there a limiation on this? will i be able to save these large buildings without a problem with this or rezfoo?


No limits for this script on objects afaik. The 250 m height could be a problem as shout is only supposed to work to 100 m (am I correct?). You could put the rezzing prim in the middle at 125 m when you record but you would need to put it back to 125 m when you build. You could build from ground but then you would need to correct the shouted base position by .z + 125. You might want to put a bigger sleep in the build loop so you don't hit the grey goo fence.

Of course, you could split the building into 3 vertical parts, each 85 m or so high.

1. Use the basement to hold and build the objects for the first part.

2. Put another basescript and all objects from the next part upwards in one of its top floor objects.

3. build the second part, and repeat steps 2 and 3 for part 3.

Each part would need its own channel to record and position with.

I'll be testing the basic script on a medium sized house in the next couple of days (if sl stays up).

Ed
ArchTx Edo
Mystic/Artist/Architect
Join date: 13 Feb 2005
Posts: 1,993
10-14-2006 10:14
The largest build I have used this on so far is about 60x60 meters with about 315 prims, in 35 objects, but I see no reason it wont work up to 200x200m distance, as long as the base prim is at the center.

Builder's Buddy has a few peculiarities in usage:

It cannot move the center of prims below the ground level, so sometimes foundation pieces will stick up a bit if they were rezzed to low.

Versions v1.6 and v1.7 do not work correctly with Mod/Copy items for resell, as they only allow the item to be rezzed once from each base prim, it deletes the contents of the base prim after one use. You can however rezz a second base prim if it is mod/copy. This can be problematic since the prims still occasionally stick at the rezzing point and do not position properly until you make a second attempt. In this case if the base prim is buried inside the component pieces, you need to delete all the items rezzed and then rez a new base prim for the second attempt.

WORKAROUND: If you keep the base prim selected when you touch it to rezz, and the component objects stick, then you can move the base prim slightly and the objects should jump to thier correct positions.
_____________________

VRchitecture Model Homes at http://slurl.com/secondlife/Shona/60/220/30
http://www.slexchange.com/modules.php?name=Marketplace&MerchantID=2240
http://shop.onrez.com/Archtx_Edo
ed44 Gupte
Explorer (Retired)
Join date: 7 Oct 2005
Posts: 638
11-01-2006 04:57
Another update to the builders buddy, this time the component script.

I found that some components would bounce up and down vigorously 25 times in what seemed to be their correct positions/rotations which did not really look good.

I narrowed the problem down to the while loop in the "MOVE" section which I changed to:

CODE
 while( (i < 10) && (llVecDist (llGetPos(), vDestPos) > 0.0001) ) 


The main problem is that floats are so inaccurate that sometimes they just refuse to be equal to each other. Instead of looking for exact equality, the while loop now only checks that the distance between the wanted position and the actual position is less than a nominal very small number (smaller than you can set on the edit window).

I may have made some other changes to this code which may not work with the old base rezzing code so you just might want to update your component scripts with the new while statement listed above.

Now if only I could stop some rezzed components going out of world ( I am working on the edge of Explorers Rangeland) this would be perfect. . . . . . . . .


CODE

integer PRIMCHAN = -10; //Channel used by Base Prim to talk to Component Prims;
integer debug = FALSE;

//The Component Script:

//PHP Code:
// Builders' Buddy 1.0 (Component Pieces)
//
// by Newfie Pendragon, March 2006
//
// This script is distributed with permission that it may be used in
// any way, or may be further modified/included in resale items.
// HOWEVER, if this script is used as part of a for-sale product,
// it is required that appropriate credit be given to Newfie for
// the script (or portions used in derivatives). That's a fair price
// in exchange for unlimited use of this script, dontcha think?


//INSTRUCTIONS
//(These instructions use channel 1234 in the examples, but can be
// changed further down in the code to whatever channel you wish.)
//
// This is the *Component Piece* half of the Builders' Buddy system.
// Drop it into each 'piece' of the building. Drop the Base Prim Script
// into the prim that will be the container/box that will be used to
// store the building once completed. It can be in each individual
// prim, but if you link as much as possible (and put the script in the link
// set), it'll be much more neighbourly and less strain on the sim.
//
// QUICK USE:
// - Drop this script in the Base.
// - Drop the "Component" Script in each building part.
// - Type: /12345 RECORD
// - Take all building parts into inventory
// - Drag building parts from inventory into Base Prim
// - Type /12345 BUILD
//
// OTHER COMMANDS
// - To reposition, move/rotate Base Prim Type: /12345 MOVE
// - To lock into position (removes scripts) Type: /12345 DONE
// - To delete building pieces: /12345 CLEAN

//////////////////////////////////////////////////////////////////////////////////////////
// Configurable Settings
// This must match in both scripts

//////////////////////////////////////////////////////////////////////////////////////////
// Runtime Variables (Dont need to change below here unless making a derivative)
vector vOffset;
rotation rRotation;


////////////////////////////////////////////////////////////////////////////////


string getLeftValue(string sString, string delim) {
integer delimPos = 0;
delimPos = llSubStringIndex( sString, delim );
if( delimPos > 0 ) // -1 = not found, 0 = no left string
return llGetSubString( sString, 0, delimPos - 1);
return NULL_KEY;
}

string getRightValue(string sString, string delim) {
integer delimPos = llSubStringIndex( sString, delim ) ;
if( delimPos > -1 ) // -1 = not found, 0 = no left string
return llGetSubString( sString, delimPos + 1, llStringLength(sString));
return NULL_KEY;
}


string first_word(string In_String, string Token)
{
//This routine searches for the first word in a string,
// and returns it. If no word boundary found, returns
// the whole string.
if(Token == "") Token = " ";
integer pos = llSubStringIndex(In_String, Token);

//Found it?
if( pos >= 1 )
return llGetSubString(In_String, 0, pos - 1);
else
return In_String;
}

////////////////////////////////////////////////////////////////////////////////
string other_words(string In_String, string Token)
{
//This routine searches for the other-than-first words in a string,
// and returns it. If no word boundary found, returns
// the an empty string.
if( Token == "" ) Token = " ";

integer pos = llSubStringIndex(In_String, Token);

//Found it?
if( pos >= 1 )
return llGetSubString(In_String, pos + 1, llStringLength(In_String));
else
return "";
}


//////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////
default
{
//////////////////////////////////////////////////////////////////////////////////////////
state_entry()
{
//Open up the listener
llListen(PRIMCHAN, "", NULL_KEY, "");
llOwnerSay ("Listening to channel " + (string) PRIMCHAN);
}

//////////////////////////////////////////////////////////////////////////////////////////
on_rez(integer iStart)
{
//Set the channel to what's specified
if( iStart != 0 )
{
PRIMCHAN = iStart;
state reset_listeners;
}
}

//////////////////////////////////////////////////////////////////////////////////////////
listen(integer iChan, string sName, key kID, string sText)
{
if (debug)
llOwnerSay (sText);
string sCmd = llToUpper(first_word(sText, " "));

if( sCmd == "RECORD" )
{
llOwnerSay("Recorded Position");
sText = other_words(sText, " ");
list lParams = llParseString2List(sText, [ "|" ], []);
vector vBase = (vector)llList2String(lParams, 0);
rotation rBase = (rotation)llList2String(lParams, 1);

vOffset = (llGetPos() - vBase) / rBase;
rRotation = llGetRot() / rBase;
llSetObjectDesc ((string) vOffset + ":" + (string) rRotation);
if (debug) {
llOwnerSay("Recorded Pos: " + (string) vOffset + ", Rot: " + (string) rRotation);
vector vDestPos = (vOffset * rBase) + vBase;
rotation rDestRot = rRotation * rBase;

llOwnerSay("Will move to Pos: " + (string)vDestPos + ", Rot: " + (string)rDestRot);
}
return;
}

//////////////////////////////////////////////////////////////////////////////////////////
if( sCmd == "MOVE" )
{
//Calculate our destination position
sText = other_words(sText, " ");
list lParams = llParseString2List(sText, [ "|" ], []);
vector vBase = (vector)llList2String(lParams, 0);
rotation rBase = (rotation)llList2String(lParams, 1);

//Calculate our destination position
vector vDestPos = (vOffset * rBase) + vBase;
rotation rDestRot = rRotation * rBase;
if (debug)
llOwnerSay("Move to Pos: " + (string)vDestPos + ", Rot: " + (string)rDestRot);
integer i = 0;
vector vLastPos = ZERO_VECTOR;
while( (i < 10) && (llVecDist (llGetPos(), vDestPos) > 0.0001) )
{
//If we're not there....
if( llGetPos() != vDestPos )
{
//We may be stuck on the ground...
//Did we move at all compared to last loop?
if( llGetPos() == vLastPos )
{
//Yep, stuck...move straight up 10m (attempt to dislodge)
llSetPos(llGetPos() + <0, 0, 10.0>);
} else {
//Record our spot for 'stuck' detection
vLastPos = llGetPos();
}
}
i++;

//Try to move to destination
llSetPos(vDestPos);
llSleep(0.1);
}
if (debug) {
llOwnerSay ("i=" + (string) i);
if (i > 24) {

}
}
//Set rotation
llSetRot(rDestRot);
return;
}

//////////////////////////////////////////////////////////////////////////////////////////
if( sCmd == "DONE" )
{
//We are done, remove script
llRemoveInventory(llGetScriptName());
return;
}

//////////////////////////////////////////////////////////////////////////////////////////
if( sCmd == "CLEAN" )
{
//Clean up
llDie();
return;
}
}
}

//////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////
state reset_listeners
{
//////////////////////////////////////////////////////////////////////////////////////////
state_entry()
{
state default;
}
}


Mordecai Nitschke
Registered User
Join date: 7 Jul 2006
Posts: 3
11-01-2006 12:35
For a build larger than 200m, would it be possible to have a Builder's Buddy box rez a 2nd generation of boxes within this limit, thus expanding the reach of the construction?

This would mean the shouting channels of the various box- or build- rezzing scripts would have to be different, or that the orders should be transmitted with a syntax that makes the n_generation boxes know if an order is for them, their neighbours or the n+1_generation.

There could even be repeater-boxes rezzed to transmit the shouted orders, to gap the 96m shouting limit.

Now if BB could span sim borders, there would be no limit to the size of the rezzable structure(s) from 1 prim. Or, if need arises, to the saving and storage of all the prims/builds/vegetation in one or several sims, for land-editing purposes for instance, like a change of sea-level.

These are just theoretical questions of course. I have as yet absolutely no need to cover half the mainland with an orbital city. Plus, scripting that would be too complex for me.

The next step would be to MOVE that thing :)
ed44 Gupte
Explorer (Retired)
Join date: 7 Oct 2005
Posts: 638
11-01-2006 15:53
Hi Mordecai ,

Funny you should say that. I actually have the opposite problem. When I went to another part of the sim (it has a huge sandbox), to build a second house, all the parts of the first house came walking up to the second house and with the rezzing, all parts were duplicated, so I got double the prims, but it looked the same - even though there were two copies of each prim. So now looking at passing a random channel number to the rezzed pieces; this channel should be different each time I build and will be different to the original recording command channel. Tnat should also make it easier to daisy chain rezzers

Ed.
Mordecai Nitschke
Registered User
Join date: 7 Jul 2006
Posts: 3
11-01-2006 17:22
Hi Ed44.

This happened to me too; I made a build, placed the scripts and dropped the copies I had taken in the Builder's Buddy box, then took and rezzed the BB itself. The old build jumped in the same spot the new one was appearing in.
Then, when I ordered the Buddy box to Clean, all the prims of the double build disappeared, and only one clean build reappeared when I asked it to Build again.

The trick would be in this case to tell the rezzed objects not to obey to orders given to a second rez event.
Could the description field of the object be used for that? storing the rezing date, for instance, and then storing a memory of the various rezzes in the BB box, to select which build to give orders to?

But the daisy-chained boxes would probably need the equivalent of a code of their position in the graph to function correctly, preferably in their name, human-readable, to prevent mix-ups in the storage phase.
ed44 Gupte
Explorer (Retired)
Join date: 7 Oct 2005
Posts: 638
11-02-2006 03:19
I am working on that one!
Wildthrust Mathilde
Registered User
Join date: 22 Nov 2006
Posts: 49
1.7?
12-06-2006 09:44
Where, last post I see is on page 2 and says its version 1.6, yet following posts talk about 1.7.
Sterling Whitcroft
Registered User
Join date: 2 Jul 2006
Posts: 678
Builders Buddy Version
12-06-2006 14:21
http://www.lslwiki.net/lslwiki/wakka.php?wakka=LibraryBuildersBuddy


At above link in the LSL wiki,
Base is at Version 1.6
Components are at Version 1.7
timeless Montreal
Registered User
Join date: 5 Dec 2006
Posts: 8
12-10-2006 13:06
this is the coolest script ever!

I have a question, would it be possible to pass some unique parameter between the base script and the component scripts that would allow you to have more packages with in the same area? Like, if you have two buildings right next to each other, or perhaps a building in one box, and it's furniture and decorations in another box? You could record all the locations of the prims of the building in one package, and everything else in another package.

I think that would make this even more powerful.

I also have a quick question, how important is it to use unique names for the prims? I was naming everything but after 'building' I noticed I had some duplicate names but it didn't seem to affect anything.

Thanks for the awesome script!
ed44 Gupte
Explorer (Retired)
Join date: 7 Oct 2005
Posts: 638
12-10-2006 15:41
From: timeless Montreal

I have a question, would it be possible to pass some unique parameter between the base script and the component scripts that would allow you to have more packages with in the same area? Like, if you have two buildings right next to each other, or perhaps a building in one box, and it's furniture and decorations in another box? You could record all the locations of the prims of the building in one package, and everything else in another package.

I just have different versions of this script for different houses so they can be side by side without affecting each other. Just use a different PRIMCHAN for each script pair.

From: timeless Montreal

I also have a quick question, how important is it to use unique names for the prims? I was naming everything but after 'building' I noticed I had some duplicate names but it didn't seem to affect anything.

You cannot have duplicate names in your rezzer's object list. SL will append "1", "2" etc to make them unique.

I put the rezzer script into the basement of each house. You can usually position the base more effectively when you can see the corners and place it wrt boundary lines and other objects in the area.
Cole Kinsella
Registered User
Join date: 14 Sep 2004
Posts: 2
This is awesome
12-10-2006 22:10
Thank you for this. It works well and is very useful.
timeless Montreal
Registered User
Join date: 5 Dec 2006
Posts: 8
12-10-2006 23:14
thanks for the PRIMCHAN tip, I'll try it out.
Luxe Alabaster
Second Crack Ho
Join date: 28 Sep 2006
Posts: 13
BB for High-Prim Objects
02-09-2007 04:08
Hi everyone,

First off - BRILLIANT script!!! Thank you SO much to all the contributors - I honestly don't know why everyone isn't using this!

I build high-prim objects (retro tin robots) and am using BB to allow customers to rez and derez the robots to look at, OR permanently place them. Not everuone ahs the space to permently rez a 100prim robot :P

Would it be very difficult to adapt Androclese's creator / reseller menu to also allow the buyer to also Clean? So they are rezzing / derezzing the same inventory item until they decide they are done?

That would be so incredibly amazingly useful!!!

THANK YOU once again :)
Andromeda Quonset
Registered User
Join date: 20 May 2006
Posts: 46
Hints wanted
03-04-2007 14:49
I'm not sure what I'm doing wrong. I have the 1.7 components script in my components. I have the 1.6 script in my base script. Recorded with touch menu. All objects taken into inventory, then put into base prim. I touch the base prim, select Build, and all my prims rez, but only 1 positions itself. It does this consistantly.
ed44 Gupte
Explorer (Retired)
Join date: 7 Oct 2005
Posts: 638
03-04-2007 18:01
Have you tried putting out the "Position" command from the menu separately after all the items have rezzed?
Andromeda Quonset
Registered User
Join date: 20 May 2006
Posts: 46
Builder's Buddy problem - follow up
03-07-2007 17:34
From: ed44 Gupte
Have you tried putting out the "Position" command from the menu separately after all the items have rezzed?


Yes, that was one of the first things I tried when it didn't work right. If I have 16 objects, I was finding that object 9 would be the only one that got positioned with "build". If I then gave a "Position" command, the only thing I would see is another object move into the same spot as object 9.

I admit, though, that I am probably my own worst enemy on this. I was faced with a build that had many pieces, to be generated by ShapeGen .95x. I thought it would be clever to put the component script into the "block" object inside of ShapeGen, and then I would not have to add the component script to all those blocks manually, saving me a step. I didn't see anythign obvious in the scripts like using the same channels, so I thought it would work. I still think this approach has some merits, but I need to make a more detailed study of the scripts involved to determine the problem.

I eventually was able to get Builder's Buddy to work by adding it manually to all my pieces after they rezzed.

Thank you for responding :)
Mason Kingsford
Registered User
Join date: 12 Nov 2006
Posts: 42
03-19-2007 13:38
Ok, well, I am now working with Builder's Buddy. I'm getting some success with it. The first thing I changed was to allow a user that is not the owner to "Clean" or derez a build. It was easy enought to enable that option. Some of the things that I've found either interesting or qlitchy follow:

1. Sometimes the building doesn't rez all the way. The prims either don't come out or they get stuck. Usually it will work on a second try or to re-rez the base prim and try again. This is no fun. I wonder if this is just a SL glitch or if there is a fix for it? Do Rez-Faux or Foo have this problem ever?

2. When rezzing a build, the objects in the inventory of the base prim get removed. However, if the build doesn't rez right, the objects are gone. Could the objects either stay in the contents or is it possible for them to return to the base prim on clean up? (or is this just pointless?)

Thanks for any insight, or tips. I'm not sure how foo or faux behave in these situations.
Sterling Whitcroft
Registered User
Join date: 2 Jul 2006
Posts: 678
03-19-2007 17:41
Mason,
Is this happening all the time, or just today?

I suspect from the time when you posted that you were caught in a general failure of inventory to REZ. An hour or so before you posted, problems all over the grid began occuring. As I reply, the problems continue.

Is this still happening?
1 2 3 4 5 6 7