Logic Gadgets: Score

Icon
Name of gadget Score
Section Gameplay Gear
Number of Tweak pages 1
Author LadylexUK, QuietlyWrong
Last updated 6 June 2019 [v1.02 EA]

Description

This gadget is used in combination with the Score Modifier gadget. The value saved in this gadget can be used to populate the scoreboard which can only be activated if you place your level within a Dream. The score can be a number or a time. Its value might also be shown on screen using a Number Displayer for example.

You can have multiple score gadgets in a level – be sure to give them unique names so they can be distinguished by the Score Modifier! In this way, you might use one for an actual score and another for in-game currency or an ammunition count.

 

Example Tutorial (adapted from Media Molecule)

  1. Stamp a microchip
  2. Add a score gadget to it
  3. Add a score modifier to it
  4. Rename the score gadget as “Final score”
  5. Add “Final score” to the name field on the score modifier.
  6. Set operation type to add in the score modifier
  7. Add a controller sensor to the chip
  8. Set it to remote controllable
  9. Connect the square output to the power port of the score modifier. This will increase our score by 1 everytime you press the square button.
  10. Add a timer to the chip.
  11. Change the timer target to 10 seconds.
  12. Change it to countdown.
  13. Connect the timer finished (pulse) to post score on the score gadget.
  14. Add a second timer.
  15. Connect the first ones timer finished (pulse) to start timer on the new one.
  16. Make the target time 0.5 seconds.
  17. Add a doorway to the chip
  18. Connect timer finished (pulse) on the new timer to the power port on the doorway. This will end the game 0.5 seconds after you post the score to the scoreboard.
  19. Add 2 number displayers to the chip
  20. On the score gadget connect current score to the number/range input of displayer 1
  21. Move number displayer 1 to display in the middle of the screen
  22. On the original timer connect current time to the number/range of number displayer 2
  23. Set the display format to time and enable show milliseconds.
  24. Quick save the level
  25. Save the level online as private
  26. Exit to the dreamiverse and create a Dream
  27. Search for your saved level and add it
  28. Save the Dream online as private
  29. Play the Dream by pressing the square button as many times as you can before the timer runs out.
  30. Your score will be added to a scoreboard after you do this the first time.

 

Tweak Menus

  1. Initial Score
  2. Current Score
    2b. Output
  3. Multiplayer
    3a. Input
    3b. Output
  4. Score Increased
    4b. Output
  5. Score Decreased
    5b. Output
  6. Post Score
    6a. Input
  7. Power
  1. Initial Score
    Use this slider to set the initial score that a player will start with. Notice there are no inputs or outputs here – it’s not a value you would expect to change or read during a game.
  2. Current Score
    This output provides the current numeric score – wire it into any other logic you want to be dependent on the score, or perhaps just a Number Displayer gadget.
  3. Multiplayer
    Toggle this option to assert whether (if on) the scoring is separate for each player in a multiplayer game, or (if off) shared.
  4. Score Increased
    This outputs a brief signal every time the score is increased. You might use this perhaps to play a sound effect or animate sparkles over the score display.
  5. Score Decreased
    This outputs a brief signal every time the score is decreased. You might use this to play a less-than-enthusiastic sound effect at this point (assuming low scores are worse than high scores here).
  6. Post Score
    Sending an input to this tweak will cause the player’s score to be uploaded to the Dream’s scoreboard! Best saved for the end of a game, perhaps as part of the exit/restart logic.
  7. Power
    This is where you can turn the gadget on/off.

Lex Tips

Although you can use the score gadget as your main score display if you attach a number displayer to it, what you cannot do is pass that number through a level link. So I recommend having your score in a persistent variable for purposes of display and any player levelling code you may have and pass that to the score gadget through a modifier so you have the same number in two separate gadgets – one variable and one score. The persistent variable will maintain scores through level links and pass that to the modifier which in turn will change the score. The score does not need to be only created at the point of game end, and can happily tick up without passing any of that information anywhere throught the game, only to post the score when prompted.

Useful Tutorials

How to implement a scoreboard

Beginners Guide to Scoreboards

Version Updates

v1.02  (6 Jun 2019) Added LexTips and Useful Tutorial Links.

Comments and Feedback

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Blog at WordPress.com.

Up ↑

%d bloggers like this: