Can you force a Master Section to happen at the end of sections instead of the beginning

TriangleGames
22 Mar 2017, 00:40

I'm looking at showing the player a list of his current items. I'm using a master section to display them, but it displays at the top of each section. Is there a way to make it activate at the end of each section instead?


IFforClassroom
22 Mar 2017, 08:07

Here's what I do:


[[Room 1]]:
This is a room. [[Room 2]] is a room too.

{Inventory}

[[Room 2]]:
This is Room 2. [[Room 1]] is also a room.

There are some [widget]s here.

[widget]:
@inc widget
@set items=true
You take the widget.

[[Inventory]]:
{if items=true:You are carrying} {if widget>0:{widget} widget{if widget>1:s}}{if items=true:.}

Siddone
04 May 2017, 15:37

why it does not work anymore if you add other rooms?


story10
05 May 2017, 03:11

The reason why it does not work is that the passage "widget" has the same name of attribute "widget"

[[Room 1]]:
This is a room. [[Room 2]] is a room too.

{Inventory}

[[Room 2]]:
This is Room 2. [[Room 1]] is also a room.

There are some [widget](takeWidget)s here.      <--- here!

{Inventory}

[takeWidget]:     <---- here!
@inc widget
@set items=true
You take the widget.

[[Inventory]]:
{if items=true:You are carrying} {if widget>0:{widget} widget{if widget>1:s}}{if items=true:.}

story10
05 May 2017, 03:38

This is my way to display master section at the end of each section. Just insert one line javascript. :)
( you can change the number 1000 to less number to display it faster.)

[[Room 1]]:
This is a room. [[Room 2]] is a room too.

[[Room 2]]:
This is Room 2. [[Room 1]] is also a room.

There are some [widget](takeWidget)s here.

[takeWidget]:
@inc widget
@set items=true
You take the widget.

[[Inventory]]:
{if items=true:You are carrying} {if widget>0:{widget} widget{if widget>1:s}}{if items=true:.}

[[]]:
     setTimeout(function(){squiffy.ui.write(squiffy.story.sections['Inventory'].text)},1000); 

Siddone
05 May 2017, 13:11

This.
Is.
GENIUS!


story10
05 May 2017, 23:21

:)