Quantcast
Channel: Help! with 2.0 - Twine Forum
Viewing all 1844 articles
Browse latest View live

trapped in an infinte loop?

$
0
0
I have designed a random labyrinth-maker, that populates a 2d grid/sets gates open closed etc, chooses a random direction and checks if visited before etc.

Now it works fine if i link the twine pages with [[link->link]] but when i try to automate it (60 keypresses before a game would be tiresome!) by linking with (print:"link") it gets the wiggins, bugs out and panics that it's trapped in an infinte loop!

Any idea how this can be avoided?

Colored text isn't showing properly in the game? (Harlowe)

$
0
0
I'm writing a story with multiple characters, and I've been using basic HTML (as in <font color = "#hexcode"> html) in order to change the font colors.

There's a problem, though - I can't make the text red, which I need to do for one of my characters. Whenever I try to input the code, it turns the text green instead - #980000, the desired color, shows up as #38761d (another character's color, who appears later in the story); and when I tried to make the text bright red, it showed up as neon green instead.

I'm not experienced with HTML, so I have no clue what's going wrong. Can anyone help?

(This was reposted from an earlier discussion, from about a month ago - I forgot to set it as a question, and it got no responses anyway.)

Polish language

$
0
0
I can see that in the languages folder there's .pak file with Polish language (pl.pak), but I am not able to choose it in software language panel. Why? Or, if it is not ready to use, is it possible for me to translate it by myself?

Is it possible to include my interactive story in a PDF format?

$
0
0
Hi! I'm not very techno-savvy, so I have no idea if this is even remotely possible. I would like to know if its possible (even if impractical) to produce a PDF containing my twine (2.0.11, using Harlowe 1.2.2) story. It has to be in PDF, as I plan on including it in my college thesis. I'd very much appreciate a fast response.

Slightly unrelated: is it possible to create a "standalone" executable or similar so that one may navigate the story without needing twine installed?

Putting an Image in a Button - SugarCube 2

$
0
0
Hi guys,

Is it possible to insert an image (specifically, an icon) into a button? I want to have a button with some text in it, and then a small icon on the end.

The reasoning behind this is so I can mark certain choices the player might make with familiar icons, to indicate they require skill checks or might involve a loss of alignment.

Harlowe won't load on fresh install?

$
0
0
Hi! I just downloaded 2.0.10 for Mac and installed, and when I navigate to the formats menu, Snowman and Sugarcube load as per usual, but I get an error message reading, The story format “Harlowe” could not be loaded (). Any clues?

Adding a mouseover/hoverfunction that activates hidden passage links (Twine 2, Sugarcube 2)

$
0
0
I was wondering if it is possible to add a function in Twine 2 where a player is taken to a new passage when they move their mouse cursor over a certain text. For example, if there is a bit of text that says: "Don't look at the black cat", and the player is taken to a new passage if they move the cursor over "black cat". I am using Sugarcube 2. Any help would be greatly appreciated!

SugarCube: How to erase previous searched locations from probability.

$
0
0
I'm relatively new to the programming side but do have some basic idea on html, css and Javascript. I'm currently making a bit of a RPG on SugarCube. As I mentioned, I'd like to have multiple events that could happen as part of a passage you can revisit. I was able to make the basic idea work with if/else conditionals:

Exploring...
<<set $explore = random(99)>>Debug: $explore

<<if !$foundLocationA && !$foundLocationB>>
<<if $explore < 50>> [[Random Event]]
<<elseif $explore < 80>> [[Location A]]
<<else>> [[Location B]]
<</if>>
<<elseif $foundLocationA && !$foundLocationB>>
<<if $explore < 80>> [[Random Event]]
<<else>> [[Location B]]
<</if>>
<<elseif !$foundLocationA && $foundLocationB>>
<<if $explore < 70>> [[Random Event]]
<<else>> [[Location A]]
<</if>>
<<elseif $foundLocationA && $foundLocationB>>
[[Random Event]]
<</if>>

Basically if I wanted such that there are multiple events more than Random Event, B, C here; if I found A or B I will no longer be able to find it again (I have another passage for old locations). Going to location A and B will set the foundlocationA/B to true which unlocks it for old locations. Is there some easier way to do this? (someone mentioned me used nodes not sure how) This would drive me insane if I have to repeat this for Location A-Z.

[SugarCube 2] The Set() data structure

$
0
0
Hey there,

Using SugarCube 2.1x.x
Twine 2.1.0

I tried recently to implement a Quest system that works with "templates" of different quest types (fetch quests, put given number of items into a specified container, visit a location and check game time while doing so, defeat an enemy type etc.), where I would have a MissionLog object for each mission these would be elements of a set. These sets would represent accomplished and still on going missions.

When a mission is complete I would move the mission from the on-going mission into the accomplished set.
The problem is that I can only call add() and delete() member functions inside JavaScript, since there's no equivalent in SugarCube 2. Now, of course in order to initialize the Set, I call the constructor inside SugarCube 2:
<<set accomplished_mission = new Set()>>

which yields "something" (I'm not sure what it is, probably a malformed array.)
I refer to this set in my JS code as follows:
State.variables.accomplished_mission

When I try to add() new elements to this "set" using JS code, for some reason, the system ignores the fact that I requested to work with a Set() data structure and creates multiple instances of the same object inside accomplished_mission. I checked for the "isArray()" property to find out what I'm working with but it yielded a big undefined for me. So, I'm not sure what is going on here. I found my self opening the console next to Twine 2 and trying everything that came to mind to find out more about the data structure that I got from SugarCube 2.

Now, of course it's needless to say that there is an easy workaround for this kind of problem in JS (simply check if the "set" already holds the item with the same Id and filter any new additions), but the fact that things don't work the way they supposed to, kind of bothers me. I'm afraid things like these could come back and bite me in the a$$ later down the road as I develop my game in SugarCube 2. I never thought I'd run into so many problems, which have delayed me significantly.

Can anyone explain to me what is going on here and why are data structures and some standard JS functions behave so strangely?

(SugarCube 2) Monitor a global variable and override content when it gets too high

$
0
0
I'm trying to implement a system where a particular negative variable is monitored during the player's playthrough and when it gets too high the player is taken out of whatever part of the game they're in and forcibly moved to a sequence giving them the opportunity to reduce it or lose. I'm not entirely sure the best way to put this into the game, and hopefully I'm making sense & explaining myself correctly, but any ideas?

[Sugarcube 2] Creating a dymanic map for a game

$
0
0
Hello

Twine 2.011 - Sugarcube 2.12.1
I'm helping teachers to create an exploration game about a school in the late XIXth century. A card of the schoolyard is required in that story.
But I had like to make it dynamic : only the parts corresponding to the visited passages should be displayed. Any idea or code snippet for making such a map ?
Thanks a lot for any advice.

Using Twine/Snowman as a component of a larger game?

$
0
0
I just started using Twine and was pleasantly surprised to see there's a way to control things pretty directly using JavaScript. Since I am an experienced programmer, I switched to Snowman and have mostly figured everything out already, but I'm wondering if anyone has any tips about using Twine as the dialogue engine for a game I'm writing in JavaScript. I assume it'll be importing Twine's playback code into my game, instead of using the HTML file Twine publishes.

Issues with table spacing

$
0
0
Hi everyone I'm new to the forum and to using Twine with very little coding experience.

I'm using 2.1 on Mac OS with Harlowe.

I've tried adding small tables to the page to show a 'Did you know' type top tip but every time I input HTML for a table it makes a huge space between the table and any text above it. I've checked the code and there is nothing creating paragraphs or similar and I have CSS only for fonts.

Can someone tell me the best way to input a single column multiple line table on pages?

Thanks

Showing text after timer in Snowman

$
0
0
I just started using Snowman and have not had any trouble with basic branching and conditionals (I'm an experienced programmer) but I just tried to get some text to show after a timer and it isn't working. Help?

what I tried:
You died.

<%
setTimeout(function(){
print("[[Try again!|main]]");
}, 1000);
%>

Restricting access after number of plays

$
0
0
I would like to be able to put a restriction or limit the number of times someone accesses one of my games. It may be this needs to be done on the actual website rather than within the game, but is there any way you can use code on certain paragraphs that would someone restrict access once a person has played say, five times?

There may be a number of ways to do this, but I am very new to this so any ideas or suggestions are welcome.

It may be that they need to enter an email address at the beginning (another answer required on how to do that!) or that it someone registers the local machine IP.

Any suggestions gratefully received. Twine 2.1 Mac OS.

Many thanks

How do I restart a stopped macro? Trying to make an active time battle system.

$
0
0
Hello everyone.

Lately, I've switched over to sugarcube 2 and I'm loving the "timed" and "repeat" macros. In combination with some <<replace>> macros, I've managed to build up a battle system that relies on just ONE passage :D.

Here's what I'm trying to achieve: An enemy creature attacks the player every 4 seconds, and the repeat macro restarts itself.
The Problem: I want to play a sound effect once that occurs, and I want to delay the restarting of the "enemy_attack_cd" macro for a few milliseconds. So I try to <<stop>> the repeat macro that counts down the seconds remaining to the next attack, and I've not been able to restart it. Sorry if this explanation is terrible, but here's the code:

<<widget "next_enemy_attack">>
<<repeat 100ms>>
<<set $enemy_cd to $enemy_cd - 0.1>>
<<if $enemy_cd > 0>>
<<replace "#enemy_cd">>
Next attack: <<print Number($enemy_cd).toFixed(1)>>s
<</replace>>
<<else>>
<<replace "#enemy_cd">>
Next attack: 0s
<</replace>>
<<stop>>
<<timed 0s>>
<<set $enemy_damage to random(10,20)
<<play attack.mp3>>
<<next 500ms>>
<<set $player_hp to $player_hp - $enemy_damage>>
<<replace #player-hp>><<print $player_hp>><</replace>>
<<timed 2s>>
<<set $enemy_cd to 5s>>
<<next_enemy_attack>>
<</timed>>
<</if>>
<</repeat>>
<</widget>>

Basically what I tried to do was put the widget within itself, hoping that that would restart it after a <<timed>> delay, but I guess I'm going about this the wrong way. Does anyone have a better idea of going about this? :(

Setting passage different tags

$
0
0
Hi,
Currently I am looking for a certain tag in passages and counting the number of passes. What I am looking for is a way to set
somehow the tag as a code, so that I can set multiple tags for different passages.

1st tag - do not count
2nd tag - count

For example if I come from A passage with 1st tag, into passage B i get standard message, but if I come from A with 2nd tag I get different one. Is that possible? Basically I want to add additional if/else for history of passages but according to tags and mix them with passages.

[Twine 2 - Harlowe] Can I print a number to 2 decimal places?

$
0
0
Hi all,

I am just starting out using Twine 2 (using story format Harlowe 2.0) and still getting hang of a few things. I will apologise immediately if I use the wrong terminology when referring to things. (Still learning).

I have generally been able to find answers to issues, however, I cannot seem to find if I can print the result of a variable to 2 decimal places, such as printing 13.25 instead of a whole number. The only methods that I can see in the wiki only show how to do a whole. Is there an option to 2 decimals?

Any guidance would be great :)

Restricting access after number of plays

$
0
0
I would like to be able to put a restriction or limit the number of times someone accesses one of my games. It may be this needs to be done on the actual website rather than within the game, but is there any way you can use code on certain paragraphs that would someone restrict access once a person has played say, five times?

There may be a number of ways to do this, but I am very new to this so any ideas or suggestions are welcome.

It may be that they need to enter an email address at the beginning (another answer required on how to do that!) or that it someone registers the local machine IP.

Any suggestions gratefully received. Twine 2.1 Mac OS.

Many thanks

Table in Sugarcube 2?

$
0
0
Hi! I am pretty new to Sugarcube. I want to make a table that compares stats between two objects. Is there a way I can do this? Thanks!!
Viewing all 1844 articles
Browse latest View live