Howdy, Stranger!

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

Is there a maximum passage size?

I've been playing around with a map of the complex in my game.  Now I've realised that due to there being multilevel buildings and some of the buildings being complete facilities in themselves,  I'm going to end up in a situation of having loads of passages, and most of them would be pretty much non-functional and there for 'aesthetic' reasons.  I've been playing with the idea of several template' passages, and a massive <if>...<else> macro that goes through a location ID of the rooms that is passed to it in the link which I'd display silently, to get the information and then the template would display the various text for the rooms, work out if it's already been searched, exit directions and perform the relevant 'tick' (a system that modifies various 'rechargeable' stats, and then checks for random events on a diceroll).  These templates would obviously link to themselves, most of the time.  There would be 'key' locations that are a passage in themselves, but mainly because I want them to do special things and contain NPCs.

Obviously the 'flavour' text for these various rooms, and the variable information that will need to be checked for some of them, is going to result in a massive passage so is there a maximum size after which the browser or Twine (using SugarCube) will start to forget/ignore bits or whatever else?  Now I could obviously split the passages and have one for each template, but I'd ideally like to be able to 'recycle' areas (if a corridor in the labs is the same as the armoury then just have the one area and re-use it) and splitting the passages would result in even more duplicated text as I'd need to copy the information into the macro.

Am I also right in assuming that if it tag the passage macros as nobr and display it will only take up one line in whitespace, and that I can also place this macro at the end of a template passage, but keep the variables to be displayed above them?  For example a template passage may look like this...
<<print $roomhead>>

<<print $roomtxt>>

<<print $roomlinks>>

<<display "loclookup">> ;;The bit that sets the values to the above variables.
As always, thanks in advance for any help.

Comments

  • AntonMuerte wrote:
    Obviously the 'flavour' text for these various rooms, and the variable information that will need to be checked for some of them, is going to result in a massive passage so is there a maximum size after which the browser or Twine (using SugarCube) will start to forget/ignore bits or whatever else?


    I'm sure there is a maximum size (I don't know what it would be off-hand), however, it's certainly large enough that you're unlikely to encounter it.  It's very likely related to the maximum string size for the weakest link in the chain, and I would be surprised if it were less than 1 MiB of runes/Unicode characters, at least.


    AntonMuerte wrote:
    nobr and display it will only take up one line in whitespace, and that I can also place this macro at the end of a template passage, but keep the variables to be displayed above them?


    If by passage macros you meant pseudo-macros, then no such thing exists in SugarCube (it has widget macros instead).

    As to the line-breaks.  If you tag the passage with nobr then you shouldn't get any line-breaks from it, normally, so you'd only get the one from its call, which you can also suppress if desired.

    For the &lt;&lt;print&gt;&gt; vs. &lt;&lt;display&gt;&gt; ordering in your templates.  If the &lt;&lt;display &quot;loclookup&quot;&gt;&gt; call sets the values that you want those &lt;&lt;print&gt;&gt; macros to output, then it needs to come before their calls, not after.
  • By macro I mean a passage that basically contains all the code for whatever goes on at that point.  So an example for the loclookup passage would be...
    <<if $roomID eq 1>>
    <<set $roomhead = "A small ransacked lab">>
    <<set $roomtext = "This laboratory has been completely ransacked with equipment strewn all over the floor.">>
    <<elseif $roomID eq 2>>
    <<set $roomhead = "A dark corridor">>
    <<set $roomtext = "The corridor's main lights aren't functioning, and the lowlevel floor lighting make it difficult to see anything.">>
    .......
    <<endif>>
    I don't know whether 'module' would be a better term.

    I'm more comfortable using this approach as there's variations in which role you choose to play (medics have a really low hit value, but also have the ability to regenerate health in combat, while scouts have an average level of hit value, but have difficulty with heavy weapons) and I don't want to reach a point where I have a passage where I'm referencing the wrong values and not realising.  There's also skill sets that can be purchased (different for each of the four classes as a security guard with the full skill set would end up being a tank and have the ability to one shot an elite droid who are meant to be the hardest enemies to take down) and it's a lot easier to code the shop function for these separately as opposed to throwing it all into one passage.
  • AntonMuerte wrote:
    By macro I mean a passage that basically contains all the code for whatever goes on at that point.


    Ah.  That's fine then.


    AntonMuerte wrote:
    I don't know whether 'module' would be a better term.


    That or just plain "passage" would work.  You're not really doing anything special there.
  • TheMadExile wrote:

    If by passage macros you meant pseudo-macros
    The sad part is that it's been like a year and I still use these two different names instead of just deciding on one. *peels off face, feeds it into paper shredder*
Sign In or Register to comment.