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

Footers and Health Bars

$
0
0
Hi folks,

I am really new to Twine and coding. Everything I know I have learned through google and reading through this forum. I am currently stuck with a few different issues, and I was hoping someone may be able to point me in the right direction.

I am currently working in Sugarcube and have a code for an inventory/codex system. In this code, each inventory/codex item as a separate passage that describes or gives further information for that item/person/etc. I was wondering if there is away to put the "Codex entry added" part of this code at the bottom of the passage? I was thinking that may be something that happens in the footer, but I haven't entirely figured that out yet.

<<linkappend "Wolves">><<addToCodex "Wolves">> Codex entry added. <</linkappend>>

I was having a really hard time figuring out the best way to operate my Codex/Inventory codes. If you have any advice, I would love it.

Next question:
I am trying to build a combat system in Sugarcube. I haven't been able to figure out how to create variables to deduct and add health. The code I have right now is:

<progress id="health" max=100></progress>
<div id="val"></div>

<script>
while (true){
document.getElementById("health").setAttribute("value", $health);
}
</script>

I have this code in the StoryCaption passage because I wanted it to appear in the sidebar for consistency. I haven't been able to figure out what I'm doing wrong.

I'm sorry these are kind of silly questions. I appreciate any help.

Viewing all articles
Browse latest Browse all 1844

Trending Articles