It looks like you're new here. If you want to get involved, click one of these buttons!
:: Options<<if !visited("Option A")>>[[Try A.|Option A]]<<endif>>\<<if !visited("Option B")>>[[Try B.|Option B]]<<endif>>\[[Try C.|Option C]]
I've encountered some Firefox weirdness in the past day (though I really, really wish I'd found it earlier). If I load my story, then go to other websites, and then try to return to my story (by the back button, by a bookmark, or by retyping the URL), it attempts to load but then puts up the "Error: TypeError: window.history.state is undefined" dialog. Quitting Firefox, relaunching it, and then trying my story again loads it just fine. I was able to reproduce this in Firefox on Windows and Mac. I can't reproduce it in Chrome or IE.
I get an uncaught type error: Cannot read property title of undefined, when I try to use the replace macro set/the cyclinglink macro.
"\"You can't make me!\""
"You can't make me"
visited("Bar") neq 0
There already is, or will be, a way to set them for a group, the $variable used. The name attribute, along with the id, are set based on the name of the $variable, which means <<radiobutton>>s are grouped by the $variable used (that's what the name attribute is for, grouping).
The default state is another oversight, which I'll need to fix for both the <<checkbox>> and <<radiobutton>> macros.
I know you can't just ignore the id, and it needs to be set too, but in this case all I needed was to set the name to group them. Just a very quick hack!
I'm using SugarCube -3030.
Edit: I get this problem in Firefox. In Konqueror (WebKit renderer) it doesn't occur.
I have to say, though, I don't recall setting it to Private at all. Perhaps it came that way by default when I updated to iOS 7, or maybe I brushed the button accidentally at some point. Rather annoying.
If I load my story, then go to other websites, and then try to return to my story (by the back button, by a bookmark, or by retyping the URL), it attempts to load but then puts up the "Error: TypeError: window.history.state is undefined" dialog. Quitting Firefox, relaunching it, and then trying my story again loads it just fine. I was able to reproduce this in Firefox on Windows and Mac. I can't reproduce it in Chrome or IE.
This was happening in 3025. I tried updating to 3050 (since I saw that 3040 addressed some Firefox stuff), but that didn't make a difference.
EDIT (3/25): Ah, I see. Thanks for your reply, TheMadExile. I won't worry about the problem, then!
That's a bug in Firefox. It appeared 2-3 releases ago now and it seemed to be fixed in the next point release. Apparently, it was only partially fixed.
It's been a while since I last tested those. Let me check. Okay, found the problem.
I've published updates for both SugarCube itself as well as the SugarCube versions of the replacelink macro set and cyclinglink macro. That should fix the problem. Sorry about the trouble.
This lines of codes does not modify the variable : I can't see what's wrong.
How Many Zombies do you want to fight?
<<radiobutton "$battle.enemies" 10 checked>>10
<<radiobutton "$battle.enemies" 25>>25
<<radiobutton "$battle.enemies" 50>>50
<<radiobutton "$battle.enemies" 100>>100
<<radiobutton "$battle.enemies" 250>>250
<<radiobutton "$battle.enemies" 500>>500
<<radiobutton "$battle.enemies" 800>>800
if i input <<print $battle.enemies>> on any other pages after, I get my initial value of 0.
Thanks, i'll update first.
EDIT: It works.
Thanks for SugarCube, it made possible to make the game I wanted to make.
Here is a glimpse of my combat system with about 20% of the real combat system. Witch is about 10% of my game.
<<textbox>>bugfix and behavior change:
<<textbox>>macro under certain browser engines (WebKit/Blink and Presto). (n.b. the Extras button-toting variant was also updated)
<<textbox>>macro to set the $variable to the default value of the control at initialization.
data-*attributes. In particular:
data-passageattribute now supports $variables.
<area>tag (same as for the
<area>tag has a data-passage attribute, then it may also include a
data-setterattribute, which sets $variables (similar to the setter link wiki-text markup).
<Array>.contains()method to accept lists, either as multiple arguments or a single array.
Dateobjects are now properly serialized.
Historyprototype and its static methods to delta encode all copies of the history stack, including saves.
toString()is no longer an alias of the latter.
Published a new release (v1.0.0):
Note: If you override any of SugarCube's non-trivial styling, then release 1.0.0 probably breaks your CSS. Seriously, you have been warned.
- Majorly overhauled the CSS. Key style changes: reworked how the
- Changed how the
- Changed how the Rewind and Share menu dialogs work.
- Updated the macro processor to unescape string literals used as arguments to macros (e.g.
- Updated the
- Updated the
- Added the
- Added the
- Added the capability to flag internal passage links as having been visited by adding the class
- Added an additional test to the browser requirements check.
- Other improvements.
#passageselements interact, and reworked the @media queries. Additionally, the CSS has been split into several separate
<style>elements (one for each: init screen, fonts, structural, appearance, basic @media queries, narrow viewport @media queries), which will allow entire style groups to be removed or replaced by authors upon initialization.
MenuStorypassage in transformed into the story menu. The
StoryMenupassage is, temporarily, unaffected by this change. Basically, if you're using either passage as a dumping ground for non-menu content, you need to find someplace else for it (
StoryCaptionmight be a nice place).
"\"You can't make me!\""will now yield
visited()function to make it fully compatible with its vanilla counterpart.
previous()function to allow it to take an optional integer offset.
lastVisited()function, which returns the number of turns that have passed since the last instance of the given passage occurred within the story history or
-1if it does not exist.
state.has()method, which returns whether any states with the given title exist within the story history (e.g.
state.has("Bar")is equivalent to
visited("Bar") neq 0, save that
state.has()returns immediately upon finding an instance of Bar while
visited()traverses the entire history to count all instances of Bar).
link-visited, which is configured via the
You know who to call.