Welcome Forums Requests Variables in Scripts/an "and/or" Option

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1541
    EeveeCat
    Participant

    Hey, I’ve been having issues with lengths of some of my scripts. Here’s my example: Let’s call the NPCs Actor1 and Actor2. If you talk to Actor1 first, you get what I’ll call dialogue1. If you talk to Actor2, they will give you the token “pin”. If you talk to Actor1 with the “pin” token, you’ll get the next dialogue (dialogue2). It ends with Actor1 giving you token “pin2”. If you talk to Actor1 and you have token “pin2”, then you’re supposed to get dialogue1 again. The issue I’m having is that I can’t find a way to write this out without having to type out all of dialogue1 again (and it’s pretty lengthy…) Of course I’m not the most brilliant person in the world so if someone already knows how to do this without repeating dialogue1, please, do tell. In which case the rest of this is void, but would still be handy for other features.

    (if you didn’t understand that, I need a way to say if you have either no “pin” or have “pin2” then you get dialogue1 and if you have “pin” only then you get dialogue2. Without repeating dialogue1 in two places.)

    The way I see this is there are two solutions that I think should be added to the game. The first could be useful for a variety of reasons – having variables. So in your script you would put

    Let “dialogue1” be
    hero says “something relevant”
    Actor1 says “something in response”

    Then, everytime you say

    Insert “dialogue1”

    Then that dialogue will play. This would obviously solve my problem – while I still have to write “dialogue1” in two places, I’m not actually writing the whole thing more than once. The other thing you could do with variables is make a world variables sheet of some sort, in which you put all sorts of universal “let ___ be” statements. Then, if you repeat a quote multiple times or something, you could have lines that say

    Actor3 says “quote1”

    And then it just inserts that line. Or “MagicRule1” if you have people repeating things all the time. I’m sure you could use these statements for other things but quite frankly I haven’t thought of them yet.

    The second solution I thought of was making “and/or” be a possibility in the script. If so, then I could solve my problem by putting

    if hero lacks token “pin” and/or [hero] has token “pin2”
    (Insert dialogue1)

    I think this could be really useful. At least for my situation – I’m a fan of making overly complicated dialogue so I’d be bound to use it multiple times.

    If anyone happens to know a stupidly easy way of fixing my problem without all these suggestions, I would absolutely love some suggestions!

    #1542
    deWiTTERS
    Keymaster

    I see you are already pretty advanced in programming! :).

    Unfortunately, the screenplay is currently really basic, so you will have to repeat your dialogue for now :(.

    But for the future, I think the and/or solution is best for the situation you are describing. But don’t count on that being implemented soon.

    My global plan for the screenplays is to have a fully Object Oriented programming language in there, where you can do anything you want (as in any other programming language). And I know a way how to keep things really simple for beginners :).

    #1543
    Aura
    Moderator

    I actually thought about variables too… The easier option for your problem would of course be that it’s possible to copy/paste events! But this would have to be bound to your account in my opinion. Or else anyone has acess to your dialogues, wich I would rather not see implemented then…
    The same thing with copying/pasting maps! It would have to be only for your own account in my opinion.
    Now with the including of variables and world variables, you could (regarding events) solve that problem in an easier way… Still remains the map-problem…
    Of course if it would be possible to bind what you copied to your own account – that would be great!
    Is that possible at all?

    #1544
    deWiTTERS
    Keymaster

    Binding things to your account could definitely be possible.

    #1545
    Aura
    Moderator

    Great! 🙂

    #1551
    EeveeCat
    Participant

    I actually ended up finding another solution for this with one of my friends. Essentially, we made it so that if you have “pin” but not “pin2” then you get a third token, which I called “dialogue2” which then gives you, well, dialogue two. Here’s the code for it:

    if hero has token “pin”
    if hero lacks token “pin2”
    hero receives token “dialogue2”
    if hero has token “dialogue2”
    (insert dialogue 2)
    else
    (insert dialogue 1)

    So now it’s no longer defining when you should get the first dialogue (because it has two different possible requirements, but neither is necessary for the other), now its just the very specific circumstances to get dialogue 2, which has two different variables that both must be in place at the same time.

    I’m glad that and/or functions will likely still be added in the future, even if I’ve found a way to bypass them. Though honestly I’m more excited for the combat update 😀 I hope the third token idea might help anyone else who runs into copy/pasting dialogue issues. It takes a little more coding but at least its not repeating dialogue.

Viewing 6 posts - 1 through 6 (of 6 total)
  • The forum ‘Requests’ is closed to new topics and replies.