Skip to content

Commit

Permalink
Move rezzed linked objects on the board
Browse files Browse the repository at this point in the history
  • Loading branch information
zadium committed Nov 11, 2022
1 parent eb4e074 commit 9e5a878
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 9 deletions.
23 changes: 16 additions & 7 deletions ChessBoard.lsl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
@author: Zai Dium
@update: 2022-02-16
@revision: 387
@revision: 398
@localfile: ?defaultpath\Chess\[email protected]
@license: MIT
Expand Down Expand Up @@ -65,12 +65,12 @@ list initBoard =
[
"pb", "pb", "pb", "pb", "pb", "pb", "pb", "pb",
"rb", "nb", "bb", "qb", "kb", "bb", "nb", "rb",
"", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "",
"rw", "nw", "bw", "qw", "kw", "bw", "nw", "rw",
"pw", "pw", "pw", "pw", "pw", "pw", "pw", "pw"
"", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "",
"pw", "pw", "pw", "pw", "pw", "pw", "pw", "pw",
"rw", "nw", "bw", "qw", "kw", "bw", "nw", "rw"
];

list board;
Expand Down Expand Up @@ -241,7 +241,10 @@ clearBoard(){
while(i <= c)
{
if (llListFindList(pc, [llGetLinkName(i)])>=0) //* llGetLinkName based on 1
{
llOwnerSay("unlink"+(string)i);
llBreakLink(i);
}
i++;
}
}
Expand Down Expand Up @@ -365,6 +368,12 @@ default
object_rez(key id)
{
llCreateLink(id, TRUE);
integer index = getLinkByKey(id);
list values = llGetLinkPrimitiveParams(index, [PRIM_SIZE, PRIM_POS_LOCAL]);
vector s = llList2Vector(values, 0);
vector v = llList2Vector(values, 1);
v.z = s.z / 2 + size.z / 2;
llSetLinkPrimitiveParams(index, [PRIM_POSITION, v]);
}

changed(integer change)
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@ Chess Board for OpenSim/SecondLife

### Chess board

In object mode, select all, export as Dae file, Import it to opensim using Firestoarm, check lod as above to make it if you like (optional)

In Blender in object mode, select all, export as Dae file, Import it to opensim using Firestoarm, check lod as above to make it if you like (optional)

* Rezz it in the world
* Unlink all chessboard
* Unlink all chessboard objects
* Dublicate a small sequare to another one, name first one as ActiveFrom, name second one as ActiveTo, color it as you like, care about letter case
* Link it again to the main board (colored white and black) as root
* Copy ChessBoard.lsl into the root object
Expand Down

0 comments on commit 9e5a878

Please sign in to comment.