Change font size
It is currently Wed Aug 15, 2018 1:16 pm

Forum rules


{L_IMAGE}



Post a new topicPost a reply Page 1 of 1   [ 8 posts ]
Author Message
 Post subject: Demo rezzer type script (how easy is it to create)?
PostPosted: Tue Apr 12, 2011 2:05 am 
Furious Typer

Joined: Tue Oct 28, 2008 4:53 pm
Posts: 166
I've been trying for quite some time on creating a type of 'Demo Rezzer' much like the ones used in SL for rezzing houses, etc etc.

The idea is to have a wall of images showing what each item is, and by clicking on the image, a drop down menu would ask to either 'Get Item' or 'Rez Item', if 'Rez Item' is chosen, then the build is rezzed about 15-20m behind the wall, if 'Get Item' is selected, then the build's rez box is given, but when another image is clicked on, the previous build and its rez box is removed, ready for the next item.

I created the menu, but it's the rezzing system I can't get right, even by using llRezObject the object rezzes somewhere else, and I have to return everything and start again, (I can't use llRezAtRoot because the wall of images are 5m above the platform and not linked).

The 'Demo Rezzer' would also need to be able to rez at any height up to 4000m, (so that a demo area could be made as a sky platform if needed).


Top
 Profile  
 
 Post subject: Re: Demo rezzer type script (how easy is it to create)?
PostPosted: Tue Apr 12, 2011 1:50 pm 
OSG Elite
User avatar

Joined: Thu Dec 11, 2008 7:51 am
Posts: 392
Location: England UK
You could create a seperate prim for your rezzer (in the middle of your rezzing area) and use llRezAtRoot. Use llSay/listen to send the command from the vendor to the rezzer. Using llRezObject you have to specify the pos and rot for the root prim. If the root prim varies in your builds then you will need a list of some kind with the different pos and rots for the objects. Rezzing objects is something I was never particularly strong at, well, getting them to rez in the right place anyway.

Also, the maximum an object will rez at is 4096m. I'm pretty sure this is still the case with opensim. Though you can move objects and build upto 10,000m iirc a script is capped at 4096m (though this may have changed since I last messed about with llRezObject, which was quite some time ago).

_________________
"Nothing lasts forever; It's scientific"
~David Byrne (Talking Heads)


Top
 Profile  
 
 Post subject: Re: Demo rezzer type script (how easy is it to create)?
PostPosted: Tue Apr 12, 2011 7:52 pm 
Site Admin

Joined: Sun Nov 28, 2010 5:09 pm
Posts: 385
Adelle I can confirm you can rezz higher than 4096, in fact I have been doing it up to 10,000 meters.. I have been working on a Skybox Platform rezzer.. What I have noticed is that not all Viewers will allow you to rezz and edit the results at those heights. Imprudence seems to be the best at this. However I found that with the old Meerkat Viewer you could go just above 10,000 with rezzing and editing of the objects. I was not brave enough to try any higher however. I was afraid I would run out of opensim oxygen.


Top
 Profile  
 
 Post subject: Re: Demo rezzer type script (how easy is it to create)?
PostPosted: Tue Apr 12, 2011 9:37 pm 
Furious Typer

Joined: Tue Oct 28, 2008 4:53 pm
Posts: 166
I tried using llRezObject something like this:-

llRezObject("object name", llGetPos() + <x,y,z>, <0,0,90>, <0,0,0>, 0);

Also I tried absolute xyz vector, but the object still gets rezzed somewhere in the sim, sometimes at ground level and sometimes at random elevations (I check with using the object scanner of the viewer), but using llRezObject at ground level works fine, but try it above ground and weird things happen.

The vendor being above the platform can not use llRezAtRoot, because all the vendors are on a wall and not linked, so, I would have to use llRezObject (in each vendor) using an absolute position vector to rez the build rezzer, then I could use llSay(channel, "command"); to tell the rezzer to rez the build, then use a timer event to derez the build and delete the rezzer after 15 minutes, but it's getting llRezObject to behave itself.


Top
 Profile  
 
 Post subject: Re: Demo rezzer type script (how easy is it to create)?
PostPosted: Tue Apr 12, 2011 9:59 pm 
OSG Elite
User avatar

Joined: Sat Jun 14, 2008 12:28 am
Posts: 384
Location: Australia
Hi, when you say
{L_QUOTE}:
even by using llRezObject the object rezzes somewhere else,

where else does it rez? it should rez where you say to rez.

Res the house where you want it to be, then take its position,
(Note), position should be taken from the red,green,blue, vector at the top of the screen not from the edit window because the location shown in the edit window is the position of the root prim, but the position shown at the top of the screen is the position of the centre of the linked set, which is the location at which llRezObject will put it.

then set this position in script
{L_CODE}:
vector housePos = 128,128,30;// where you want it to go

then use this vector variable in the script.
{L_CODE}:
llRezObject("house", housePos, ZERO_VECTOR, ZERO_ROTATION, 1);

Be aware if you use llGetPos()+<x,y,z> then the object will be placed x,y,and z away from llGetPos, this is an absolute vector in relation to the position of the calling object, whereas an absolute vector is simply x,y,z (without llGetPos() )
The wiki states
{L_QUOTE}:
Instantiate inventory object at pos with velocity vel and rotation rot with start parameter param
• string inventory – an object in the prim's inventory
• vector pos – position (in region coordinates)
• vector vel – velocity (max magnitude is approximately 200m/s)
• rotation rot – rotation
• integer param – on_rez event parameter and value returned by llGetStartParameter in the rezzed object (or by each of the items in a coalesced object).

The root of inventory is not at pos but the center of inventory is.
To have the root prim at pos use llRezAtRoot instead.

note that the third argument is velocity, so I dont know why you are using 0,0,90
this may be part of the problem
also llRezAtRoot is the position of the root of the object to be rezzed, not the calling object, in which case use the position found in the edit window for your vector housePos, instead of the vector at the top of the screen


Top
 Profile  
 
 Post subject: Re: Demo rezzer type script (how easy is it to create)?
PostPosted: Wed Apr 13, 2011 4:43 am 
Furious Typer

Joined: Tue Oct 28, 2008 4:53 pm
Posts: 166
I guess for some reason llRezObject does not work above ground.

This is what I did to test it.

1........create 4 linked cubes, 1.5m apart in a square, named 'Test Prims'
2........take note of position of 'Test Prims' shown at the top of the viewer
3........take linkset into inventory
4........create flat panel
5........drag 'Test Prims' from inventory to panel
6........create new script using test code below.

{L_CODE}:
vector TestPos = <133.040,128.915,3501.012>;   // Vector taken from top of viewer

default
{
    touch_start(integer tot_num)
    {
        llRezObject("Test Prims", TestPos, ZERO_VECTOR, ZERO_ROTATION, 1);
    }
}

Then I touch the panel and the linkset should rez at the TestPos location, but nothing happens

ADDENDUM
I even tried 20m in the X direction, relative from the calling prim, IE, llRezObject("Test Prims", llGetPos() + <20,0,0>, ZERO_VECTOR, ZERO_ROTATION, 1);

and still nothing happens. The only thing I can think of that's stopping it from working, is, that particular function just doesn't work in opensim.

I tested it in SL and it works perfectly from ground level, and way up to 4000m, it just refuses to work in opensim.

OK, I Found the problem, llRezObject will not allow rezzing beyond 10m in either direction.

I tested this by adding a script to "Test Prims", that would send it's position using a channel:-

{L_CODE}:
integer PrimChan = -13579;

default
{
       touch_start(integer tot_num)
                {
                     llSay(PrimChan, (string)llGetPos());
                 }
}

Then in the rezzing script I used:-
{L_CODE}:
integer PrimChan = -13579;
vector PrimPos;

default
{
     state_entry()
          {
               llListen(PrimChan, "", NULL_KEY, "");
          }
     listen(integer chan, string name, keyid, string msg)
          {
               PrimPos = (vector)msg;
          }
     touch_start(integer tot_num)
          {
               llRezObject("Test Prims", PrimPos, ZERO_VECTOR, ZERO_ROTATION, 1);
          }
}

Then by moving around the "Test Prim" object and touching it, sends it's position to the rezzing script, then I move it out the way, and touch the object with the rezzer, nothing happened, until I moved the "Test Prims" closer to the rezzer.

Inside 10m is ok, but beyond 10m, llRezObject will not rez anything.


So, the only way I can get the rezzed object to be beyond 10m, is to use a sleep in the rezzed object, then use an llSetPos to move it to the desired location, such as using an onrez event.
{L_CODE}:
on_rez(integer param)
     {
          llSleep(5);  //Give time for object to rez
          llSetPos(llGetPos() + <5,0,0>);
     }


Top
 Profile  
 
 Post subject: Re: Demo rezzer type script (how easy is it to create)?
PostPosted: Wed Apr 13, 2011 4:50 pm 
Site Admin

Joined: Sun Nov 28, 2010 5:09 pm
Posts: 385
I have been working on a skybox rezzer script and I now have it working pretty well now. So I will share it here. Now actually I have put together three scripts. The First is for a vehicle which will raise you to a predetermined height all the way up to 10,000 meters, but I have not included that here. And it is menu driven. The Avatar stands in the center and just clicks a menu to choose the height, then you right click the avatar and choose sit/teleport and it zaps you to the height. I have also included 5 pose balls for an other avatars that might want to go along for the ride.

Now I have the actual Rezzer script in a separate rezzer with is linked to the teleporter. I have it set up again with a menu system. You can choose a menu to rezzed an item, or a menu to derezz an item. For the time being I have only set up a 50 Meter Work Platform, and a 50 Meter Globe Skybox. Not much in it now, but just set it up to demo.

I set up a confirmation also when an item is to be derezzed asking if you really want to do it. Now basically how the rezzer works is I just put the item in my rezzer and rezz it without any adjustments to its location. Then I figured out what distance and/or rotation I will need to move it to where I want it to be. I use two adjustments to the llGetPos() result, one is SKYBOX_POS and the other is SKYBOX_ROT. By default these should be ZERO_VECTOR. So when you choose a particular SKYBOX or item from the menu, it will have its own adjustments to these two vectors. Once the SKYBOX or item is rezzed, I reset the values to ZERO_VECTOR. If I don't then the values from the previous rezzed SKYBOX may be included in the new SKYBOX values and that would mess up the locations.

I will upload all my scripts probably by this Friday for my full system, and place a copy of my complete SKYBOX rezzer in the Freebie Building in Wright Plaza. But for now this is just the Rezzer and Die Scripts. Now you need to place a unique channel in the items to be rezzed, and record that channel in the menu when the item it chosen. I used the variable cha for that. And the reason I have an assigned unique channel, that way you will only delete the items you want to delete instead of everything. Because my idea is to eventually include building tools as well as skyboxes or various furnishing for the boxes. If you want to try this script out, just place a 50X50 flat prim in the Rezzer and name it "50 X 50 Platform sp" and a Spere named "50 Meter Globe Skybox" and hollow it out first. But you can call them anything as long as you change the reference name in the script to the same thing.

This is the main Rezzer Script:

{L_CODE}:
// Skybox Rezzer by albertlr Landar April 2011
// You are free to use this script and its components as you wish, and
// Can modify it and make additions and changes to improve it as you
// see fit.


key id;

integer chan=48;
integer h;
integer cha;

string SKYBOX_NAME;
vector SKYBOX_POS = ZERO_VECTOR;
vector SKYBOX_ROT = ZERO_VECTOR;
vector BEFORE = ZERO_VECTOR;
vector BEFROT = ZERO_VECTOR;
string CMD_DIE = "die";
list mainmenu = ["Rezz Item", "Derezz Item", "EXIT"];
string mainmess="MAIN MENU - Choose a Menu Below ";


//*************************************************

list rezzmenu=["50M Platform","50M Globe","Blank 2","Blank 3","Blank 4","Blank 5","Blank 6","Blank 7","Blank 8","MAIN","EXIT", "Blank 9"];
string rezzmess="This is the Rezzing Menu";
//************************************************

//**************************************************
list derezzmenu=["Kill 50M","Kill Globe","Blank 11","Blank 12","Blank 13","Blank 14","Blank 15","Blank 16","Blank 17","MAIN","EXIT", "Blank 18"];
string derezzmess="This is the DeRezzing Menu";
//*******************************************

list suremenu=["YES","NO","EXIT"];
string suremess="ARE YOU SURE YOU WANT TO DELETE THIS SKYBOX ITEM?";

//***********************************************
 
init()
{
    key id;
    h = llListen(chan, "",id, "");
    llSetTimerEvent(20);
}

rezSkyBox() {
      SKYBOX_POS=BEFORE;
      SKYBOX_ROT=BEFROT;
    llRezObject(SKYBOX_NAME,llGetPos() + SKYBOX_POS, ZERO_VECTOR, llEuler2Rot(SKYBOX_ROT * DEG_TO_RAD), 0);
      SKYBOX_POS=ZERO_VECTOR;
      SKYBOX_ROT=ZERO_VECTOR;
}

default
{
    state_entry()
    {
        llSay(0,"Your Skybox Rezzer is Ready!");
    }
    touch_start(integer total_number)
    {
      if(llDetectedKey(0)==llGetOwner()){
        id = llDetectedKey(0);
        chan = 48 + llFloor(llFrand(123456.0)) + 1000;}
        init();
       
        llDialog(id,mainmess,mainmenu,chan);
    }
    //}

    listen( integer chan, string name, key id, string message )
    {
        ////////////////////////////////////////Menu section/////////////////////////////
        if (message == "MAIN")
        {
            llSetTimerEvent(20);
            llDialog(id,mainmess,mainmenu, chan);
        }
       
       
        if (message == "Rezz Item")
        {
            llSetTimerEvent(20);
            llDialog(id,rezzmess,rezzmenu, chan);
        }

        if (message == "Derezz Item")
        {
            llSetTimerEvent(20);
            llDialog(id,derezzmess,derezzmenu, chan);
        }

       
        if (message == "50M Platform")
        {   SKYBOX_NAME = "50 X 50 Platform sp";
            BEFORE = <SKYBOX_POS.x-21.0,SKYBOX_POS.y+18.0,SKYBOX_POS.z-2.0>;
            BEFROT = ZERO_VECTOR;
            llWhisper(0,"Rezzing 50M Work Platform");
            llSetTimerEvent(20);
            rezSkyBox();
        }

       
        if (message == "Kill 50M")
        {
          cha = 4978;
          llDialog(id,suremess,suremenu, chan);                             
        }

        if (message == "Kill Globe")
        {
          cha = 4979;
          llDialog(id,suremess,suremenu, chan);
                                       
        } 

           if (message == "YES")
        {  llWhisper(0,"Your Rezzed Item Will Be Deleted");
           llShout(cha, CMD_DIE);
           llWhisper(0, CMD_DIE);           
        }
                         
          if (message == "NO")
        {
            llWhisper(0,"ok, going back to main menu");
            llSetTimerEvent(20);
            llDialog(id,mainmess,mainmenu, chan);
        }
        if (message == "EXIT")
        {
            llListenRemove(h);
        }     
       
        if (message == "50M Globe")
        {   SKYBOX_NAME = "50 Meter Globe Skybox";
            BEFROT = <0.0,90.0,0.0>;
            BEFORE = <SKYBOX_POS.x+10.0,SKYBOX_POS.y+10.0,SKYBOX_POS.z+10.7>;
            llWhisper(0,"Rezzing 50M Globe SkyBox");
            llSetTimerEvent(20);
            rezSkyBox();
        }
        if (message == "Blank 2")
        {
            llSetTimerEvent(20);
            llWhisper(0,"This Menu Choice is Blank");
            llDialog(id,rezzmess,rezzmenu, chan);

        }
        if (message == "Blank 3")
        {
            llSetTimerEvent(20);
            llWhisper(0,"This Menu Choice is Blank");
            llDialog(id,rezzmess,rezzmenu, chan);

        }
        if (message == "Blank 4")
        {
            llSetTimerEvent(20);
            llWhisper(0,"This Menu Choice is Blank");
            llDialog(id,rezzmess,rezzmenu, chan);

        }

if (message == "Blank 5")
        {
            llSetTimerEvent(20);
            llWhisper(0,"This Menu Choice is Blank");
            llDialog(id,rezzmess,rezzmenu, chan);

        }
if (message == "Blank 6")
        {
            llSetTimerEvent(20);
            llWhisper(0,"This Menu Choice is Blank");
            llDialog(id,rezzmess,rezzmenu, chan);

        }
if (message == "Blank 7")
        {
            llSetTimerEvent(20);
            llWhisper(0,"This Menu Choice is Blank");
            llDialog(id,rezzmess,rezzmenu, chan);

        }
if (message == "Blank 8")
        {
            llSetTimerEvent(20);
            llWhisper(0,"This Menu Choice is Blank");
            llDialog(id,rezzmess,rezzmenu, chan);

        }
if (message == "Blank 9")
        {
            llSetTimerEvent(20);
            llWhisper(0,"This Menu Choice is Blank");
            llDialog(id,rezzmess,rezzmenu, chan);

        }
if (message == "Blank 10")
        {
            llSetTimerEvent(20);
            llWhisper(0,"This Menu Choice is Blank");
            llDialog(id,derezzmess,derezzmenu, chan);

        }
if (message == "Blank 11")
        {
            llSetTimerEvent(20);
            llWhisper(0,"This Menu Choice is Blank");
            llDialog(id,derezzmess,derezzmenu, chan);

        }
if (message == "Blank 12")
        {
            llSetTimerEvent(20);
            llWhisper(0,"This Menu Choice is Blank");
            llDialog(id,derezzmess,derezzmenu, chan);

        }
if (message == "Blank 13")
        {
            llSetTimerEvent(20);
            llWhisper(0,"This Menu Choice is Blank");
            llDialog(id,derezzmess,derezzmenu, chan);

        }
if (message == "Blank 14")
        {
            llSetTimerEvent(20);
            llWhisper(0,"This Menu Choice is Blank");
            llDialog(id,derezzmess,derezzmenu, chan);

        }
if (message == "Blank 15")
        {
            llSetTimerEvent(20);
            llWhisper(0,"This Menu Choice is Blank");
            llDialog(id,derezzmess,derezzmenu, chan);

        }
if (message == "Blank 16")
        {
            llSetTimerEvent(20);
            llWhisper(0,"This Menu Choice is Blank");
            llDialog(id,derezzmess,derezzmenu, chan);

        }
if (message == "Blank 17")
        {
            llSetTimerEvent(20);
            llWhisper(0,"This Menu Choice is Blank");
            llDialog(id,derezzmess,derezzmenu, chan);

        }
if (message == "Blank 18")
        {
            llSetTimerEvent(20);
            llWhisper(0,"This Menu Choice is Blank");
            llDialog(id,derezzmess,derezzmenu, chan);

        }

        if (message == "EXIT")

        {
            llListenRemove(h);
        }
       
       
    }   
    timer()
    {
        llListenRemove(h);
    }
}


This is the die Script which goes into the Platform:

{L_CODE}:
string CMD_DIE = "die";

integer cha = 4978;


default {

    state_entry() {


        llListen(cha, "", NULL_KEY, "");


    } // state_entry

    on_rez(integer start_param) {

        llResetScript();

    } // on_rez

    listen(integer cha, string name, key id, string message) {

        llSay(0, message);


        if (message == CMD_DIE) {
            llDie();
            llWhisper(0, "I am being deleted!");
        }
    } // default
}


This is the Die Script that goes into the Hollow Globe:

{L_CODE}:
string CMD_DIE = "die";

integer cha = 4979;


default {

    state_entry() {


        llListen(cha, "", NULL_KEY, "");


    } // state_entry

    on_rez(integer start_param) {

        llResetScript();

    } // on_rez

    listen(integer cha, string name, key id, string message) {

        llSay(0, message);


        if (message == CMD_DIE) {
            llDie();
            llSay(0, "I am being deleted!");
        }
    } // default
}


Now I have not had any problems with the items drifting or being rezzed in different postions. I have gone up to 8000 meters and they seem to work fine. The only problem I can see is if they are not properly reset to ZERO_VECTOR before you try to rezz another item. I have in fact experimented with rezzing my platform on top of my Globe and they appear in the same place each time. So good luck hope this helps. And I have experimented with how far I could rezz an item from the rezzer, and was able to get up to 500 meters from the rezzer, but the die scripts seem to be limited to 100 meters at most.


Top
 Profile  
 
 Post subject: Re: Demo rezzer type script (how easy is it to create)?
PostPosted: Thu Apr 14, 2011 4:33 am 
Site Admin

Joined: Sun Nov 28, 2010 5:09 pm
Posts: 385
Marlon it occured to me the reason you have limits on your rezzer script and I do not, is most likely because you have this setting in your opensim.ini file set to the default which limits the script action to just 10 meters:

{L_CODE}:
;; The factor the 10 m distances llimits are multiplied by
     ScriptDistanceLimitFactor = 1.0


I changed mine to 50 and that allows me to rezz objects up to 500 meters away from the script source. So if you want to rezz to 20 meters just change it to 2.0, or for 30 meters 3.0, etc.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post a new topicPost a reply Page 1 of 1   [ 8 posts ]


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  


Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
610nm Style by Daniel St. Jules of Gamexe.net