1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Getting Around Checks with Comparisons

Discussion in 'Dialogue' started by aztlan, Sep 5, 2014.

  1. aztlan

    aztlan Swell Supporter

    Joined:
    Sep 14, 2013
    Messages:
    507
    Likes Received:
    15
    Any ideas how to avoid a check if you want to use a comparisons (especially > or < )to drive line choices. For example if I have a variable X which periodically increases or decreases (and is unbounded) and I want a line to play only when X > 6, is there a way to do this while avoiding using a check (and thus avoiding paying the associated performance costs checks impose)?

    Where X is unbound and only takes on a few discrete values (say 1, 2 or 3), it's easy enough to do
    line:"[line*X*]"
    line1:"blah"
    line2:"blah, blah"
    line3:"blah, blah"
    or whatever. But if X is unbounded and can take on any value then this strategy will not work.

    (My current work-around is to tightly constrain the possible values of X but this is limiting and requires greater precision in creating the dialogue).
     
  2. SyntaxTerror

    SyntaxTerror Swell Supporter Content Creator

    Joined:
    Jul 24, 2014
    Messages:
    367
    Likes Received:
    85
    Can you please show a concrete example of what you want to do, it will be easier to find a solution.
    Show how you change the value of X and what you want to use it for (not "blah, blah" if possible).
     
  3. Pim_gd

    Pim_gd Swell Supporter

    Joined:
    Jan 25, 2013
    Messages:
    717
    Likes Received:
    45
    DialogueActions has what you need. You can use *x > 6* in a dialogue line and it will insert 1 if true, 0 if false.
     
  4. aztlan

    aztlan Swell Supporter

    Joined:
    Sep 14, 2013
    Messages:
    507
    Likes Received:
    15
    Thanks. This is exactly what I was looking for - I didn't know (or now that I recall just plain old forgot) that DA (or Variables Arithmetic?) could be used this way. Great.

    As for the concrete example - I'm not sure yet. I often tend to write my dialogues to incorporate new features and see what can new things are possible with new tools that Pim_gd and others create. (Unfortunately I seem to enjoy tinkering with dialogues and exploring new features more than actually finishing dialogues and producing anything workable. But this time will be different ... Hmm maybe not, if past experience is any guide to future performance...)