Howdy, Stranger!

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

How do i make achievments!

Hi im making a game and really want to put achievments in it but i dont know how, i want to make it so when people do something or reach a passage they earn and achievment and can go to an achievment page and see what they got.(it doesnt need to tell them they got it but it can)

I use harlowe 1.2.2

Comments

  • You can use variables to track which achievements a player has earned.

    1. Initialise the variables within your story's startup tagged passage.
    You can name the variables whatever you like.
    (set: $achievementA to false)
    (set: $achievementB to false)
    (set: $achievementC to false)
    

    2. Change the related variable's value to true when the player achieve the achievement.
    (set: $achievementB to true)
    

    3. Use an (if:) macro to check which achievements the player has obtained.
    (if: $achievementA)[You have Achievement A]
    (if: $achievementB)[You have Achievement B]
    (if: $achievementC)[You have Achievement C]
    
  • greyelf wrote: »
    You can use variables to track which achievements a player has earned.

    1. Initialise the variables within your story's startup tagged passage.
    You can name the variables whatever you like.
    (set: $achievementA to false)
    (set: $achievementB to false)
    (set: $achievementC to false)
    

    2. Change the related variable's value to true when the player achieve the achievement.
    (set: $achievementB to true)
    

    3. Use an (if:) macro to check which achievements the player has obtained.
    (if: $achievementA)[You have Achievement A]
    (if: $achievementB)[You have Achievement B]
    (if: $achievementC)[You have Achievement C]
    

    Whats the startup tag
  • Whats the startup tag

    Had you visited the link, you'd know that the tag is called... "startup", and all passages with that tag will be run at... "startup".
  • Whats the startup tag

    Had you visited the link, you'd know that the tag is called... "startup", and all passages with that tag will be run at... "startup".

    Sorry im new to this how do you give a tag to a passage
  • edited August 2016
    Now its appearing with:


    (if:)'s 1st value is the number 0, but should be a boolean.►
    If you gave a number, you may instead want to check that the number is not 0. If you gave a string, you may instead want to check that the string is not "".
  • Sorry im new to this how do you give a tag to a passage
    If you look at the Reference section of the Twine 2 Guide you will see a link to the Editing Passages page which explains about Changing a passage's tags.
    (if:)'s 1st value is the number 0, but should be a boolean.►
    If you look at my previous examples you will see that the variables used Boolean values of true and false, and that I initialised the variables to false before the story/game started. Any variable that is not initialised by you will be automatically assign a value of zero.
  • rather than a startup tag which produces a bit of lag you could do this as well
    status:(if: $achievementA is 1)[Achieved] (else:)[Locked]
    status:(if: $achievementB is 1)[Achieved] (else:)[Locked]
    status:(if: $achievementC is 1)[Achieved] (else:)[Locked]
    and then like greyelf said, in a certain passage
    (set: $achievementA to 1)
    basically removing booleans
Sign In or Register to comment.