Jump to content

Using Variables as text in a Dialog box


Wolfman Wisent
 Share

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

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

Recommended Posts

I am trying to make a Dialog Box that would say User name paid X-amount. then give several choices. I can not figure out how to get the

Variables to work in text though. Can any one help Me with that. I know there is a way to do it because I have devices that do that. Their scripts

are no modify so I can not look at them to see how they did it.

Thanks for any help I get.

Link to comment
Share on other sites

You can combine multiple strings of text like this:

string first = "hello ";
string second = "world!";
string combined = first + second; // "hello world!"

// or

string combined = "hello " + "world!";

Normally you can't combine other things together -- like a string and an integer (number) -- unless you change the integer's type to a string.

string message = "I was paid ";
integer amount = 100;
string converted = (string)amount;

string combined = message + converted; // "I was paid 100"

// or

string combined = "I was paid " + (string)amount + "L$"; // "I was paid 100L$"

 

  • Like 1
Link to comment
Share on other sites

1 hour ago, Wulfie Reanimator said:

There should be a setting for that in your viewer. For Firestorm:

Preferences > User Interface > "Script dialogs per object [unconstrained]"

Isn't that exclusively a Firestorm/other TPV option? I think the LL viewer only allows one dialog per object (I seem to remember bitter recriminations and JIRAs about this flowing freely when it became a thing). However, using Firestorm with the single dialog option set, it seems a script in a link can open an additional dialog without replacing one from another link, including the root. Maybe that'll work in the SL viewer too.

Edited by KT Kingsley
Link to comment
Share on other sites

9 minutes ago, KT Kingsley said:

Isn't that exclusively a Firestorm/other TPV option? I think the LL viewer only allows one dialog per object (I seem to remember bitter recriminations and JIRAs about this flowing freely when it became a thing). However, using Firestorm with the single dialog option set, it seems a script in a link can open an additional dialog without replacing one from another link, including the root. Maybe that'll work in the SL viewer too.

I don't know which viewers have the option, which is why I specified Firestorm.

And yes, If you put a script in every link, they can each open a dialog without replacing the others because every link is a separate object.. but do you really want to do that? (Maybe you do, that's up to you to determine.)

Link to comment
Share on other sites

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