Jump to content

Hi, keep getting syntax error


MadamePuqe
 Share

Recommended Posts

Trying to write a code for a pose hud, but I keep getting syntax error at:

  for (integer i = 0; i < numPoses; ++i)

 

Here's a full thing:

 

// Constants for pose names
list poses = ["Pose 1", "Pose 2", "Pose 3"]; // List of available poses

// Global variables
string selectedPose; // Store the selected pose name

default
{
    state_entry()
    {
        // Initialize the object
        llSetText("Pose Selection", <1, 1, 1>, 1.0);
    }

    touch_start(integer total_number)
    {
        // Display pose selection menu
        string menu = "Select a Pose:\n";
        integer numPoses = llGetListLength(poses);
        for (integer i = 0; i < numPoses; ++i)
        {
            menu += llList2String(poses, i) + "\n";
        }
        llDialog(llGetOwner(), menu, poses, 0);
    }

Anyone would have any clue where the issue lies? I would so appreciate it

Edited by MadamePuqe
mistake
Link to comment
Share on other sites

Posted (edited)

Ok well it lead me to another msitake LOL Syntax Error on the first line with Dialog. 

 

dialog(integer channel, string name, key id, integer buttons)
{
    // Check if the received dialog message is on the poseMenuChannel
    if (channel == poseMenuChannel)
    {
        // Process the dialog message (e.g., start animation)
        llStartAnimation(name);
    }
}

Edited by MadamePuqe
Link to comment
Share on other sites

2 hours ago, MadamePuqe said:

dialog(integer channel, string name, key id, integer buttons)
{
    // Check if the received dialog message is on the poseMenuChannel
    if (channel == poseMenuChannel)
    {
        // Process the dialog message (e.g., start animation)
        llStartAnimation(name);
    }
}

compiles fine for me as long as the global variable poseMenuChannel is declared. Check that your global variable declaration exists, and is exactly the same spelling as in the function.

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...