Howdy, Stranger!

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

Customizable game menu and IGA:s

Hi! I'm new to Twine and to this forum. I use Twine version 1.4.2 (since I want to put images in my story) and the story format Sugarcane.

I have a question regarding the game menu and in-game advertising. I've read Long_Story_Short's topic where the user asked how to put advertisements in games among others.

My first question is: Is it possible to add in-game advertising in one's Twine-game by using codes from e.g. Google ads?

As for the menu, I've taken a look at Zoe Quinn's Depression Quest (free version). As you can see in the menu to the left, there's only information about the authors of the game. When I create my first Twine-game, there is this information and link to TiddlyWiki and the button "Restart the game". When I try to use the "Restart button" when I experiment with my story, the story doesn't restart from the beginning.

My next two questions are the following:
1. How do I remove the default information in the menu so that I can make a menu similar to the one found in "Depression Quest"?
2. How can I make the "Restart button" work properly?

As you can see, I have no knowledge about programming (I have basic knowledge of HTML which I rarely have used for years) and I've tried to look around on the net for answers. But I suppose I haven't used the correct search words.

Thanks in advance.

Comments

  • This is not related to your question but it will save you time later on, my advice get the latest twine (2.8 something or whatever) and sugarcane (2.8 or something) hopefully if you didn't too much work into it you could restart in the latest version to reduce limitations (you could images in all formats (I...think) I have a animated gif background and I can insert pictures and I am using harlowe 1.22)
  • edited October 2016
    Khaloodxp, thanks for taking your time to reply, even if it's not related to any of my three questions.

    Actually I used the latest version of Twin 2.0, but I changed to 1.4.2. because I couldn't insert images the way I wanted, especially when I tried to follow auntiepixelante's tutorial.
  • it's really easy to add images<img src="the url"> in twine 2.0, but if anything you should atleast update sugarcane to it's latest version to reduce any limitations to the macros and I hear they added more macros, I don't know really I am more of a harlowe type of person
  • edited October 2016
    Warnings:
    1. I strongly suggest that you switch from Sugarcane to one of the SugarCube story formats, preferably the 2.x series as it is still actively being developed.

    I suggest this because the version of Sugarcane that comes Twine 1.4.2 was released in mid 2014 and it has a number of limitations and bugs, some of which have been fixed in the Twine 1.x source code repository but these fixes have not been released in an update and in my opinion it is unlikely that they will be anytime in the near future.

    2. Unless you plan to only embed a small number of MB's worth of images into your story then I strongly suggest referencing them as external file, either locally stored or hosted on-line, the reason I suggest these is two folded:

    2a. Embedding images within a story dramatically increases the size of your story HTML file and the user has to download this large file each time you do an update. If your update only contains changes to the passage text or logic of your story (not the images) then the user has an unnecessary large file to download where as if the story's images were externally stored then the user would only need to download a HTML file containing only passage text and logic with is generally less than a couple of MB's in size.

    2b. The Twine 1.4.2 application's build process with fail with an out of memory error once the Total Size of your story project reaches some where between 50-100 MB's in size, and this is quite easy to do with a story with embedded images.

    Now to answer some of your questions:
    How do I remove the default information
    If you use your web-browser built-in Developer Tools to look at the HTML elements for that section of the page you will see that the related element has an ID of credits, so If you really feel a need to remove the Sugarcane credits you can do that using some CSS based on that ID. The follow goes in your story's stylesheet tagged passage.
    #credits {
    	display: none;
    }
    
    How can I make the "Restart button" work properly?
    The restart link does send the reader back to the first passage of the story and it even resets the story's variables/internal state. What it does not do is reset the web-browser's own History system, so the reader is still able to use the web-browser's Back button to undo the past.

    Switching to SugarCube would fix the web-browser's History system/Back button issue because it does not use it to track the story's internal state.
  • Khaloodxp and greyelf, thanks for the replies, I'm having a huge problem with my internet connection, so browsing through the forum is difficult for me right now.

    Alright, I understand that it's preferable to have external images in order to make the HTML-file not too big. But how do I exactly link to images stored in my computer? I'm not linking to images found on the Internet. With 1.4.2. I didn't need to think of this problem, especially when I need to test run my game a lot.

    Secondly, how do I exactly upgrade Sugarcube when I install the latest 2.x version?
    greyelf wrote: »
    #credits {
    	display: none;
    }
    
    greyelf, so I simply open a new passage StoryInit and add the code above in the passage?

    greyelf wrote: »
    The restart link does send the reader back to the first passage of the story and it even resets the story's variables/internal state. What it does not do is reset the web-browser's own History system, so the reader is still able to use the web-browser's Back button to undo the past.

    Switching to SugarCube would fix the web-browser's History system/Back button issue because it does not use it to track the story's internal state.
    But greyelf, when I tried my game and I was at other passages, the restart button didn't take me back to the first passage of the story. Then the restart button is pretty much useless, isn't it?

    Since we're already discussing the pros of 2.x and Sugarcube:
    1. if I want to use an inventory system, how could I "make it" happen?
    2. if I want to use a old computer log/SMS-like system, which codes can I use?
    3. if I want the reader to have many language options, like English, French and Swedish (my native language), do I have to have all of translations of all the passages together in the final game?

    If some of my questions have already been answered in another thread, then please point me in the right direction.

    Thank you.
  • here's a page in the twine wiki about making an inventory in sugarcube, but sadly I can't explain it or give examples on how to edit it as I said sugarcube isn't my forte
  • to "upgrade" sugarcube you basically download the latest version from here and then go to formats in twine and add new format (if I remember correctly), if you want external images that you can link from your computer, simple, download dropbox, download the image you want and copy it to dropbox, dropbox will sync up and then you can copy the link an (note: change the 0 to 1) example:
    <img src="https://www.dropbox.com/s/uxm5l0rw7jg9j0d/9.jpg?dl=1">;
    
    (I changed it so it won't work but you get my point) of course I am using harlowe but I think it works the same way in sugarcube and good luck :smiley:
  • But how do I exactly link to images stored in my computer?
    Ideally when you first created your story project TWS file you saved it within it's own folder somewhere on your local hard-drive.

    eg. something like c:\mystory if you are on Window although you may of created that folder somewhere other that the root of your C: drive and obviously named it something other than mystory.

    Within that folder create a new sub-folder to store all your stories media files in, in this explanation I will name the new sub-folder media, once this has been done move all your story's image/sound/video files in this new folder.

    eg. the folder structure will look something like c:\mystory\media, your story.tws file will be in the c:\mystory folder and your media files will be in the c:\mystory\media folder.

    Assuming your image is named background.jpg you would used code like the following to reference your image.
    SugarCane or SugarCube
    <img src="media/background.jpg">
    
    SugarCube
    [img[media/background.jpg]]
    

    so I simply open a new passage StoryInit and add the code above in the passage
    As I stated in my previous post "The follow goes in your story's stylesheet tagged passage.", if your story does not have one these passages yet you can use the Story > New > Stylesheet menu items to create one. This is where all the custom CSS used to style your story will be placed.
    the restart button didn't take me back to the first passage of the story
    Which operating system (brand, version, edition, 32/64bit are you using?
    Which web-browser(s) (brand, version, 32/64bit) did you use to test the restart link (it's not a button) with?

    I ask because the restart link is meant to work as I previously described, and I tested that functionality (using Chrome and Firefox on Windows) before I commented about it.
    Since we're already discussing the pros of 2.x and Sugarcube:
    Those three question are too large to answer in a single thread, I suggest you create new Questions for each of them.
  • Khaloodxp wrote: »
    I am using harlowe but I think it works the same way in sugarcube and good luck :smiley:
    Thanks for the link. But Khaloodxp, can you please tell me what is so special with Harlowe? I only know it's the default format in Twine 2.x.

    greyelf wrote: »
    Ideally when you first created your story project TWS file you saved it within it's own folder somewhere on your local hard-drive. [...]
    Alright, then I can see how the images fit with my story this way. But when I want to upload the whole story to a web server (or Dropbox) or when a friend "installs" my story on his/her computer then I'll have to change all of the image links manually, won't I?

    And if I want to upload my story to Kongregate (I've heard of a case where one of its users has submitted his game to that GameStop-owned social media website) and/or Gamejolt as a standalone game, all of the image codes will be "mucked up" right?

    I guess you can see now why I perfer to "embed" the images in the HTML-files directly? I'm not planning to make a large HTML-file >50 MB.

    greyelf wrote: »
    As I stated in my previous post "The follow goes in your story's stylesheet tagged passage.", if your story does not have one these passages yet you can use the Story > New > Stylesheet menu items to create one. This is where all the custom CSS used to style your story will be placed.
    I didn't know about that function, thanks for your patience to explain it for me.

    greyelf wrote: »
    the restart button didn't take me back to the first passage of the story
    Which operating system (brand, version, edition, 32/64bit are you using?
    Which web-browser(s) (brand, version, 32/64bit) did you use to test the restart link (it's not a button) with?

    I ask because the restart link is meant to work as I previously described, and I tested that functionality (using Chrome and Firefox on Windows) before I commented about it.
    Of course. I use Windows 7 Home Premium 64bit version. Twine (both 1.x and 2.x) automatically use Internet Explorer 10 to test play my stories.

    Only when I have built the game as a standalone HTML-file, I can open it with Firefox (There's no "Open file" in Chrome, I can't find it anyway). And yes, I can see that the restart link works as it should now. Then I guess I won't need to worry about it when I continue building my game. The restart link doesn't work in Internet Explorer at all.

    greyelf wrote: »
    Since we're already discussing the pros of 2.x and Sugarcube:
    Those three question are too large to answer in a single thread, I suggest you create new Questions for each of them.
    Will do. Thanks again greyelf!

    And if anyone of you happen to find an answer to my original question about in-game advertising, I'll be happy to hear about it.
  • Thanks for the link. But Khaloodxp, can you please tell me what is so special with Harlowe? I only know it's the default format in Twine 2.x.
    honestly it's just like how some people use their right hands and other use their left, it's the first format I used, I tried sugarcube and found it too complicated, I guess I just like the macro structure and I am more accustomed to it, it doesn't really matter which format you use as long as your good at it, but there is one major pro to harlowe people could download your html and load it up with twine so it's great for beta testers, people on the forum could easily help you with your pages and sugarcube has one major pro you could download a save file for your game, harlowe could only save per browser and sadly each time you update the game the save will be deleted, these smalls pros are basically it you have to ask the question do I want beta testers to be able to help me or is my game too large that it needs an external save file (a game less than 1hr isn't worth it)
  • edited October 2016
    Alright, then I can see how the images fit with my story this way. But when I want to upload the whole story to a web server (or Dropbox) or when a friend "installs" my story on his/her computer then I'll have to change all of the image links manually, won't I?
    No.

    If you use relative URLs like the one in my example then all you need to do is supply the folder containing the media files along with your story HTML file to either your friend or a web-server and the image links should just work.

    One common method used to do the above is to add both the story HTML file and the media folder to a ZIP archive file (aka a Compressed Folder in Windows) and then supplying the ZIP archive file to whomever you want. This Zip and unzip files article at Microsoft explains one way to do the archiving.
    Twine (both 1.x and 2.x) automatically use Internet Explorer 10 to test play my stories.
    The Twine 1.x application uses whichever web-browser you have configured as your default for Windows. The Twine 2.x install-able application uses it's own built-in webkit based custom web-browser, and the web-browser based release of Twine 2.x uses whichever web-browser you are using to run the application.

    If you are manually running a story HTML file you have generated (via Build or Publish to File) then it will also use whichever you have configured as your default for Windows unless you deliberately open it with another web-browser.
  • Khaloodxp wrote: »
    […] but there is one major pro to harlowe people could download your html and load it up with twine so it's great for beta testers, people on the forum could easily help you with your pages […]
    You say that as though it's not true of every story format. That feature is not unique to Harlowe in any way.
  • edited October 2016
    Khaloodxp wrote: »
    […] but there is one major pro to harlowe people could download your html and load it up with twine so it's great for beta testers, people on the forum could easily help you with your pages […]
    You say that as though it's not true of every story format. That feature is not unique to Harlowe in any way.
    Khaloodxp wrote: »
    […] but there is one major pro to harlowe people could download your html and load it up with twine so it's great for beta testers, people on the forum could easily help you with your pages […]
    You say that as though it's not true of every story format. That feature is not unique to Harlowe in any way.
    tried it with sugarcube if you download the html file by right clicking and then save as, and then try to load it up with twine, twine lags a bit and then does nothing or else I would have already download scaffold 22, if there is a way that you can download sugarcube-based twine games directly using save as then please tell me
  • Khaloodxp wrote: »
    tried it with sugarcube if you download the html file by right clicking and then save as, and then try to load it up with twine, twine lags a bit and then does nothing or else I would have already download scaffold 22, if there is a way that you can download sugarcube-based twine games directly using save as then please tell me
    You cannot load Scaffold 22 into Twine 2, which is what I'm assuming you tried to do, because it was compiled with Twine 1. The data chunk format differs between the two compiler families and they are not directly compatible. Which story format is used has nothing to do with your inability to do import Twine 1 compiled projects directly into Twine 2—or vice versa.

    Beyond that, Scaffold 22 uses a hacked version of SugarCube, so even if you could import it into Twine 2—and there is a Twine 1 ⇒ Twine 2 converter—you'd be missing parts of the code.
  • Khaloodxp wrote: »
    honestly it's just like how some people use their right hands and other use their left [...]
    I'm aware that everyone favors the formats differently. But I wanted to know why you thought Harlowe was great according to you.
    Khaloodxp wrote: »
    [...] you have to ask the question do I want beta testers to be able to help me or is my game too large that it needs an external save file (a game less than 1hr isn't worth it
    Thanks for explaining for me how you work with your projects. I would love to try one of them out.

    greyelf wrote: »
    If you use relative URLs like the one in my example then all you need to do is supply the folder containing the media files along with your story HTML file to either your friend or a web-server and the image links should just work.

    [...]

    This Zip and unzip files article at Microsoft explains one way to do the archiving.
    I don't have any problems with creating ZIP archived files (I do that all the time everyday), but I needed to be sure nevertheless. I hope you didn't mind me - a layman - asking about things you would take for granted since I'm more in the science field.

    I'll give Twine 2.x a new chance and in case I get stuck, I'll either post in this thread or create a new one.
    greyelf wrote: »
    If you are manually running a story HTML file you have generated (via Build or Publish to File) then it will also use whichever you have configured as your default for Windows unless you deliberately open it with another web-browser.
    Yes, I can deliberately open the generated HTML file with Firefox, but not with Chrome. I don't know how to change the default web-browser. Is it with this method?
  • Khaloodxp wrote: »
    tried it with sugarcube if you download the html file by right clicking and then save as, and then try to load it up with twine, twine lags a bit and then does nothing or else I would have already download scaffold 22, if there is a way that you can download sugarcube-based twine games directly using save as then please tell me
    You cannot load Scaffold 22 into Twine 2, which is what I'm assuming you tried to do, because it was compiled with Twine 1. The data chunk format differs between the two compiler families and they are not directly compatible. Which story format is used has nothing to do with your inability to do import Twine 1 compiled projects directly into Twine 2—or vice versa.

    Beyond that, Scaffold 22 uses a hacked version of SugarCube, so even if you could import it into Twine 2—and there is a Twine 1 ⇒ Twine 2 converter—you'd be missing parts of the code.
    I am using scaffold 22 I tried downloading other sugarcube games they didn't work either, I could assume that they were all made by twine 1 I'm going to take your word for it and assume that all formats support it (for now), simply because I am kinda busy now
  • Khaloodxp wrote: »
    I'm going to take your word for it and assume that all formats support it (for now), simply because I am kinda busy now
    I'm the author of the SugarCube story format, have contributed to both compiler families, and written my own Twine 1 family compiler (TweeGo). I kind of know what I'm talking about here.

    As I stated previously, it's not a matter of story formats supporting it, the compiler in question must support it.

    There are two compiler families, each with multiple implementations: (not an exhaustive list)
    • Twine 1 family: Twine 1, Twee, and TweeGo.
    • Twine 2 family: Twine 2, Twee 2, and grunt-entwine.
    Unless the target compiler has been written to support it, directly importing the compiled form of a project built with a compiler from the other compiler family will not work as the target compiler will not be able to find the data chunk, since each family defines a unique chunk format.

    AFAIK, no compiler has, yet, been written which understands the data chunk format of both compiler families. That said, there are some conversion utilities out there which can load the compiled form of a project and do a conversion of its data chunk—the only one I know of off hand is my own Twine 1 compiled form ⇒ Twine 2 story archive converter.

    There are other complications as well, however, the data chunk format incompatibility is the first hurdle.
  • I'm kinda of a "see with my own eyes" type person I don't mean to insult you in any way, but I'm still going to check by making a game in every format, but right now I don't have the time for that, so for now I'm taking you word for it (on a side note thanks for the explanation it was quite informative)
  • edited October 2016
    Khaloodxp wrote: »
    ...going to check by making a game in every format...
    When you do get around to doing this you will notice that the 'data chunk' in a story HTML file created using a Twine 1 related compiler looks something like:
    <div id="store-area" data-size="3" hidden="">
    	<div tiddler="Start" tags="" created="201610060841" modifier="twee" twine-position="10,10">...contents of passage...</div>
    	<div tiddler="StoryAuthor" tags="" created="201610060841" modifier="twee" twine-position="10,290">Anonymous</div>
    	<div tiddler="StoryTitle" tags="" created="201610060841" modifier="twee" twine-position="10,150">Untitled Story</div>
    </div>
    
    Where as a similar 'data chunk' in a story HTML file creates using Twine 2 related compiler look like:
    <tw-storydata name="Untitled Story" startnode="1" creator="Twine" creator-version="2.0.11" ifid="" format="" options="" hidden>
    	<style role="stylesheet" id="twine-user-stylesheet" type="text/twine-css"></style>
    	<script role="script" id="twine-user-script" type="text/twine-javascript"></script>
    	<tw-passagedata pid="1" name="Start" tags="" position="745,444">...contents of passage...</tw-passagedata>
    	<tw-passagedata pid="2" name="StoryAuthor" tags="" position="745,580">Anonymous</tw-passagedata>
    </tw-storydata>
    
    ... as you can see they have different structures and contain slightly different data.
  • greyelf wrote: »
    ... as you can see they have different structures and contain slightly different data.
    The passage data encoding is a bit different as well.
Sign In or Register to comment.