You must be 18+ to visit this website
The content on this website is AGE RESTRICTED
Please confirm you are at least 18 years old of age. Otherwise leave the website.
Subjunctive Games profile
Subjunctive Games
18+
Subjunctive Games
Creator of MindWare, a browser-based interactive adult game set in a cyberpunk world where even the human mind isn't safe from malware.​
Subscribe
Message

Subscription Tiers

$3
USD monthly
Script Kiddie

What's included:

  • A huge thank you for your kind support!
  • Discord access
  • 1x voting power in polls
  • Cheat menu unlock code
  • Walkthrough
  • Offline version
81 subscribers Script Kiddie
Unlock
$5
USD monthly
Network Ninja

What's included:

  • A huge thank you for your kind support!
  • Discord access
  • 2x voting power in polls
  • Cheat menu unlock code
  • Walkthrough
  • Offline version
  • Exclusive access to concept art
17 subscribers Network Ninja
Unlock
$10
USD monthly
Elite Hacker

What's included:

  • A huge thank you for your kind support!
  • Discord access
  • 3x voting power in polls
  • Cheat menu unlock code
  • Walkthrough
  • Offline version
  • Exclusive access to concept art
  • Be immortalized in MindWare's credits
6 subscribers Elite Hacker
Unlock

Features

The subscription gives you:
  • Access to Creator's profile content.
  • Ability to support your Creator by pledging – one-time or recurring.
  • Means to reaching out to the Creator directly via Instant Messenger.
Displaying posts with tag Devlog.Reset Filter
Subjunctive Games

Devlog: Getting Ready for Public Release of Version 0. 3. 0

Comments
Like(0)
Dislike(0)
Posted for $3, $5, $10 tiers
Unlock Tier
Subjunctive Games

Devlog: Story Structure and Development Plans

Comments
Like(0)
Dislike(0)
Posted for $3 tier
Unlock Tier
Subjunctive Games
Public post

Dynamic UI Layouts in SugarCube

When developing interactive fiction with Twine and SugarCube, it's often useful to have different UI layouts for different parts of your game, such as a fullscreen layout for immersive story moments and a sidebar layout for passages where you go through a daily routine. 

This is something I haven't been doing efficiently in MindWare, but I now have a solution that (at least to me) seems fairly elegant and robust.

Basically, my solution uses Twine's passage tag system combined with JavaScript in the SugarCube StoryInterface special passage (used to create a custom UI):

:: StoryInterface
<div id="ui-root">
  <div id="passages"></div>
</div>
​
<script>
$(document).on(':passagestart', function (ev) {
  var passage = ev.passage;
  var tags = passage.tags;
  var root = $('#ui-root');
  
  if (tags.includes('fullscreen')) {
    root.html('<div id="passages"></div>');
  } else if (tags.includes('sidebar')) {
    root.html(`
      <div id="ui-container">
        <div id="ui-sidebar">
          <h2>Game Title</h2>
          <div id="ui-stats"></div>
        </div>
        <div id="ui-main">
          <div id="passages"></div>
        </div>
      </div>
    `);
  } else if (tags.includes('split')) {
    root.html(`
      <div id="ui-split">
        <div id="ui-left">
          <div id="ui-header"></div>
          <div id="passages"></div>
        </div>
        <div id="ui-right">
          <div id="ui-info"></div>
        </div>
      </div>
    `);
  } else {
    // Default minimal layout
    root.html('<div id="passages"></div>');
  }
});
</script>
When a passage loads, the system checks its tags and rebuilds the UI accordingly. Now you can create passages that use different layouts simply by adding tags:

:: Story Beginning [fullscreen]
# Chapter One
​
The story begins in a quiet village...
​
This passage uses the fullscreen layout for an immersive reading experience.
​
[[Enter the tavern|Tavern]]
​
:: Tavern [sidebar]
# The Rusty Dragon Tavern
​
You enter the bustling tavern. The air is thick with smoke and laughter.
​
:: Notice Board [split]
# Notice Board
​
Several parchments are pinned to the wooden board.


You can add new layouts by extending the JavaScript in StoryInterface:

else if (tags.includes('custom')) {
    root.html(`
        <div id="custom-layout">
            <!-- Your custom HTML structure. Remember that you need <div id="passages"></div> because that's where the content of your passages is displayed -->
        </div>
    `);
}
When you save your game and then load the save, the layout system automatically restores the correct UI for the current passage. This happens because SugarCube fires the :passagestart event before the rendering of an incoming passage. 

If you need certain UI elements to persist across layout changes (like a music player or notification system), place them outside the #ui-root:

:: StoryInterface
<div id="persistent-ui">
  <div id="audio-controls"></div>
</div>
<div id="ui-root">
  <div id="passages"></div>
</div>
I'm not sure how many of my supporters are interested in Twine/SugarCube game development, but I hope this helps if any of you are. 

Comments  loading...
Like(1)
Dislike(0)
Sign Up or Log In to comment on this post
Subjunctive Games

Devlog: Public Release of Version 0. 2. 2 Is Aaaaalmost Ready

Comments
Like(0)
Dislike(0)
Posted for $3, $5, $10 tiers
Unlock Tier
Subjunctive Games

Devlog: More Efficient Development Process

Comments
Like(0)
Dislike(0)
Posted for $3, $5, $10 tiers
Unlock Tier
Subjunctive Games

New Interactive S. I. M. S. Experience

Comments
Like(0)
Dislike(0)
Posted for $3, $5, $10 tiers
Unlock Tier
View next posts (6 / 21)

Creator Stats

104 subscribers
130 posts

Goals

28.8%
collected
to reach
Reaching this goal would allow me to dedicate significantly more time to game development. That would lead to more frequent releases, the introduction of additional innovative interactive elements that enhance your engagement with the narrative, and, of course, extra eye-candy.

Other Creators

WE USE COOKIES

SubscribeStar and its trusted third parties collect browsing information as specified in the Privacy Policy and use cookies or similar technologies for analysis and technical purposes and, with your consent, for functionality, experience, and measurement as specified in the Cookies Policy.

Your Privacy Choices

We understand and respect your privacy concerns. However, some cookies are strictly necessary for proper website's functionality and cannon be denied.

Optional cookies are configurable. Disabling some of those may make related features unavailable.

We do NOT sell any information obtained through cookies to third-party marketing services.