Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

reversed numbering

Tarak Voss
Meanderer
Join date: 14 Oct 2006
Posts: 330
12-02-2008 03:16
I have the following script (part of a whole)

touch_start(integer n)
{
integer face = llDetectedTouchFace(0);
llSay(0,"Touched face : " + (string)face);
if (face == -1) llSay(0, "old client please change blah";);
.....
else
{
vector pos = llDetectedTouchST(0);

integer square = (llFloor(pos.x * 10.0))*10 + llCeil(pos.y * 1.0);
if (square == 1)
{
llSay(0,"previous: " + (string)square);//test value
return;
}
if (square == 91)
{
llSay(0,"Next: " + (string)square);//test value
return;
}
.........................

This give a grid of 10 collumns and 1 row. Now the problem is it numbers right to left - I need it going left to right and I don't want to rotate the prim or texture.

Any ideas??
Taff Nouvelle
Virtual Business Owners
Join date: 4 Sep 2006
Posts: 216
12-02-2008 04:32
I am not sure what you are doing, but when I use a basic script it numbers from left to right top to bottom.

CODE
 

default
{
state_entry()
{
}
touch_start(integer total_number)
{
integer face = llDetectedTouchFace(0);
if (face == -1)
llOwnerSay("old client");
else
{
vector pos = llDetectedTouchST(0);
integer Pos = (llFloor(pos.x * 4.0))*4 + llCeil(pos.y * 4.0);
llOwnerSay((string)Pos);
}
}
}

[\PHP]
Tarak Voss
Meanderer
Join date: 14 Oct 2006
Posts: 330
12-02-2008 05:14
hmmmm - for some reason mine goes in the opposite direction - I'll take anothe look - thanks Taff
Tarak Voss
Meanderer
Join date: 14 Oct 2006
Posts: 330
12-02-2008 05:35
Red face all round - the texture I was using had been flipt which meant I was reading it back to front

derrrr
Herfulnerful Holsworthy
Registered User
Join date: 27 Nov 2006
Posts: 8
12-02-2008 08:45
If you were to replace the following first 2 lines of script you would have a texture on the face of your prim with these 3 lines. The number line is also left to right, bottom to top.

(where the texture UUID, 2 = where 2 is the face of the prim you want the texture on)

CODE

default
{
state_entry()
{
llSetTexture("3245bcf1-f721-52ec-2895-ea6d3909c7ed", 2);
}

(continue on with the below script ... at the "touch_start line)


Once the script is compiled, then all you will need to do is modify the texture face to display the required number of lines and numbers needed. It defaults to 10 lines of 10.

Hope this helps
From: Taff Nouvelle
I am not sure what you are doing, but when I use a basic script it numbers from left to right top to bottom.

CODE
 

default
{
state_entry()
{
}
touch_start(integer total_number)
{
integer face = llDetectedTouchFace(0);
if (face == -1)
llOwnerSay("old client");
else
{
vector pos = llDetectedTouchST(0);
integer Pos = (llFloor(pos.x * 4.0))*4 + llCeil(pos.y * 4.0);
llOwnerSay((string)Pos);
}
}
}

[\PHP]
Tarak Voss
Meanderer
Join date: 14 Oct 2006
Posts: 330
texture Key
12-02-2008 14:38
thanks