MadamePuqe Posted April 14 Share Posted April 14 (edited) 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 April 14 by MadamePuqe mistake Link to comment Share on other sites More sharing options...
Ron Khondji Posted April 14 Share Posted April 14 This should do it. integer i; for (i = 0; i < numPoses; ++i) 1 Link to comment Share on other sites More sharing options...
MadamePuqe Posted April 14 Author Share Posted April 14 14 minutes ago, Ron Khondji said: This should do it. integer i; for (i = 0; i < numPoses; ++i) It worked! Thank you! Link to comment Share on other sites More sharing options...
MadamePuqe Posted April 14 Author Share Posted April 14 (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 April 14 by MadamePuqe Link to comment Share on other sites More sharing options...
Quistess Alpha Posted April 14 Share Posted April 14 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 More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now