User:Gimisa
From OpenSimulator
m |
(sharing my notes an experience on opensim) |
||
Line 1: | Line 1: | ||
− | I am opensim user and simulator operator. I would like to share my notes so its usefull to others. : | + | <nowiki>Insert non-formatted text here</nowiki>I am opensim user and simulator operator. I would like to share my notes so its usefull to others. : |
---- | ---- | ||
Line 16: | Line 16: | ||
OAR. | OAR. | ||
+ | |||
I advocate the use of OAR for backup similarly to any other software file extension. I believe that creators in opensim shall be able to save their work as easily within their region as creating a document in word. For now you can do that with an object inworld and a opensim script command call osConsoleCommand(string command). That script command is high treat level as define in by opensim. Therefor it has to be authorize by simulator operator for parcel owner in the region simulator as follow: | I advocate the use of OAR for backup similarly to any other software file extension. I believe that creators in opensim shall be able to save their work as easily within their region as creating a document in word. For now you can do that with an object inworld and a opensim script command call osConsoleCommand(string command). That script command is high treat level as define in by opensim. Therefor it has to be authorize by simulator operator for parcel owner in the region simulator as follow: | ||
− | |||
− | + | Allow_osConsoleCommand = PARCEL_OWNER or UUID | |
+ | |||
+ | You can also use the UUID of the simulator operator to enforce treat level and rez the object yourself for your guess to use. | ||
+ | This script will automatically save an oar when the prim count change by more then 10 . | ||
+ | OAR saving can also be initiated by touch. | ||
+ | Here is an exemple of the script for such an object. : | ||
+ | |||
+ | //gimisa@yahoo.fr 130502 | ||
+ | //oar saver rez on region you are owner | ||
+ | //see read.me for instruction | ||
+ | //130502 add interaction with hud | ||
+ | //gimisa@yahoo.fr 130120 | ||
+ | |||
+ | integer setup=FALSE;//Chnage to false to complete setup | ||
+ | string dir="/home/gimisa/Bureau/oar/gimisa/";//the location where to sa ve the oar so your user can access it. | ||
+ | //_________________________________ | ||
+ | key id = "598c76d4-a9d0-2fd6-0a81-fc72dca068b5";//default key | ||
+ | string idName="gimisa"; | ||
+ | key dtc;//detected avatar | ||
+ | string region;//region name | ||
+ | string cmd;//command | ||
+ | integer ok;//status | ||
+ | integer pcount;//number of prim cunt | ||
+ | integer ppcount;//previous prim count | ||
+ | integer flag=FALSE;//save oar flag | ||
+ | |||
+ | //_________________________________ | ||
+ | integer dbug=FALSE; | ||
+ | |||
+ | saveOAR(){ | ||
+ | region=llGetRegionName(); | ||
+ | ok=osConsoleCommand("change region "+ region); | ||
+ | string tme=llGetTimestamp(); | ||
+ | llSay(0,"Region: "+ region); | ||
+ | llInstantMessage(id,"saving oar " +dir+region + "."+tme + ".tgz" ); | ||
+ | llSay(0, "please wait a few minutes to complete"); | ||
+ | if(!setup) ok=osConsoleCommand("save oar " +dir+region + "."+ tme + ".tgz"); | ||
+ | osMakeNotecard(dir+region + "."+ tme + ".tgz","");//storgage is done by notecard name | ||
+ | llSetObjectDesc((string)pcount);//count is store in object description | ||
+ | } | ||
+ | |||
+ | sayPrimCount(){ | ||
+ | llSay(PUBLIC_CHANNEL, | ||
+ | "There are " + primCountThisParcel(PARCEL_COUNT_TOTAL) + " total prims on this parcel."); | ||
+ | llSay(PUBLIC_CHANNEL, | ||
+ | primCountThisParcel(PARCEL_COUNT_OWNER) + " prims are owned by the parcel owner."); | ||
+ | llSay(PUBLIC_CHANNEL, | ||
+ | primCountThisParcel(PARCEL_COUNT_GROUP) + " prims set to or owned by the parcel's group."); | ||
+ | llSay(PUBLIC_CHANNEL, | ||
+ | primCountThisParcel(PARCEL_COUNT_OTHER) + " prims that are not set to the parcel group or owned by the parcel owner."); | ||
+ | llSay(PUBLIC_CHANNEL, | ||
+ | primCountThisParcel(PARCEL_COUNT_SELECTED) + " prims are selected."); | ||
+ | llSay(PUBLIC_CHANNEL, | ||
+ | primCountThisParcel(PARCEL_COUNT_TEMP) + " prims are temp-on-rez."); | ||
+ | } | ||
+ | string primCountThisParcel(integer flag) | ||
+ | { | ||
+ | vector currentPosition = llGetPos(); | ||
+ | pcount=llGetParcelPrimCount(currentPosition, PARCEL_COUNT_TOTAL, FALSE); | ||
+ | return | ||
+ | (string)llGetParcelPrimCount(currentPosition, flag, FALSE); | ||
+ | } | ||
+ | |||
+ | default | ||
+ | { state_entry(){ | ||
+ | id=llGetLandOwnerAt(llGetPos()); | ||
+ | idName=llKey2Name(id); | ||
+ | llSetTouchText(idName); | ||
+ | llSetSitText("-"); | ||
+ | llSetTimerEvent(1.); | ||
+ | } | ||
+ | |||
+ | |||
+ | touch_start(integer num_detected) | ||
+ | { dtc=llDetectedKey(0); | ||
+ | if ( !(dtc==id | dtc ==llGetOwner())) { | ||
+ | llSay(0, "sorry but only "+ idName + " can use this"); | ||
+ | return;} | ||
+ | |||
+ | sayPrimCount();//say in open chat prim counts of the sim | ||
+ | saveOAR();//save oar | ||
+ | state wait; | ||
+ | } | ||
+ | timer(){ | ||
+ | llSetTimerEvent(1800.); | ||
+ | ppcount=(integer) llGetObjectDesc(); | ||
+ | primCountThisParcel(PARCEL_COUNT_TOTAL); | ||
+ | if(pcount==0) return; | ||
+ | if(ppcount==0){ ppcount=pcount;llSetObjectDesc((string)pcount); } | ||
+ | if((pcount-ppcount>10 | pcount-ppcount<-10) && !flag){flag=TRUE; llSetTimerEvent(60.*15.);return;} | ||
+ | flag=FALSE; | ||
+ | llSetTimerEvent(3600.); | ||
+ | if(!(pcount-ppcount>10 | pcount-ppcount<-10) )return; | ||
+ | sayPrimCount();//say in open chat prim counts of the sim | ||
+ | saveOAR();//save oar | ||
+ | } | ||
+ | } | ||
+ | |||
+ | state wait { | ||
+ | state_entry(){ llSetTimerEvent(5.0*60.);} | ||
+ | |||
+ | timer(){ llSay(0,"will appear on FTP when complete"); | ||
+ | llSetTimerEvent(0.); | ||
+ | llLoadURL(dtc, "OAR FTP SITE", "ftp://where.to.access.the.oar.file"); | ||
+ | llResetScript();} | ||
+ | } | ||
+ | |||
+ | |||
+ | You can find a free copy along with a tutorial about oars and the object oarsaver in the little grid I operate for testing purpose call gimisaOS. You can reach it via Hypergrid using your viewer map with search for 3d.gimisa.ca:9000 | ||
+ | |||
+ | Hope it help | ||
150513 | 150513 |
Revision as of 15:01, 13 May 2015
Insert non-formatted text hereI am opensim user and simulator operator. I would like to share my notes so its usefull to others. :
VOCABULARY: my understanding of the following terms.
GRID: One ore more simulator (SIM) supported by one or more robust.exe instance. OAR: Archiving file for region. PARCEL a subdivision of a region minimum size is 4mx4m= 16 meter square REGION a 256mx256m = 65,536 meters square area in opensim SIMULATOR: also call SIM one opensim.exe instance running supporting one ore more region(s). STANDALONE: The simulator and the supporting services are all run from one instance of opensim.exe VARREGION: a region with variable dimension. At time of writing limited to square values of multiples of regions (ex. 4x4 = 16 region area) .
OAR.
I advocate the use of OAR for backup similarly to any other software file extension. I believe that creators in opensim shall be able to save their work as easily within their region as creating a document in word. For now you can do that with an object inworld and a opensim script command call osConsoleCommand(string command). That script command is high treat level as define in by opensim. Therefor it has to be authorize by simulator operator for parcel owner in the region simulator as follow:
Allow_osConsoleCommand = PARCEL_OWNER or UUID
You can also use the UUID of the simulator operator to enforce treat level and rez the object yourself for your guess to use. This script will automatically save an oar when the prim count change by more then 10 . OAR saving can also be initiated by touch. Here is an exemple of the script for such an object. :
//gimisa@yahoo.fr 130502 //oar saver rez on region you are owner //see read.me for instruction //130502 add interaction with hud //gimisa@yahoo.fr 130120 integer setup=FALSE;//Chnage to false to complete setup string dir="/home/gimisa/Bureau/oar/gimisa/";//the location where to sa ve the oar so your user can access it. //_________________________________ key id = "598c76d4-a9d0-2fd6-0a81-fc72dca068b5";//default key string idName="gimisa"; key dtc;//detected avatar string region;//region name string cmd;//command integer ok;//status integer pcount;//number of prim cunt integer ppcount;//previous prim count integer flag=FALSE;//save oar flag //_________________________________ integer dbug=FALSE; saveOAR(){ region=llGetRegionName(); ok=osConsoleCommand("change region "+ region); string tme=llGetTimestamp(); llSay(0,"Region: "+ region); llInstantMessage(id,"saving oar " +dir+region + "."+tme + ".tgz" ); llSay(0, "please wait a few minutes to complete"); if(!setup) ok=osConsoleCommand("save oar " +dir+region + "."+ tme + ".tgz"); osMakeNotecard(dir+region + "."+ tme + ".tgz","");//storgage is done by notecard name llSetObjectDesc((string)pcount);//count is store in object description } sayPrimCount(){ llSay(PUBLIC_CHANNEL, "There are " + primCountThisParcel(PARCEL_COUNT_TOTAL) + " total prims on this parcel."); llSay(PUBLIC_CHANNEL, primCountThisParcel(PARCEL_COUNT_OWNER) + " prims are owned by the parcel owner."); llSay(PUBLIC_CHANNEL, primCountThisParcel(PARCEL_COUNT_GROUP) + " prims set to or owned by the parcel's group."); llSay(PUBLIC_CHANNEL, primCountThisParcel(PARCEL_COUNT_OTHER) + " prims that are not set to the parcel group or owned by the parcel owner."); llSay(PUBLIC_CHANNEL, primCountThisParcel(PARCEL_COUNT_SELECTED) + " prims are selected."); llSay(PUBLIC_CHANNEL, primCountThisParcel(PARCEL_COUNT_TEMP) + " prims are temp-on-rez."); } string primCountThisParcel(integer flag) { vector currentPosition = llGetPos(); pcount=llGetParcelPrimCount(currentPosition, PARCEL_COUNT_TOTAL, FALSE); return (string)llGetParcelPrimCount(currentPosition, flag, FALSE); } default { state_entry(){ id=llGetLandOwnerAt(llGetPos()); idName=llKey2Name(id); llSetTouchText(idName); llSetSitText("-"); llSetTimerEvent(1.); } touch_start(integer num_detected) { dtc=llDetectedKey(0); if ( !(dtc==id | dtc ==llGetOwner())) { llSay(0, "sorry but only "+ idName + " can use this"); return;} sayPrimCount();//say in open chat prim counts of the sim saveOAR();//save oar state wait; } timer(){ llSetTimerEvent(1800.); ppcount=(integer) llGetObjectDesc(); primCountThisParcel(PARCEL_COUNT_TOTAL); if(pcount==0) return; if(ppcount==0){ ppcount=pcount;llSetObjectDesc((string)pcount); } if((pcount-ppcount>10 | pcount-ppcount<-10) && !flag){flag=TRUE; llSetTimerEvent(60.*15.);return;} flag=FALSE; llSetTimerEvent(3600.); if(!(pcount-ppcount>10 | pcount-ppcount<-10) )return; sayPrimCount();//say in open chat prim counts of the sim saveOAR();//save oar } } state wait { state_entry(){ llSetTimerEvent(5.0*60.);} timer(){ llSay(0,"will appear on FTP when complete"); llSetTimerEvent(0.); llLoadURL(dtc, "OAR FTP SITE", "ftp://where.to.access.the.oar.file"); llResetScript();} }
You can find a free copy along with a tutorial about oars and the object oarsaver in the little grid I operate for testing purpose call gimisaOS. You can reach it via Hypergrid using your viewer map with search for 3d.gimisa.ca:9000
Hope it help 150513