Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Tin Cans Conditional Text Problem?

So I tried to do something I thought should be very simple. The player is presented with three options, each setting a variable to a different emotion. Then, in a following passage, some text is displayed depending on what the variable is set to, in addition to more text that is displayed regardless of the player's prior choice. Unfortunately this didn't work out when I tested it, and I tried every different method I could think of. When I ran out of ideas on different things to try I switched the format from Tin Cans to Sugarcane on a whim, and sure enough, it worked fine in Sugarcane.

Given that, I concluded the problem is related to me using Tin Cans. But I assume there's a method of using conditional text in Tin Cans; I don't think it's a very unusual thing to see in a Twine story. So my question is what is that method? Do I need to put it a different way, or add in a macro of some sort to accomplish it?

Here's the current version of the passage with the conditional text, if seeing it helps:
<<if $introFeeling is "confused">>
I'm terribly sorry, if you dictate that you are confused then I'm doing my job poorly. Thankfully I'm only handling a fraction of the day's workload as this is my first day, so being behind schedule isn't too big of a deal.
<<else if $introFeeling is "annoyed">>
Ah, I'm so sorry! You must not be satisfied with my work level for you to have become annoyed. Please keep in mind that I'm as new to this as you are - well, I don't know that you're new, but at least from your perspective this is your first time. I'll attempt to perform better in my duties for the remainder of this transaction.
<<else if $introFeeling is "scared">>
There's no need for that conclusion, you are in no danger. Your files are safe and sound, and I am here to answer your questions and aid in the transaction process in any way possible.
<<endif>> But to return to the subject at hand, you're not //really// feeling that way. You see, there are several processes constantly looping below your "consciousness" to simulate human functions, such as instinct and feeling - when in reality this is all done via a system based on logic. Your emotions are artificial, in short. Oh, but don't forget, "You Are Still You." - I'm rather pleased with myself to have worked in the company's slogan, maybe I'm getting better at this!

Comments

  • I never used Tin Cans, but I'll try to help.

    I see you are using "is" instead of "eq" in
    <<if $introFeeling is "confused">>
    . I've never seen "is" and I always used "eq". Is "is" a new Twine command? Maybe try to use "eq" instead?

    I see you are also using "else if". Are you sure this feature is supported? In Tin Cans? Are you sure it's not "elsif" or "elseif" instead?
  • From the 1.4 notes:

    [quote]You may now use to in macros instead of =, and is instead of eq. I think we can all agree it's too easy to confuse = with eq, so you can instead write set $darts to 4 for more readable code.

    So "is" should work fine.
  • narF wrote:

    I never used Tin Cans, but I'll try to help.

    I see you are using "is" instead of "eq" in
    <<if $introFeeling is "confused">>
    . I've never seen "is" and I always used "eq". Is "is" a new Twine command? Maybe try to use "eq" instead?

    I see you are also using "else if". Are you sure this feature is supported? In Tin Cans? Are you sure it's not "elsif" or "elseif" instead?


    I've tried using "elseif" already, never heard of "elsif" though so I'll try that. I used both = and to at different points in the setting portion, but I forgot to try eq instead of is, so I'll do that too.
  • @Mostly Useless: While Twine 1.4 support all that, are we sure Tin Can does support them?
  • No luck. But my problem is more or less solved via a workaround. I split the text up into four passages, with the conditional text each in their own passage, plus a <<display>> to add on the nonconditional text from the original passage. Not ideal, but at least it looks like it's supposed to when playing it.
  • Good point, narF. Looking at the tincans page it mentions 1.3.5 and below and 1.3.6 but nothing for 1.4+, so "is" may well not be supported.
  • Indeed.  Tin Cans is old-school and I don't believe the author embedded the old <<elseif>> extension.  So, no <<elseif>> (unless you get the old script and add it to your project) and certainly none of the new operators like to, is, and is not.
Sign In or Register to comment.