Jump to content

Using Face Finder Script returns 0


You are about to reply to a thread that has been inactive for 564 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

Hi,

This is driving me nuts.
I am in the process of creating a HUD for my Destino Customised Textures.
Every time I run a face finding script, using Select Face or Edit Linked and Select Face or Edit Linked only, it always returns 0 as the value. It reports different link numbers.
I have looked every where for an answer to this and found one relevant post on here but the reply did not provide a solution.
What am I doing wrong?

 

Link to comment
Share on other sites

If it's only the face number you are interested in, selecting a face and hitting Ctrl+Shift+Alt+T will tell what face number it is.

If you are up to something else it would be a scripting problem then. AFAIK there is no script function that would tell which face you have selected through the build floater.
There is llDetectedTouchFace(0) which will return the face number when touched.

Edited by arton Rotaru
  • Like 1
Link to comment
Share on other sites

1 hour ago, arton Rotaru said:

If it's only the face number you are interested in, selecting a face and hitting Ctrl+Shift+Alt+T will tell what face number it is.

If you are up to something else it would be a scripting problem then. AFAIK there is no script function that would tell which face you have selected through the build floater.
There is llDetectedTouchFace(0) which will return the face number when touched.

Thanks for the tip arton, I really appreciate it.

Using Ctrl+Shift+Alt+T returned the same results as my script which was given to me by the guy who produced the Destino.
The script I use to find the face and link number does have that line in it.

I have seen other people selling HUDS with customised textures for the TMS Destino so they must be able to find the face numbers. I have tried everything now.
I have all my textures ready to go. I have designed the HUD and will be using the PXL Hud script. I do not see how I can complete this without face numbers.

Link to comment
Share on other sites

1 hour ago, Johnny Giotto said:

Every time I run a face finding script, using Select Face or Edit Linked and Select Face or Edit Linked only, it always returns 0 as the value.

This part doesn't make much sense. How exactly are you triggering the "face finding script?" What does the script even do?

The code should not be more complicated than this (and the link finding part I suppose):

default
{
  touch_start(integer n)
  {
    llOwnerSay((string)llDetectedTouchFace(0));
  }
}

You shouldn't have to be in edit mode at all. Simply left-clicking on any face will give the script enough information to tell which link/face was touched.

  • Like 1
Link to comment
Share on other sites

6 minutes ago, Wulfie Reanimator said:

This part doesn't make much sense. How exactly are you triggering the "face finding script?" What does the script even do?

The code should not be more complicated than this (and the link finding part I suppose):

default
{
  touch_start(integer n)
  {
    llOwnerSay((string)llDetectedTouchFace(0));
  }
}

You shouldn't have to be in edit mode at all. Simply left-clicking on any face will give the script enough information to tell which link/face was touched.

You're right, my mistake. I can do it the way you described only no matter what part of the boat I 'Touch' it always returns 0.

Link to comment
Share on other sites

1 minute ago, Johnny Giotto said:

You're right, my mistake. I can do it the way you described only no matter what part of the boat I 'Touch' it always returns 0.

Try this script too. (Sorry about the verbose comments in it - I did tend to overdo those back in my early SL days. 😉

/* A simple script to colour code the faces of a prim or a mesh (or a multi faced sculpt.) This is meant as a convenient way to see all the face numbers at a glance.

To use it, just drag it onto the object you want to code. If the object is in a linkset, you need to open it an drop it into the object. The script will self-delete so there's no need to do anything with it after it's been used.

Important note: The script will override all existing textures and colours of the object so use it with caution. If you want to know the face numbers without loosing the existing texturing, use this on a disposable copy of it rather than the original.

Face colors:
    0: Red
    1: Yellow
    2: Green
    3: Cyan (Light blue)
    4: Blue
    5: Magenta (Purple)
    6: Orange
    7: Brown
    8: White
*/

 default
{
    state_entry()
    {
        llSetTexture("5748decc-f629-461c-9a36-a35a221fe21f", ALL_SIDES);
        llSetColor(<1, 0, 0>, 0);
        llSetColor(<1, 1, 0>, 1);
        llSetColor(<0, 1, 0>, 2);
        llSetColor(<0.5, 1, 1>, 3);
        llSetColor(<0, 0, 1>, 4);
        llSetColor(<1, 0, 1>, 5);
        llSetColor(<1, 0.5, 0>, 6);
        llSetColor(<0.5, 0.25, 0>, 7);
        llSetColor(<1, 1, 1>, 8);
        llRemoveInventory(llGetScriptName());
    }

}

/*
HOW TO MODIFY THE SCRIPT

You can change the colour codes any way you like of course. There is no fixed standard to colour coding prim faces but the ones I've chosen are fairly close to what most seem to use. If you want to retain the textures, you can just add two slashes - // - in front of "llSetTexture" 

--------------
--------------

COPYRIGHT NOTE

This script was made by Bel (RenateIsabella Resident) 21.08.2013 to be included in Rey's Toolbox for beginner builders.

* Permission is granted to anybody to distribute this file *unmodified* as long as they don't charge anything for it.

* Permission is granted to anybody to use modify this script in any way they like for their own personal use.
*/ 

 

 

Link to comment
Share on other sites

15 minutes ago, ChinRey said:

Try this script too. (Sorry about the verbose comments in it - I did tend to overdo those back in my early SL days. 😉

/* A simple script to colour code the faces of a prim or a mesh (or a multi faced sculpt.) This is meant as a convenient way to see all the face numbers at a glance.

To use it, just drag it onto the object you want to code. If the object is in a linkset, you need to open it an drop it into the object. The script will self-delete so there's no need to do anything with it after it's been used.

Important note: The script will override all existing textures and colours of the object so use it with caution. If you want to know the face numbers without loosing the existing texturing, use this on a disposable copy of it rather than the original.

Face colors:
    0: Red
    1: Yellow
    2: Green
    3: Cyan (Light blue)
    4: Blue
    5: Magenta (Purple)
    6: Orange
    7: Brown
    8: White
*/

 default
{
    state_entry()
    {
        llSetTexture("5748decc-f629-461c-9a36-a35a221fe21f", ALL_SIDES);
        llSetColor(<1, 0, 0>, 0);
        llSetColor(<1, 1, 0>, 1);
        llSetColor(<0, 1, 0>, 2);
        llSetColor(<0.5, 1, 1>, 3);
        llSetColor(<0, 0, 1>, 4);
        llSetColor(<1, 0, 1>, 5);
        llSetColor(<1, 0.5, 0>, 6);
        llSetColor(<0.5, 0.25, 0>, 7);
        llSetColor(<1, 1, 1>, 8);
        llRemoveInventory(llGetScriptName());
    }

}

/*
HOW TO MODIFY THE SCRIPT

You can change the colour codes any way you like of course. There is no fixed standard to colour coding prim faces but the ones I've chosen are fairly close to what most seem to use. If you want to retain the textures, you can just add two slashes - // - in front of "llSetTexture" 

--------------
--------------

COPYRIGHT NOTE

This script was made by Bel (RenateIsabella Resident) 21.08.2013 to be included in Rey's Toolbox for beginner builders.

* Permission is granted to anybody to distribute this file *unmodified* as long as they don't charge anything for it.

* Permission is granted to anybody to use modify this script in any way they like for their own personal use.
*/ 

 

 

Thanks ChinRey, unfortunately, none of the faces changed colour. I must be missing some step or something.

Link to comment
Share on other sites

1 minute ago, Johnny Giotto said:

Thanks ChinRey, unfortunately, none of the faces changed colour.

😮

That's really, really weird. Even if the script I posted was hit by the same bug as Wulfie's it should have colored the whole mesh red, not left it unchanged!

This probably isn't going to help much but if you have time to do a quick test, add this script to a copy of the mesh and click on it:

default
{
  touch_start(integer n)
  {
    llSetColor(<1.0,0.0,0.0>, ALL_SIDES);
    llOwnerSay("Done!");
  }
}

It should color the whole mesh red. If it doesn't, we're well and truly into the twilight zone here.

Link to comment
Share on other sites

11 minutes ago, ChinRey said:

😮

That's really, really weird. Even if the script I posted was hit by the same bug as Wulfie's it should have colored the whole mesh red, not left it unchanged!

This probably isn't going to help much but if you have time to do a quick test, add this script to a copy of the mesh and click on it:

default
{
  touch_start(integer n)
  {
    llSetColor(<1.0,0.0,0.0>, ALL_SIDES);
    llOwnerSay("Done!");
  }
}

It should color the whole mesh red. If it doesn't, we're well and truly into the twilight zone here.

It didn't work. In the chat window it just gave the name of the boat followed by 'Done'. Thank you that anyway.

Link to comment
Share on other sites

8 minutes ago, arton Rotaru said:

Perhaps we are talking here about a communication problem between a HUD and an object to which textures will be applied to?

Hi arton, at this point the HUD is not in use. I'm still in preparation mode. I have all the textures done. I wanted to get all the face numbers ready and then all the UUIDs so they could be entered into the PXL script.

Link to comment
Share on other sites

17 minutes ago, arton Rotaru said:

Alright, then, I'm afraid, we are at a loss here without seeing the script.

Here is the script but I have tried 3 scripts plus ChinRey's:

default
{
    touch_start(integer total_number)
    {
        integer face = llDetectedTouchFace(0);
        integer link = llDetectedLinkNumber(0);
        llOwnerSay("LINK, "+ (string)link +" FACE, "+ (string)face);
    }
}

 

Edited by Johnny Giotto
Link to comment
Share on other sites

1 hour ago, arton Rotaru said:

So basically that means the thing you are working on is constructed of multiple meshes which happen to have only a single material, hence face num 0 is returned for each of them.

I was thinking along the same lines. It wouldn't explain the weird result of the two scripts I posted but it would explain everything else.

Come to think of it, we've all been making one aspect of this far more complicated than it needs to be. There's no need for scripts or fancy keyboard shortcuts to identify face numbers anymore. All you have to do is select a face and look at the builder/edit palette:

image.png.f9ba9e9a935d7a5df655b07020081b3d.png

(At least that's how it is on FIrestorm and on the PBR release version of the official viewer. I don't know about the official LL viewer. It didn't have this feature last time I used it but that was many years ago.)

 

  • Thanks 1
Link to comment
Share on other sites

49 minutes ago, ChinRey said:

I was thinking along the same lines. It wouldn't explain the weird result of the two scripts I posted but it would explain everything else.

Come to think of it, we've all been making one aspect of this far more complicated than it needs to be. There's no need for scripts or fancy keyboard shortcuts to identify face numbers anymore. All you have to do is select a face and look at the builder/edit palette:

image.png.f9ba9e9a935d7a5df655b07020081b3d.png

(At least that's how it is on FIrestorm and on the PBR release version of the official viewer. I don't know about the official LL viewer. It didn't have this feature last time I used it but that was many years ago.)

 

Oh cool, haven't noticed that so far. I knew TPVs had it, but I haven't got the memo that it was added to the LL viewer as well. 🙃 Bit tricky that its only showing up when you have a face selected actually.

Edited by arton Rotaru
Link to comment
Share on other sites

43 minutes ago, arton Rotaru said:

Oh cool, haven't noticed that so far. I knew TPVs had it, but I haven't got the memo that it was added to the LL viewer as well. 🙃 Bit tricky that its only showing up when you have a face selected actually.

I didn't know until now either. But as I said, I haven't used the LL viewer for ages and only installed it now to test PBR.

  • Like 1
Link to comment
Share on other sites

To ChinRey and arton, thanks for your help. Still no further forward. You may be right about it having only one face. It is a TMS boat and Dutch even gave me a script to find the face numbers to link up with the UUIDs. I just don't see how others are doing it. If it is all one face how do you texture different parts? 

I was trying different faces inside the cabin of the boat and got different face values on some of the fake switches on the instrument panel.

Link to comment
Share on other sites

2 hours ago, Johnny Giotto said:

You may be right about it having only one face.

Oh, that at least is easy to find out. Drag a texture onto one spot of a copy of the mesh and see if it retextures the whole thing.

 

2 hours ago, Johnny Giotto said:

I just don't see how others are doing it.

There's always the good old method of trial and error.

 

 

Link to comment
Share on other sites

3 hours ago, ChinRey said:

Oh, that at least is easy to find out. Drag a texture onto one spot of a copy of the mesh and see if it retextures the whole thing.

 

There's always the good old method of trial and error.

 

 

I can drag out, for example, the instrument panel texture, it textures any face with that texture but not the whole boat. If I select the boats instrument panel, it textures it correctly. So, it doesn't texture the whole boat. 

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 564 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...