Howdy, Stranger!

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

[Sugarcube, Twine 2x] Random conversations, Conversations and the perameter.

Greetings,

So I'm trying to create a system which calls on randomly selected, predetermined dialogue.

The current system rolls a 1 - 22, and for the number that is true, the corresponding message shows, like this:
<<if $NPC1Talk eq 1>>

'We all scrape by, just some more than others.'

<<set $NPC1TalkLimit +=1>>

<<elseif $NPC1Talk eq 2>>

'I wish my doctor could see me now.'

<<set $NPC1TalkLimit +=1>>

<<elseif $NPC1Talk eq 3>>

'So many things we took for granted.'

<<set $NPC1TalkLimit +=2>>

<<elseif $NPC1Talk eq 4>>

"Extraneous message."

<<set $NPC1TalkLimit +=1>>

<</if>>


And the code for the limit:
<<if $NPC1TalkLimit gte 3>>

<<set $NPC1TalkLimitRANDOM to random(1, 10)>>
<<set $NPC1TalkLimitFull to true>>

<<if $NPC1TalkLimitRANDOM eq 1>>
'Sorry, I have things to do.'
<<elseif $NPC1TalkLimitRANDOM eq 2>>

'Can't stand around here chatting all day I'm afraid.. I best be off.'
<</if>>

And so on, so forth.

The $NPC1TalkLimit was part of my plan to ensure that no more than 1-3 comments (depending upon which ones) could surface from any given character, at any time. Once the discussion has been finished, and the npc has left, the number would be reset so that another conversation could take place should the player and any npc meet.

This is still a WIP but I was making good progress and had a few more ideas I wished to implement today. *Unfortunately*, this was not to be true in this circumstance.

I have set various <<if>> integers to determine whether the limit has been reached, and all of my attempts have ultimately resulted in failure. The text will *never* appear when set under *any* of my <<if>> perameters, and I truly have no idea why.

I truly hope that someone can shed some light on the situation. Much obliged, and thank you in advance.

Comments

  • edited June 2016
    Apologies for the terrible topic header - but it appears I can not change it at this time. Unfortunately, I was mentally preoccupied and therefore did not notice I had blissfully made such a noticable error!


    I was also missing an extra <<if>> from that last piece of code.. But it still refuses to work properly regardless of this!
  • Tried printing the value of $NPC1Talk up at the top? Unless you've got a bucket at the end, if it got set to a value that didn't match any of the equals, you'd never see anything?
  • I've been reworking the entire system, and although it took time, I managed to find a solution that worked (primarly through the use of different passages and a random number generator instead), so all is not lost. Thank you for the assist anyway.
Sign In or Register to comment.