Literal commas in string parameters for custom sequencer commands

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
Xenrathe
Posts: 4
Joined: Thu Nov 10, 2022 9:43 am

Literal commas in string parameters for custom sequencer commands

Post by Xenrathe »

Sorry if this is documented / already answered (searched, couldn't find), but I have a custom sequencer command that takes a string as its only parameter. However, the problem I encountered is that all commas are interpreted as delimeters for multiple parameters.

That is, the sequence command UpdateText(Bob, Joe, and Sally went to the store) reads as THREE parameters rather than one, as desired.

Now obviously I could use something like a replacement character like $ and simply replace it as a comma, which isn't much work. But I was curious if the sequencer system as is has support for a literal comma or escape comma character or what have you within sequencer commands.

Thanks
-Erik
User avatar
Tony Li
Posts: 22131
Joined: Thu Jul 18, 2013 1:27 pm

Re: Literal commas in string parameters for custom sequencer commands

Post by Tony Li »

The syntax definition for sequences doesn't allow for literal commas. It was designed for writers who might not easily understand that strings would need to be enclosed in quotes. Two options:

1. Write a regular C# method, register it with Lua, and use it in the Script field.

2. Or concatenate the parameters in your custom sequencer command, such as:

Code: Select all

string s = string.Join(", ", GetParameters());
Post Reply