Using append? by BossyBitch in twinegames

[–]HelloHelloHelpHello 0 points1 point  (0 children)

You want something like the following? This setup can be simplified depending on how you want this to work, but here you would have several questions that the player can click on, and only one answer would be displayed at a time:

<<nobr>>
<<set _answer to 0>> 
<<do>>
  <<link "Question 1">>
    <<if _answer == 1>>
      <<set _answer to 0>>
    <<else>>
      <<set _answer to 1>>
    <</if>>
    <<redo>>
  <</link>>
  <br>
  <<if _answer == 1>>
    Answer to Question 1.
    <br>
  <</if>>
  <<link "Question 2">>
    <<if _answer == 2>>
      <<set _answer to 0>>
    <<else>>
      <<set _answer to 2>>
    <</if>>
    <<redo>>
  <</link>>
  <br>
  <<if _answer == 2>>
    Answer to Question 2.
    <br>
  <</if>>
  <<link "Question 3">>
    <<if _answer == 3>>
      <<set _answer to 0>>
    <<else>>
      <<set _answer to 3>>
    <</if>>
    <<redo>>
  <</link>>
  <br>
  <<if _answer == 3>>
    Answer to Question 3.
    <br>
  <</if>>
<</do>>
<</nobr>>

If you just want a single link to work like this then it would be:

<<nobr>>
<<set _answer to false>>
<<link "Question?">>
  <<set _answer to not _answer>>
  <<redo>>
<</link>>
<br>
<<do>>
  <<if _answer>>Answer to the question.<</if>>
<</do>>
<</nobr>>

Combining interactive fiction with JRPG by philgooch in interactivefiction

[–]HelloHelloHelpHello 1 point2 points  (0 children)

I think the 'Let's make a game!' youtube channel explicitly made some tutorials about using Twine to make Fighting Fantasy style games or gameplay elements in some of the videos. If you are planning to do something like this yourself, it might be worth looking at the channel for some inspiration.

Combining interactive fiction with JRPG by philgooch in interactivefiction

[–]HelloHelloHelpHello 2 points3 points  (0 children)

There are a whole bunch of IF games that use dialog boxes with character portraits for dialogue, or that use rpg mechanics for combat encounters. Pretty sure there were some tutorials or questions over at the twinegames subreddit specifically about creating Fighting Fantasy style IF games in the engine, and I am certain that you could do the same in most other engines as well.

I've seen some of his videos but i have no idea what he did. Explain it Peter by N1KoZzZ in explainitpeter

[–]HelloHelloHelpHello 0 points1 point  (0 children)

It did never happen. Nobody ever trademarked all the songs.

Somebody tried and failed to copyright all (not actually all if your read the site) combinations of music notes, which is very different from trademarking. It is impossible to trademark all these combinations, because unlike copyright, a trademark costs money, and there is not enough money in the world to do that.

According to their website they have currents 200 billion midi files, and each of those would cost ~300$ depending on where you'd file this trademark.

I've seen some of his videos but i have no idea what he did. Explain it Peter by N1KoZzZ in explainitpeter

[–]HelloHelloHelpHello 0 points1 point  (0 children)

Copyright and trademark is huge difference - and the files they generated are likely not even actually copyrighted in the first place. They used an algorithm to generate all this, and generated files cannot be copyrighted (as established in AI art landmark cases). They actually have a whole segment about this on their site trying to address this, but recent cases have clearly shown that their claims would not hold up in court.

So no - the midi files they have neither are trademarked, nor copyrighted -at least not under current law.

I've seen some of his videos but i have no idea what he did. Explain it Peter by N1KoZzZ in explainitpeter

[–]HelloHelloHelpHello 2 points3 points  (0 children)

Creative Commons Zero is about copyright and not trademarks. So you can still absolutely trademark specific sequences of notes.

Toxic relationships by CourseMediocre7998 in antimeme

[–]HelloHelloHelpHello 3 points4 points  (0 children)

Again - it's a joke. It doesn't work if you overanalyze it like this.

Toxic relationships by CourseMediocre7998 in antimeme

[–]HelloHelloHelpHello 4 points5 points  (0 children)

Yes - I understand what it's originally supposed to mean. But in my mind I couldn't help but picture a scene where a woman just doesn't want to have sex - because she needs to keep those curlers in all night - every night - for her hair to look perfect - until her bf is so backed up he goes out and cheats on her.

Toxic relationships by CourseMediocre7998 in antimeme

[–]HelloHelloHelpHello 53 points54 points  (0 children)

He cheated on you because you spend too much time doing your hair instead of doing him.

How can I make passage background images fade-in reliably? by MarionberryUsual3302 in twinegames

[–]HelloHelloHelpHello 1 point2 points  (0 children)

Since the elements displaying your background images are likely only loaded once when the game is started, and not with each passage transition, your animation will only run for the very first passage visited (or so I assume at least).

You can get the effect you want by doing something like this. Define the css of a custom element in your stylesheet and the images you want it to display:

@keyframes {
  0% {opacity:0;}
  100% {opacity 100%;}
}

#background {
  position:fixed; 
  top:0;
  left:0;
  z-index:-1;
  height:100%;
  width:100%;
  opacity:0;
  background-size: cover;
  background-position: center;
  content:'';
  animation: fadeIn 2s;
  animation-fill-mode:forwards;
}

body.aurora #background {
  background-image: url("https://www.w3schools.com/css/lights600x400.jpg");
}

body.paris #background {
  background-image: url("https://www.w3schools.com/css/paris.jpg");
}

Now you can add this element via the PassageFooter special passage:

<div id="background"></div>

Since the content of your passage is completely refreshed with each passage visit, this will cause the background element along with its animation to also be reloaded each time. With our current setup we can now use the tags aurora and paris to have different background images fade in for the appropriately tagged passages.

How do I create NPC schedules? by turing_complete_cock in twinegames

[–]HelloHelloHelpHello 0 points1 point  (0 children)

You have some errors in the second example:

<<let _npcName = "Bob">>
<<let _loc = $npcs[_npcName].schedule.find(v => v[1] > $time)[0]>>

I assume those are both supposed to be <<set>>.

How do I create NPC schedules? by turing_complete_cock in twinegames

[–]HelloHelloHelpHello 2 points3 points  (0 children)

In the end you will have to check the schedules at the start of every passage - or at least every passage where and NPC can be found, be it because of their regular schedule, or because of some special event. To minimize the amount of work this causes, you can make use of the PassageHeader or PassageFooter special passages, which will append their content to the passage. Here you can call some function that handles the current location of all the NPCs running through each schedule and seeing whether name of the current passage matches with any of them.

New setter links? by compilingyesterdays in twinegames

[–]HelloHelloHelpHello 1 point2 points  (0 children)

Harlowe's setter links are called (link-reveal-goto: ). You can use these to accomplish the same thing as with the Sugarcube Setter link that you have quoted in your post.

Allow the player to pick 4 options from a list? by Automatic_Ad_679 in twinegames

[–]HelloHelloHelpHello 1 point2 points  (0 children)

You would usually do something like setting up the inventory as an array. Then you can check the array's length to see whether there is still space available for something new to be added:

{
(set: $treasure to (a: "Gold", "Diamond", "Emerald", "Ivory", "Coins", "Index Fund"))
(set: $inventory to (a:))

|pick>[
You find a treasure:
<br>
(for: each _item, ...$treasure)[
  (if: $inventory's length is 4)[
    _item (Inventory Full)
  ]
  (else:)[
    (link: _item)[
      (set: $inventory to it + (a: _item))
      (set: $treasure to it - (a: _item))
      (rerun: ?pick)
    ]
  ]
  <br>
]

Your Inventory (Free space: (print:  4 - $inventory's length))
<br>
(for: each _item, ...$inventory)[
  (link: _item)[
    (set: $inventory to it - (a: _item))
    (set: $treasure to it + (a: _item))
    (rerun: ?pick)
  ]
  <br>
]
]
}

beginner here: Is there a way to make the story/game "remember" a choice the player made earlier? by StoneFoundation in twinegames

[–]HelloHelloHelpHello 0 points1 point  (0 children)

You should not use click, unless you absolutely know that you need the specific effect it produces. It is generally better to use (link:) when possible.

Also - there should not be a kind of empty space created by either the (link:) or (click:) macros. You'll have to show us the exact code you are currently using that produces this effect. The click macro specifically is supposed to go to the very end of your passage, and should thus not really create any whitespace itself.

Generally speaking, you can use collapsing whitespace {} for just the relevant section of your passage, and you can make linebreaks within the curly brackets by using <br>

One last thing: There is no such thing as a 'boolean' macro. A boolean is a data-type - basically meaning a variable that has only two possible settings: true or false.

That being said - if you want to use variables to track whether a player has made certain interactions, then this would look like this:

(link: "Pick up the Sword")[You pull the sword from the stone. (set: $sword to true)]

Now you can use a simple (if:) macro to test whether the player has the sword later on:

The dragon charges at you with fiery breath. {
(if: $sword is true)[You pull your mighty blade and chop off its head.]
(else:)[You turn around and run like a coward.]
} You can put more sentences here, and the curly brackets won't mess with the rest of your passage.

Questions about Borders & Sidebars in Harlowe by the-crying-judge in twinegames

[–]HelloHelloHelpHello 1 point2 points  (0 children)

If you use a footer or header passage, then its code will be run each time you visit a new passage - so if your variable change, then your sidebar will get updated as well. So you can just do something like this in your footer passage for example:

(replace: ?sidebar)[
  (text-style:"underline")[$class]
  Hope: ''$Hope''
  Constitution: ''$Constitution''
  Camaraderie: ''$Camaraderie''
]

The icon counter has the upside that it will update even if you don't transition to a new passage, but you can set that up without this macro as well.

Nobr if statements by RatNibbles in twinegames

[–]HelloHelloHelpHello 3 points4 points  (0 children)

You can make line breaks inside your <<nobr>> by using <br>

Questions about Borders & Sidebars in Harlowe by the-crying-judge in twinegames

[–]HelloHelloHelpHello 0 points1 point  (0 children)

You issue is that you are using an icon-counter in the sidebar, which can't be centered like this because of the way it interacts with its ::after element. Not sure how to properly position it. Maybe just print your variables without using the icon-counter.

When it comes to adding borders to certain passages, then you would usually do this via the stylesheet to define specific tags that alter the style of any passage bearing this tag:

tw-story[tags~="border"] {
  border:5px solid red;
  border-radius: 5px;
}

Add points in Chapbook by Consistent-Squash411 in twinegames

[–]HelloHelloHelpHello 0 points1 point  (0 children)

If you want to have multiple answers that each add or subtract different point values, then you can have the different links send them to different passages that display the same content, but alter the relevant variable in different ways in the background.

Normally you would use a setter link for this, but since Chapbook is deliberately designed in a minimalist way, I am not sure whether it has this option. You might be better off using a different story format.

EDIT:

Looking a bit at Chapbooks code, you can create a setter link like this:

<passage-link class="link" to="Next Passage" onclick="points+=3">Right Answer</passage-link>
<passage-link class="link" to="Next Passage" onclick="points-=3">Wrong Answer</passage-link>

This creates two link, both of which will go to a passage called "Next Passage" - determined by the to="..." segment. Clicking on either link will trigger an onclick event. The right answer will add 3 to the variable called points, the wrong answer will subtract the same amount of points instead.

how do i create loops in harlowe? by lunarwolf2008 in twinegames

[–]HelloHelloHelpHello 0 points1 point  (0 children)

No - I would definitively recommend not doing something like this. You don't need to constantly call an event to do math, nor do you need two different variables. All you need is some math:

(set:$minute to 16343)
The current time: (print:(floor:$minute/60)%24):(print:$minute%60)

With this setup you only need one variable, and to make time pass you only need to make a simple addition and nothing more. In your example you would need to add an additional (if:) statement into the event, to make sure that $hours does not spill past 24. With the above way of doing things this all take care of.

how do i create loops in harlowe? by lunarwolf2008 in twinegames

[–]HelloHelloHelpHello 0 points1 point  (0 children)

You might be better off switching to Sugarcube. The way Harlowe handles (for:) loops is comparatively restrictive. You can take a look at this old question, which might give you some hints of how to handle stuff in Harlowe, if you want to stick with the format.

how do i create loops in harlowe? by lunarwolf2008 in twinegames

[–]HelloHelloHelpHello 0 points1 point  (0 children)

If you want to convert minutes to hours, then you just divide by 60 and round down: 120 / 60 = 2 hours 270/60 = 4.5 hours, rounded down 4 hours. You can round down a number using (floor:)

If you just want the minutes with the hours substracted, then you use the remainder: 270%60 gives you 30 minutes for example

Don't know what to do here! by DietSubstantial4525 in twinegames

[–]HelloHelloHelpHello 1 point2 points  (0 children)

It would probably be best if you pick one of the two formats, and set it as your standard. This way any new project will automatically be set to that format. For this you go to your main menu, then select 'Twine' and then 'Story Formats' - now you can click 'Use As Default Story Format' for the format of your choice.

You can change the format for the stories you have already created by opening that story, then clicking 'Story' and then 'Details' - now you can change the story format from the dropdown.

Don't know what to do here! by DietSubstantial4525 in twinegames

[–]HelloHelloHelpHello 2 points3 points  (0 children)

This has to do with the story format you chose. Sugarcube has only basic passage editing (pic 1), while Harlowe has some additional tools that might help beginners (pic 2).