Giter Club home page Giter Club logo

adventures's Introduction

Adventures

Adventures is a custom story format for Twine 2 that allows writers to make interactive stories with RPG elements such as health, items, inventory, gold and more.

Usage

Information about how installing and creating stories in Adventures is available here.

Development

If you wish modify Adventures, you can clone the repository and install the dependencies using:

npm install

Assets

Adventures uses 7Soul's excellent but-not-free assets. Because I obviously can't redistribute them freely, they aren't included in the repository if you clone it. You will need to buy them if you want to build Adventures. You will need at least:

Once you obtained them, you need to unzip the archive files into the images/ folder. Once done, you should have a folder directory that roughly lookes like this:

adventures/
├─ ...
├─ images/
|  ├─ Arrows/
|  ├─ Bars/
|  ├─ Buttons/
|  ├─ ...
|  ├─ Pack 1B/
|  ├─ Pack 1B-Renamed/
|  └─ ...
├─ ...

Debug & Build

If you want modify Adventures, you will want to build & debug it locally:

  • First launch Webpack using the command:
npm run start
  • In Twine, add the custom story format by clicking Formats, then Add a New Format and then past the file address to format.js which should look like:
(On Windows)
file:///E:/Users/.../adventures/dist/format.js
(On Unix)
file:///home/.../adventures/dist/format.js

With this setup, you don't need to re-add the custom story format everytime you make a modification in the code. Twine will automatically take the newest version of format.js everytime you launch your story.

adventures's People

Contributors

longwelwind avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

adventures's Issues

can't install format

When I try to install the format per the instructions, I get this error:

The story format at https://raw.githubusercontent.com/Longwelwind/adventures/master/dist/format.js could not be added ().

I'm not sure what's going on. I'm using a fresh install of the latest Twine 2 on OSX Sierra.

Races and Max Health (suggestions)

Hello! Before i begin, i just want to say that i love the adventures format and the tools it provides, but there are 2 suggestions that i think would make it even better:

suggestion 1: Races
you should add races to the format, maybe starting off with, for example, elf, dwarf, and human, but like with items give the player the ability to add their own by specifying a name and position of the race's portrait on a spreadsheet. Your race could be shown by displaying the portrait in between the name and the inventory. This would be useful to programmers because you could have several different races, and then generate stats based on those races using the already in place but hidden stats system, i.e. orcs have naturally higher strength or elves have naturally bad health.

some example codes:
character.setRace("orc"); //sets race to orc
(character.race); //outputs the character's race

P.S: this system could also work as a class system, where you could be an archer, a warrior, a healer, etc

suggestion 2: Max health modification
Right now in adventures, the max health of the player is locked at 20. I think it would be really useful to be able to change that, for example if your game has a level system and you want to be able to increase the player's max health every time they level up, or if you want to tie the player's max health to a stat.

here are some example codes, plus rewrites of old health code so it works better with the new ones:
character.health.damage("5") //does 5 damage to the player
character.health.heal("12") // heals the player by 12 hp
character.health.set("4") //sets the player's current health to 4
(character.health) // outputs the player's current health
character.health.maxIncrease("5") //increases the player's max health by 5
character.health.maxDecrease("10") //decreases the player's max health by 10
character.health.maxSet("100") //set's the player's max health to 100
(character.health.max) //outputs the player's max health

thanks for reading my suggestion, feel free to implement or ignore it.

Reduce the size of format.js

The format.js file at the moment is quite big, topping at 3Mb, making the loading of the game quite long.

Some ways to reduce that:

  • Minimify JS code (both for Adventures' code and libraries)
  • Images are at the moment base64-encoded into the CSS. Find a way to either optimize them, or find a way to not bundle them into the CSS.

Shop is broken

I was looking through the files to find more ways to use the format and found that there is a shop feature. When I tried to use it, it broke the story to the point of not loading. Is this normal?

very very small question

i love this format so so much, and it's what's inspiring me to actually sit down and learn javascript - but as a total beginner, I have one major question; is it possible to edit the colorscheme of the format from within twine (and thus not lose the really cool rpg assets via cloning) or is that something that it needs to be properly modified to do? Not that the colors in it already aren't nice, I just really would like to be able to change the 'lighting', as it were, when moving from scene to scene.

removeItem() not working?

Hello! I am finding that character.inventory.removeItem() does not work, at least for me. Here is a short story that should show that removeItem() doesn't work:

Home

You are standing in a grassy field.
<%if(!character.inventory.hasItem("sword")){%>
A sword lies here.
[[Take sword.|Take]]
<%}else{%>
You wield a sword.
[[Drop sword.|Drop]]
<%}%>

Take

<%character.inventory.addItem("sword");%>
You take the sword.
[[Continue.|Home]]

Drop

<%if(character.inventory.removeItem("sword")){%>
You put the sword down.
<%}else{%>
ERROR: character.inventory.removeItem("sword") failed!
character.inventory.indexOf("sword") is <%=character.inventory.items.indexOf("sword")%>.
<%}%>
[[Continue.|Home]]

This will print:

ERROR: character.inventory.removeItem("sword") failed! character.inventory.indexOf("sword") is -1.

character.inventory.hasItem not defined

Hello. I've followed the directions in the documentation in order to test the example.
Added the format in twinery.org, imported the downloaded html file and tested. However, it crashed complaining there were no function character.inventory.hasItem, so I defined it like this:

character.inventory.hasItem=function(name) { 
   var res = false; 
   character.inventory.items.forEach(
      function (item) { 
         if (item && item.tag == name) 
            res = true; 
      }); 
      return res; 
}

I didn't check if the code in the repository defines, I just quickly tested and quickly added that function.

Cant load external images ?

Hi! I'm getting broken image icons in my text boxes instead of displaying the linked images. Would that be fixed if I encoded my scene bgs in base64 or do I need to make em a specific size? Thanks so much, this is a really cool tool, I've spent a good few hours in it over the past few days!

Can't install story format

I've been install the fresh version of Twine 2.1.2 x64 on Windows 10 x64.
When I tried to install story format I've got this error:

The story format at https://cdn.rawgit.com/Longwelwind/adventures/master/dist/format.js could not be added (Timeout).

Same on Ubuntu 16.04.06 x64 and all of web versions.
Also, I tried to install local versions from C:\format.js and got the same error.

Twine 2.3.0b2 can install this story format correctly, but this version can't run example from here:
https://raw.githubusercontent.com/Longwelwind/adventures/master/examples/complete-tutorial.html

This software looks buggy. It dissapointed me.

Item Hover Text Not Working

Whenever I load my game and get an item and hover over it, the hover text doesn't appear! Why is that? How can I fix it?

List of required image assets?

I see that Adventures uses image assets which are not included by default, as they need to be purchased separately.

Is it possible to get a list of the names and descriptions of the expected image assets, for those who would prefer to create their own? I imagine it would be a common requirement to customise the look and feel of the graphics.

Love the idea of this project btw - great work!

Stats?

Any news on fixing the stats system?

Can't specify two function in story config

So, i tried to use custom items and specify a death passage, but i can't have both working at the same time.
so, if code look like this

window.config = { 
	"items": [
        {
            "tag": "bow",
            "name": "Arc",
            "x": 3 , "y": 93
        },
		 {
            "tag": "hunt",
            "name": "Armure de chasseur",
            "x": 10, "y": 3
        },
			{
            "tag": "pirate",
            "name": "Armure de pirate",
            "x": 1, "y": 10
        },
		{
            "tag": "sabre",
            "name": "Sabre",
            "x": 15, "y": 108
        },
		{
            "tag": "stick",
            "name": "Bâton de shaman",
            "x": 3, "y": 110
        },
		{
            "tag": "shaman",
            "name": "Manteau de shaman",
            "x": 6, "y": 4
        },
			]
},
	{	
		deadMessage: "Vous êtes mort"
		deathPassage: "mort", 
};

story is loaded, custom items work but the deadMessage and deathPassage are not set to what i want them to be set.
I also tried to set it by calling it in the first passage with

<% story.config.deathPassage = "mort"; story.config.deadMessage = "Vous êtes mort" %> 

but then that only made the deadMessage working.
I know that i am probably making a mistake, but i don't know where, can someone help me ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.