Jump to content

NPC script with dialog menu


GotYouCovered
 Share

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

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

Recommended Posts

Hi all! I have actually been searching for a few days now and found many similar things in the forum but not quite as simple as what I was looking for.

 

I was trying to create a script (I'm pretty noob at) for when you click on an NPC and a menu pops up, like a dialog menu and have the npc saw in the menu (Or in local chat is fine) with something like "Those damn imps keep wrecking me tavern!"

 

And then that will give one-three key options of what the player can choose. Such as "That's what happens well you live in the caves" and that would either close the menu or give a response like "HMPH, I suppose." and ends there. Like rejecting the quest.

 

While something like "What imps?" would open up a new set of options where he would explain the issue. Have an option for more information, to accept quest without extra hints, or to again reject the quest with a similar response as above. 

 

Though since it isn't as simple as a dialog menu where you choose 'reds->dark red, etc' or option green->leaf,etc'

and I keep running into errors. Either it'll say it's too long (Exceeds past 24 characters) But I want a decent convo, or it will syntax error with something like 

list Comes with the caves

Idk if it's because of the spaces. But I don't want something that send notecards with info on the quest because it gets hecktic that way and can annoy some people.

Also, no quest item or inventory given as accepting the quest will then have me proceed to npc the imps on my avi and that way it has a wider range of options for them to do, and can roll to see through posts on if they succeed in trapping/killing. Then from there I'd physically give them whatever item they chose.

 

So no inventorygiver needed. Just a dialog menu pretty much with options for conversation. I could have sworn I saw such things in a sim that unfortunately closed down so I figure it's possible. If the character limit makes it impossible, then I'd think putting it into local chat as the npc responses would help with much of that.

 

Thanks for reading.

Link to comment
Share on other sites

Alright, thanks.

 

So at 

list CurrentMenu;
list FirstMenu = ["Need some help?", "What imps?"];

 

as an example and I want 'need some help' and 'what imps' to trigger a new list of menus. Though 

list Need some help Menu = ["Well if you pay well, perhaps I can helo with your pest problem", "Comes with the caves"];

 

^This obviously has the issue in a syntax error with the list menu being too long and having spaces as well as the options being far too long. (Though I want it more interactive like such)

 

The orc replies to these options I want to be such as in

            llDialog(toucher,"Getting tired of imps running 'bouts an' recking my things!",

but having trouble where it would say something different on the top per list menu, so I was thinking having his replies perhaps put into local chat (especially if they select more options and he has a lot to say.) 

 

I think this dialog menu is too complicated, and even without the syntax errors and certain dialogs are just too long once the box is click on, even if there was no error in the script and it will pop up then.

 

My biggest question is how do I make it so when an option is clicked and the object speaks in local chat? Because that would fix just about everything but I'm not sure entirely how to do it.

 

That way I can do something shorter and simpler like,

ist CurrentMenu;
list FirstMenu = ["Reject Quest", "What imps?"];

Then Reject quest could trigger local chat where the object says, "As you reject the quest and the bartender grunts to your departure." Or yadayada and "What imps" Would trigger a different local chat but ALSO trigger another menu for more options.

Link to comment
Share on other sites

It looks like you are trying to jump into deep water before taking the time to learn how to swim.  It's good to have a project in mind, but I suggest taking some time to learn and practice the basics first.   You'll find a selection of LSL tutorials at http://wiki.secondlife.com/wiki/LSL_Tutorial

You'll also find that Builders Brewery and other places in world offer free LSL classes.  When you have specific questions about a script that's giving you trouble or when you want feedback on ways to optimize your work feel free to post the relevant parts here in the LSL Scripting Forum.  That's exactly what this forum is for. 

For your specific project, I suggest spending some time looking in the LSL wiki at descriptions and examples of a few handy functions like llDialog and the various list handling functions.  I also suggest spending time mapping out the logical flow of your proposed project, perhaps in a full-blown diagram of some kind but at least as a verbal roadmap of the way you expect information to move through your script.  After all, at least 3/4 of writing successful scripts is managing logic.

  • Like 1
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 3704 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...