Jump to content
  • 0

[Curios]Script Commands Visible?


Question

Posted

Hi, i'm just wondering or curios if there is a script_commands that is visible? let say, there is 3 'MENUS' i would like to add the other menu will be visible after he will choose a menu e.g {set #freebies,1;} after he will choose the one i 'set' it would not appear anymore if he will talk to the NPC. or might i'm just missing reading with script_commands?

Anythoughts?

I'd be happy to hear it some feedback.

Thank you for reading my Topic.

2 answers to this question

Recommended Posts

Posted

You just need to create two sets of menus with the second one checking if a variable is set to X.

Example

if ( #freebies ==  0 ) menu "Menu 1 here",L_Menu1,"Menu 2 here",L_Menu2,"Menu 3 here",L_Menu3;
if ( #freebies ==  1 ) menu "Menu 2 here",L_Menu2,"Menu 3 here",L_Menu3;


L_Menu1:
set #freebies,1;
close;

Hopefully that made sense.

Posted

You could also construct the menu string dynamically, and include checks for your #freebies variable.

set .@menu$, ""; // make sure menu string is empty

set .@menu$, .@menu$ + "Option 1:"; // everyone gets this option
set .@menu$, .@menu$ + "Option 2:"; // everyone gets this option
if (#freebies == 1) set .@menu$, .@menu$ + "Special Option 3:"; // only players who have #freebies set to 1

// show them the menu
switch(select(.@menu$)) {
case 1:
   // stuff
   break;
case 2:
   // stuff
   break;
case 3:
   // stuff
   break;
}

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...