Shashi Winterwolf Posted December 22, 2023 Share Posted December 22, 2023 Hello! Can anyone help me understand what I've done wrong? The dialog box shows up, but nothing else happens. The chat doesn't display any messages and the prims alpha don't change either. If I change the "channel ==100" to "o", then it simply displays the button names in the chat. default { state_entry() { } touch_start(integer total_number) { llDialog(llDetectedKey(0), "select an option:",["option 1","option 2"],1979); } listen(integer channel, string name, key id, string message) { if(channel == 1979){ if(message == "option 1"){ llSay( 0," you chose the first option on the dialog."); llSetLinkAlpha(3,0,ALL_SIDES); llSetLinkAlpha(2,0,ALL_SIDES); ; }else if(message == "option 2"){ llSay(0," you chose the second option on the dialog."); llSetLinkAlpha(3,1,ALL_SIDES); llSetLinkAlpha(2,1,ALL_SIDES); ; } } }} were have I gone wrong . please help Link to comment Share on other sites More sharing options...
elleevelyn Posted December 22, 2023 Share Posted December 22, 2023 15 minutes ago, Shashi Winterwolf said: The dialog box shows up, but nothing else happens need to set up a listener to go with the dialog. For example: state_entry() { llListen(1979, "", NULL_KEY, ""); } ... rest of your code here See: https://wiki.secondlife.com/wiki/LlListen for more on listeners 1 Link to comment Share on other sites More sharing options...
Shashi Winterwolf Posted December 22, 2023 Author Share Posted December 22, 2023 sweet thank that worked how about this integer owner; default { state_entry() { llListen(1979, "", NULL_KEY, ""); } touch_start(integer total_number) { llDialog(llDetectedKey(0), "select an option:",["option 1","option 2"],1979); } listen(integer channel, string name, key id, string message) { if(channel == 1979){ if(message == "option 1"){ string oldName = llGetObjectName(); llSetObjectName(""); owner = llGetDisplayName(llGetOwner()); llSay(0," " + owner + "you chose the first option on the dialog."); llSetObjectName(oldName); llSetLinkAlpha(3,0,ALL_SIDES); llSetLinkAlpha(2,0,ALL_SIDES); ; }else if(message == "option 2"){ llSay(0," you chose the second option on the dialog."); llSetLinkAlpha(3,1,ALL_SIDES); llSetLinkAlpha(2,1,ALL_SIDES); ; } } }} trying to get it to say my name in chat and not the box name the editor I'm using asks this Cannot implicitly convert type 'string' to 'integer'. An explicit conversion exists (are you missing a cast?) were would I learn about casts? Link to comment Share on other sites More sharing options...
elleevelyn Posted December 22, 2023 Share Posted December 22, 2023 16 minutes ago, Shashi Winterwolf said: Cannot implicitly convert type 'string' to 'integer'. An explicit conversion exists (are you missing a cast?) were would I learn about casts? here: https://wiki.secondlife.com/wiki/Typecast 1 Link to comment Share on other sites More sharing options...
Marvin Benelli Posted December 22, 2023 Share Posted December 22, 2023 Try: llSetObjectName(owner); llSay(0,” has chosen option x”); Link to comment Share on other sites More sharing options...
Quistess Alpha Posted December 22, 2023 Share Posted December 22, 2023 (edited) 10 hours ago, Marvin Benelli said: SetObjectName(owner); llSay(0,” has chosen option x”); I'm not a fan of objects that change their name to the first word in the message. llSay(0, owner+" has chosen "+message); is fine. Setting the object name to the display-name of the owner of an attachment makes it look to rlv(a) enabled viewers like the actual owner of the object is speaking, which is not something you generally want unless you're scripting a gag. If you really were wanting it to appear from the owner's mouth, my grammar preference would be more along the lines of "I choose X." or "/me chooses X." If you want to obscure the message source, just set the object name to "". 11 hours ago, Shashi Winterwolf said: owner = llGetDisplayName(llGetOwner()); I personally prefer using SLURLs to display avatar's names: owner = "secondlife:///app/agent/"+(string)llGetOwner()+"/inspect"; Edited December 22, 2023 by Quistess Alpha 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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