Hi,
I am trying to develop a short morality game in which the player chooses options that detract or add points to a morality score and a "biz" score. At the end, they see where their morality and business acumen fell.
I'm running into two issues, which I can't seem to find answers for despite looking through the forums.
In lieu of images, I'm trying to use icon fonts from Font Awesome. I was able to add the icons and preview my game from the online version of Twine, but when I published the game, the icons were completely gone. Likewise, trying to add the icon font to the downloaded version of Twine doesn't work.
Here is my code for that:
<head>
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">
</head>
<body style="overflow: hidden; height: 100%;">
<center>
<div style="position: relative; top: -150px; overflow:hidden; padding-bottom:-500px;">
<p style="font-family:Trebuchet MS; font-size:70px;line-height:90%;color: green; spacing:-30px;">
Ethics, LLC </p>
<p style="margin-top:-80px">[[<i class="fa fa-money fa-5x"></i>|Start]]</p>
</div>
It's kind of ugly, but the positioning looks good on preview. When I export the game, the money icon completely disappears, and there's no longer a link to click to progress in the game.
I opened up the .html file in Brackets and added the stylesheet code from Font Awesome to the head of the .html file itself, but that didn't do anything either. I tried to attach the file, but it was too big. If you'd like to see it, I can post a link from Dropbox.
EDIT: I've gotten the webfont issue resolved. Now it's just this!
The other thing I'm having issues with trying to create a morality counter. Here's what I've tried to do without success:
[[Choice|Result]]
(set: $moral to $moral + 1)
(set: $biz to $biz + 1)
[[Choice|Result]]
(set: $moral to $moral - 1)
(set: $biz to $biz + 2)
Ideally, selecting either choice will change the stored variable ($moral or $biz) by adding or subtracting points.
The "Result" page uses print to show the "score" of points for the choices. I'll clean that up eventually, but I want to get the mechanics down first. As-is, when I click on either option, there's no difference in the displays. Do I need separate "Results" pages? Ideally, the game would lead into a cumulative tally of both variables.
In addition to the above, I've also tried:
(set: $biz to ($biz + 2))
(set: $biz to it + 2)
These were ideas I found while searching the forums, but neither seemed to help.
I would like to use the icon font simply due to the hover effects and look of the game. The morality and biz counters are the sole gameplay mechanic. I have attached screenshots of how the icon appears on preview and how it appears from the .html file.
Thanks for your help. It says it in the title, but again, I'm using Twine 2.0.4 with Harlowe. I tried the downloaded version and the web version, and the icon fonts "work" in the web version but disappear after export.
Comments
Still frustrated with inventory, but that's at least one issue resolved. Thanks!
As for your other issue, does this comment by TheMadExile help?
The problem with writing "(set: $moral to $moral + 1)" inline is that, from the browser's perspective, the entire page is executed in one go, so it's the same as putting all the "set" stuff up at the very top of the passage. If you use TheMadExile's explanation of Greyelf's code, the value will instead be set at the time you click on the link, but before it forwards you to the subsequent passage. Does that make sense?
(Note: In the current incarnation of Twine 2/Harlowe, you won't get a nice link line drawn between your passages using this method. That will probably change in future, but for now, no.)
first passage name: start second passage name: lostPuppy third passage name: results fourth passage name: lostKitten
repeat process....