Jump to content

Commas in Dialog Boxes


StaticTank

Recommended Posts

I am having a problem with Dialog boxes. If I use a comma in a dialog box and then close and save the file. When I open it back up with the builder it seems like it cuts off every thing after the comma. It looks like in the LUA the Dialog box code uses commas for dividing different sets of dialog. This seems like it could be a serious issue. Unless I am missing something here. Sometimes after saving a file that this has happened in I have to go in a edit the LUA or I get an error message.

 

StaticTank

Link to comment

It only seems to happen when I am using a variable like Player.Name along with the opening and closing double brackets.

 

I didn't have the exact file here at work, but since I spent a lot of time trying to figure out why my instructions were disappearing I can now replicate the situation.

 

In the .lua file I am sending you, look at the coding in the OnStart event. The complete text is all there. If you open the file with the builder and look at the OnStart event the builder cuts off everything after my comma. If you save it, it will not open again unless you edit the .lua file.

 

If you have more questions please let me know.

Test1.zip

Edited by StaticTank
Link to comment

I can reproduce this with builder version 2.0.5129.5086.

 

My guess is that the builder's parser is looking for "the first comma after the pair of right brackets which (it presumes) closes the string", and isn't sophisticated enough to handle string expressions.

 

I too have experienced this. Since I make extensive use of string expressions (rather than simple strings), I suspect that this is a very likely explanation for the cause of the problem. Now I know what to avoid in future.

 

Workarounds that come to mind are:

 

1) move the function to the author area, or

2) create a string variable called comma with the value of "," and use it instead of typing a comma, or

3) avoid using commas in dialogs

Link to comment

Thanks StaticTank, this bug has been reported. Sorry about the delayed followup.

 

In the meantime, concatenating a variable with a text string that includes commas works fine in message boxes, so using a messagebox might be the simplest workaround.

 

J2B2

 

Actually using a message box was what caused the start of my troubles. I had a long set of instructions on how to play the cartridge show before you started to play. This caused the Colorado to crash when you started the cartridge. So I changed it to a series of dialog boxes and ran into a whole new set of issues. I ended up not using commas in the end.

 

I have completed the cartridge and it is now the second one in South Dakota. If you want to check it out it is called: Where in Sioux Falls is Carmen Sandiego?

Edited by StaticTank
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   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.

Loading...
×
×
  • Create New...