Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

New to Twine, building a dungeon crawl

I have been deciding between this or Inform 7 to make a fairly simple dungeon crawl. I will list some of the features and hope to get some advice/help/links that can help me. Twine definitely seems to be the easier to work with so I hope my features can be implemented

The Inventory would be fairly simple. maybe just track a few key items to be used for some metroidvania style elements such as you can only attack certain monsters by wearing a special ring but wearing the ring drains your energy/life. You need to wear iron boots for a switch but they restrict your actions otherwise ect.  so having to take off and put on items needs to be tracked as well as effects that progress each page. Advice on simple inventory and equipment manage would be great.

Random event
nothing major or complex. I just want to have some simple random scenes, add some freshness for when a player tries to play through to reach the other endings. This could also effect what order players get the equipment. so for example they defeat the first floor boss and the boss has a chance of dropping 1 of 3 of the key items

Combat
There are a few combat examples i have seen. so advice on what I should go with would be nice.

Comments

  • All right, so here's what I have that may help you.
    When you find a key item, you can use this code, but change the variable names. For example, if you had a red key-
    <<set $redkeyfound to "true">>
    And then when you come across the red door-
    <<if $redkeyfound is "true">> You unlock the red door.<<else>> You need the red key <<endif>>
    .

    I don't have much knowledge with random scenes, so wait for someone else.
    For combat, start the passage with
    <<set $hit to random(1, 100)>>
    Or you can change the 100 with a variable, or even multiple variables such as- <<set $hit to random(1, $dexterity * $strength)>> .
    After this, add the code
    <<if $hit >25>> You hit! <<set $enemyHealth to -=10>> <<endif>>
    <<if $hit <25>> You miss! <<endif>>
    Of course, you want to change around the numbers, add links to other passages, so on and so forth
  • right. I knew about the key one. but I am not talking about keys. I am talking about equipment you have to equip and unequip.

    Also how do create an examine passage so you examine an item. it gives you the items description and then you can continue from the last passage you were on.
  • I thought you said only a few key items? Key items are things vital to the story, not weapons. I have no idea where to go on that place. sorry.

    For an examine passage, though, you would want this-
    You have found a insertitemnamehere!
    [[Examine | Examine insertitemnamehere]].
    This should, if I'm right, Have an option that says examine, but leads to a passage titled Examine insertitemnamehere.
  • I'm currently playing with some RPG elements and alternative UI setups (CSS is my wheelhouse, and is really great for that), and I suspect that your features are quite doable, but will be more a matter of design that coding. Twine is a fantastic, easy to get into, and surprisingly versatile/extensible tool, but it's also damn quirky sometimes, and certain features may require careful thought (especially in regards to what order you want things done).

    Here are my thoughts on inventory:

    - Displaying a link to the inventory in every passage is probably a good way to go. The inventory itself, however, could be housed in a single passage. You can list them out with a fairly simple list of conditionals, or, alternatively, a bunch of arrays (slightly more advanced, but could be more elegant and flexible). It really depends on how many items you are looking to store, and how complex a system you're proposing. If you literally have a handful of available items in your whole game, as opposed to a whole heap of variable lootz (+3 Rare Dagger of Eternal Vigilance, etc.), and if you're just starting out, it might be easier, if more brutish, to just set up a bunch of conditionals/if statements.

    When you display the inventory, make sure to store the room/passage you are in a separate variable ($Current_Room for example), so that you can exit the "menu" passages with ease. You can do this using the previous() or passage() functions, depending on where you call it. If you have a particular item, you can display a list of options for that item (equip, unequip, examine) next to it, each one would be a link. Examine could take you to a special text passage (include a link back to inventory, of course), and the other two could reload the inventory passage, but use setter links to change values: [[equip| Inventory [$Head="helmet"]]]. Use conditionals to check if certain items are already equipped, and display them differently if so, maybe a different color. Use different variables to represent slots ($Head, $Body, $Right_Hand, etc.), and this should make checking for your equipment during battle and etc. relatively easy. If you've got a helmet on, add 3 to defense or whatnot, if you don't, defense is base level, etc.

    Basically, if you're making a dungeon crawler with any kinds of RPG elements in Twine, I suspect that you'll be using a whole ton of ifs and elses. 

    As for random encounter, I think the function you want is either(). It should work like this: <<set $Random_Encounter = either("happy troll", "angry spirits", "spike trap", "David Bowie");>>. That'll basically set $Random_Encounter to one of the choices you list, and then you can deal with those choices in a way that's most appropriate to you design (list of conditionals, simply pass it as a the destination for the next link, pass it along to a variable via setter link, etc.)

    I'm not amazing at explaining via text, but I think my main point is that your features are doable, and in essence should only require heavy use of variables and conditional statements, but planning out the actual implementation is going to be more challenging, and more important, than the coding, which may get cumbersome, but should never get extremely esoteric.
  • One trick - instead of using true/false values for items, you can use values 0-unheld, 1-held but not equipped 2-equipped (for example).

    Similar to what the previous poster said, you want to remember what room the player is in so they can go to the inventory passage from anywhere and then return.

    You may also want to (on your inventory page) make a passage for each item with a description, then links to equip/drop, and then link back to the inventory or to your current_room.

    You might want to have an $item_loc = 'cave' type variable for each thing, if you want to be able to drop things.  Set the current passage to that.  Then you could have a link in every passage to "check the floor" and if the $item_loc is is set to the current room, display it for pickup.
  • I used to make text adventure games in BASIC. My memories of it are fuzzy, but I think inventory items were based on arrays; $Object = ["Object", $Room], where "Room" is the location variable where it was located.

    The command to get things would change the property to the player object, indicating it was carried. If you dropped it, it would reassign it to the player object's location.

    Huh.

    I just remembered that I used to program text parsers in grade school. For fun.

    Totally forgot about that.
Sign In or Register to comment.