I am making a hud, and using touch_start. It works perfect for a while, but then it just randomely stops after a while. Sometimes this can be as short os 3-5 clicks, or upwards to 20. Haven't been able to find the pattern to it yet on why it's breaking. There is no state changes at all, so that's not the problem. Here is a shortned version of the code if it's a logic problem. Any help would be appreciated. default
{
state_entry()
{
llSay(0, "Arkyt's DJ Hud Ver: 1.0\nStage: Alpha");
}
touch_end(integer num_detected)
{
integer touchface = llDetectedTouchFace(0);
vector touchPos = llDetectedTouchST(0);
if(touchface == -1)
llWhisper(PUBLIC_CHANNEL, "Sorry, your viewer doesn't support touched faces which this HUD uses.");
else if (touchPos == TOUCH_INVALID_TEXCOORD)
llWhisper(PUBLIC_CHANNEL, "Sorry, the touch position on the HUD could not be determined.");
else {
llOwnerSay("\ntouchPos.x: " + (string)touchPos.x + "\ntouchPos.y: " + (string)touchPos.y);
// DJ Random Emote to help fire up the crowd
// first find out type of emote to do
integer emoteType = randomInt(0,1);
if(emoteType == 1){
integer randomNumA = (integer)(llFrand(5-0 + 1)); // creates a random int between 0 and 5
integer randomNumB = (integer)(llFrand(5-0 + 1)); // creates a random int between 0 and 5
while (randomNumB == randomNumA){ // makes sure the second random number is different then the first
integer randomNumB = (integer)(llFrand(5-0 + 1));
}
llSay(0,djEmoteSelf(randomNumA) + " and " + djEmoteSelf(randomNumB) + "!");
}
else {
// doing a crowd emote
// find out if adding a personal emote as well
integer crowdEmoteType = randomInt(0,1);
if (crowdEmoteType == 1){
// adding personal emote to the end
llSay(0,djEmoteCrowd(randomInt(0,3)) + " cause I am " + djEmoteSelf(randomInt(0,5)) + "!");
}
else {
llSay(0,djEmoteCrowd(randomInt(0,3)) + "!");
}
}
}
}
}