VideoGamerCoolKid Posted July 17, 2018 Share Posted July 17, 2018 I'm trying to make a puzzle game with Twine, and I want to know something that requires a single line of code but have to learn the whole language to figure out what to do. Let's say that at some point the player gets an axe. I'd set a variable "axe" to 1. Then, later in the game, there's a tree in the player's way. I want to have it so that the option to chop down the tree only appears when the player has the axe. So, if "axe"=1, an option to cut the tree appears. I tried googling it but I couldn't find what I'm looking for. Also, let me know if my assumptions are completely wrong. If I don't get help, I'll have to take a stupid course just to do one thing. Quote Link to comment Share on other sites More sharing options...
mattstyles Posted August 2, 2018 Share Posted August 2, 2018 You're almost certainly best of asking this in the Twine forums (I think they also have a Discord channel) to find out how to do it in that platform. In general programming you're talking about applied logic, specifically you're after a conditional. As this is (primarily) a javascript board the following is a JS example: // Create a variable, we're also initialising it here because we are pros var axe = 1 // Conditional if (axe === 1) { // This is an example of a function call, it just does 'something' setOption('Cut down the tree with an axe') } // Here is another function call setOption('Punch the tree') http://twinery.org/cookbook/conditionalstatements/harlowe/harlowe_conditionalstatements.html Twine has its own syntax (three by the looks of it) for doing the same as the above, in fact, I'm not sure I've ever heard of a programming language that can not do it. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.