Welcome Forums General Single and double quotation marks

  • This topic has 3 replies, 3 voices, and was last updated 2 months ago by deWiTTERS. This post has been viewed 50 times
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #34435
    Marby
    Moderator

    It currently is possible to use single and double quotation marks in a dialogue. Here is a little example:

    hero says "There is an engravement. It states "Don't touch the lever.""
    

    I feel uneasy to use it that way, because normally programming languages do not allow this that way. Can we get a problem to use double quotation marks that way?

    0
    #34436
    Comprehensible
    Moderator

    I understand why you say that, but I disagree. When you’re writing NPC dialogue it’s really nice to be able to have them use quotes at the beginning or end of their statement. If there was some error or bug with it I’d totally agree, but it seems to work fine.

    0
    #34442
    Marby
    Moderator

    I’ll explain, why I wrote this:
    Yes it is nice, but only because the interpreter cannot do pretty much for us at its current state. If the functionality grows, that way to interpret quotation marks will cause problems at some point. Imagine, we would like to show the content of number variables in our dialogs. If the RPG Playground language behaves like a typical programming language, this could look like the following in the future:

    hero says "Yes, I already helped the kid. She told me: 'I never expected, you'd even purchase " + hero number of "flowers" + "'!"
    

    For the interpreter this contains the following elements:

    • hero says
    • “Yes, I already helped the kid. She told me: ‘I never expected, you’d even purchase “
    • +
    • hero number of “flowers”
    • +
    • “‘!”

    With only single quotes, the engine is able to process this. Now imagine double quotes in the dialog:

    hero says "Yes, I already helped the kid. She told me: "I never expected, you'd even purchase " + hero number of "flowers" + ""!"
    

    Now the engine can no longer find out which text belongs to the dialog and which contains statements or accesses to variables.

    This is because it starts for an interpreter now with the following parts:

    • hero says
    • “Yes, I already helped the kid. She told me: “
    • I
    • never”
    • expected
    • ,

    … and so on. “I”, “never”, “expected” and the other words will be interpreted now as identifiers or function names and not anymore as constants.

    In order to overcome this, programming languages often introduces escape sequences. If we use them our say-command could look like that:

    hero says "Yes, I already helped the kid. She told me: \"I never expected, you'd even purchase " + hero number of "flowers" + "\"!"
    

    As long as we have not a more complex programming language for RPG Playground this is okay. However, if @deWiTTERS introduce variables and functions as a return value he has to come up with something.

    I would like to have a hint, if we may use double quotation marks in our texts or better not. Keep in mind, your game will not work properly anymore, if screenplay suddenly gets interpreted in a more complex context and you did not use quotation marks a way a programmer also would do. Therefore, this topic must not be forgotten and at least @deWiTTERS should think about.

    0
    #35893
    deWiTTERS
    Keymaster

    It’s very likely that this might change in the future

    0
Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.