Howdy, Stranger!

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

Random Damage

Using the set up outlined here, is there a way to make the player and the enemy's damage output random instead of a set number?


  • You should always state the story format you're using and its version, because advice will tend to vary based on that information.

    You posted this in the Help! with 1.x category (meaning Twine 1), however, the reddit thread you linked is for Harlowe (only available for Twine 2). Thus, you either posted this in the wrong category or that reddit thread is going to be less directly helpful than you may have been hoping.

    For the moment, I'm going to assume that you are using Harlowe and posted to the wrong category. I'm also going to assume that you're using Harlowe v1, since you didn't specify a version.

    You may use something like the following, which uses the (random:) macro (v1 doc) to generate a random number in the range 510:
    (set: $ehp to it - (random: 5, 10))
    You may set the min and max values to whatever you want.
  • You need to state the name and full version number of the story format you are using, as answers can be different for each one. Based on the linked example I will assume you are using Harlowe, I will also assume you are using v1.2.3 as it's the default for Twine 2.1.1

    You can use the (random: ) macro to generate a random value for any of the relevant variables used in that linked example.

    (set: $atkdmg to (random: 20,30))
  • Sorry about that.

    It is v1.2.3 and moving the eatk string solved my other problem. Thank you.
Sign In or Register to comment.