Jump to content

Roadmap Writer

Resident
  • Posts

    48
  • Joined

  • Last visited

Reputation

0 Neutral

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Thank you Rolig, thank you Dora, Thanks for the position/rotation solution. It works like a charm now. And thanks for llSetRegionPos reply. Both dragged me upwards along the learning curve of LSL ;-) Road
  2. It's the WarpPos procedure as shown in http://lslwiki.net/lslwiki/wakka.php?wakka=LibraryWarpPos Isnt that needed anymore to overcome the 10m limit of llSetPos()? Road NEW: or maybe a better solution is: llSetRegionPos(newPos);llSetPos(newPos); ?
  3. No, i do not rez with llRez*... I just rez an object, reads the relative pos & rot from the description, and after sensing the marker it moves to the desired position & rotation. Complete code below ;-) string HOUSE_OLD = "MarkerOldSpot";string HOUSE_NEW = "MarkerNewSpot";vector myPos;rotation myRot;vector newPos;rotation newRot;string marker;vector markerPos;rotation markerRot;vector relPos;rotation relRot;default { on_rez(integer parm) { llResetScript(); } state_entry() { marker = HOUSE_OLD; llSensor(marker, NULL_KEY, ACTIVE|PASSIVE, 96, PI); } sensor(integer num) { key id = llDetectedKey(0); list p = llGetObjectDetails(id, [OBJECT_POS, OBJECT_ROT]); markerPos = (vector) llList2String(p,0); markerRot = (rotation) llList2String(p,1); myPos = llGetPos(); myRot = llGetRot(); if (marker == HOUSE_OLD) { relPos = (myPos - markerPos)/markerRot; relRot = myRot / markerRot; llSetObjectDesc( (string)relPos + ";" + (string)relRot ); llSay(0,"/me's location has been saved. You can take (a copy of) me and rez it at the new house."); } else if (marker == HOUSE_NEW) { list temp = llParseString2List(llGetObjectDesc(),[";"],[]); relPos = (vector) llList2String(temp,0); relRot = (rotation) llList2String(temp,1); newPos = markerPos + (relPos * markerRot); newRot = relRot * markerRot; integer iHops = llAbs(llCeil(llVecDist(myPos, newPos) / 10.0)); integer i; list Params = []; for( i = 0; i < iHops; i++ ) Params += [ PRIM_POSITION, newPos ]; llSetPrimitiveParams(Params); llSetRot(newRot); llSay(0,"/me has been placed at it's original spot. Script has been removed."); llSetObjectDesc(""); llRemoveInventory(llGetScriptName()); } } no_sensor() { if (marker == HOUSE_OLD) { marker = HOUSE_NEW; llSensor(marker, NULL_KEY, ACTIVE|PASSIVE, 96, PI); } else if (marker == HOUSE_NEW) { llSay(0, "Cannot find a marker."); } }} Perhaps you can see a glitch?
  4. The multiplication gives a compile error... vector newPosition = marker2Position + (marker2Rotation * relativePosition); Think your first version is better ;-) Tested with some objects, most do well, but more complicated objects fail with their rotation... will experiment a little with local and root rotations, perhaps that's my treshold as well Road
  5. Thank you, Dora! I will test it later today Road.
  6. I need some help with the following. I have an object at a certain position and rotation. Nearby is a marker-object. Some further away I have another marker that has a different position and rotation as the first marker. Now i like to move the object to this second marker with the same relative position and rotation as it had in relation to the first marker. I am really stuck at the SL-math needed. Any help would be wonderful. Thanks in advance! Roadmap Writer.
  7. Apparently I thought way too difficult. Thanks for the solution, Dora, it works exactly as i was looking for!
  8. I need some help with the so nasty orientation/rotation math of LSL :-) The context is that i like to rez tiles aligning to a "master"-tile. The problem however is that i dont get it done. The master tile has a scale of <0.5, 0.5, 0.1>. When I touch one of the low-height-sides, I can detect the normal vector of that side with llDetectedTouchNormal(0). At the moment of the touch, i like to have a new tile rezzed of the same scale, but perfectly aligned (glued, without linking) to the touched side of the master tile. As long as I dont use any rotation around the x- or y-axis i manage to get it done. Like to have it more full proof with the math so that rezzing a new tile in every position and rotation will be aligned making a plane from out the master tile. Thanks in advance for any mathematical + script help. Roadmap Writer.
  9. Thank you very much. I indeed used ll GiveInventoryList. Will change it back to llGiveInventory(). All of your help is so much appreciated.
  10. Thanks so far... I want to make it for the receiving avatar as simple as it can be. Is there a solution to make a "pigeon" which flies to the sim of the avatar and give it then?
  11. For a charity project i want to script an object giver. But llGiveInventory only works within a sim. Is there a way to give objects gridwide to a selected avatar?
  12. Just tried it. I wasnt ruthed myself, but saw everybody around me as grey. Sat on such a chair, and within a second all avatars around me werent grey anymore. Amazing to discover to be honest.
  13. I have used the following to let certain letters appear on a box. It has one texture with all letters on it divided in rows and columns. Perhaps you can use the same principle for your colored rectangle make a texture with your somewhere in the middle. Suppose you have one texture with the letters of the alphabet on it, divided in seven rows of four letters. Like this: A B C D E F G H I J K L M N O P Q R S T U V W X Y Z , . When you want to show just one letter of the alphabet onto the sides of a prim, you will have to do some math to calculate the offsets you need. The function i like to share has an index as input. This index is (in this case) the number of the letter of the alphabet you like to share. So when you want to share the "A" the index is 1. So the first row is indexed by 1..4, the second row by 5..8, and so on. It will work for any horizontal and vertical division set by the variables HOR and VER. integer HOR = 4; integer VER = 7; showLetter(integer index) { // index out of [1,28] in this case llScaleTexture(1.0/HOR,1.0/VER,ALL_SIDES); integer xN = (index-1) % HOR; integer yN = (index-1) / HOR; float xOffset = -0.5 + 0.5/HOR + (float) xN / (float) HOR; float yOffset = 0.5 -0.5/VER - (float) yN / (float) VER; llOffsetTexture(xOffset, yOffset,ALL_SIDES); And to get the a location on a grid at the texture (like above 4 columns, 7 rows) where someone touched the texture I use the following function: integer cell(vector pos, list xyDimension) { integer divsX=llList2Integer(xyDimension,0); integer divsY=llList2Integer(xyDimension,1); return llFloor(pos.x * divsX) + divsX * llFloor((1-pos.y) * divsY) + 1; like: touch_start(integer num) { vector pos = llDetectedTouchST(0); integer numberOnGrid = cell(pos,[4,3]); llSay(0, "position"+ (string) numberOnGrid + "touched."); }
  14. Thank you all for your great help! Very much appreciated.
  15. Thanks for your directions. The first one also popped up into my mind. But, are, let's say the first 4 or 6 hex digits, enough to discriminate it from others? Or the last ones?
×
×
  • Create New...