• Hi, Guest!
    Some images might be missing as we move away from using embedded images, sorry for the mess!
    From now on, you'll be required to use a third party to host images. You can learn how to add images here, and if your thread is missing images you can request them here.
    Do not use Discord to host any images you post, these links expire quickly!
Astralneko's Trivia Script (PEv19.1, PEv20.1)

v20.1 Astralneko's Trivia Script (PEv19.1, PEv20.1) 1.0.0

This resource pertains to version 20.1 of Pokémon Essentials.
Pokémon Essentials Version
v20.1 ➖
So I wanted to make a trivia minigame for my fangame, and realized it'd be far easier to just edit a PBS-like file whenever I wanted to add more questions. These are the fruits of my labor, and I figured I'd share this with the world.

NOTE: This plugin was made for v19.1. There is no separate version for v19.1 vs v20.1, as none of the functions used don't work in v20.1, and it has been tested there to confirm this. Essentials may get mad at you because the plugin "may not work with Essentials v20", but it will.

NOTE 2: Due to updates to the translation module in v21, this plugin will not work in v21. Click here for that one: Astralneko's Trivia for v21

Accordingly, my other resource is not required for this plugin to work, as nothing is saved to the save file. If this changes in a future version, then it will be noted.

  • Download the plugin with the above link.
  • Follow the instructions in the README file.
  • Hold CTRL when playtesting Essentials next, to ensure everything compiles correctly.
Trivia questions are created in default_trivia.txt. There are example questions in there, to show what the plugin can do. Feel free to delete any existing questions and replace them.

A question is constructed using three values:
  • Id: The ID value of the question. Usually it should be a shorthand for the gist of the question.
  • Question: The question itself. Write it as you would write a Show Message command. This will be translated by Essentials's translation plugin, and will be in section 200 of intl.txt. The example questions will require Mr. Gela's animated Portraits and Name Windows to work correctly (they use \xn), but this plugin doesn't require that one.
  • Answer: An answer to the above question. The first answer listed will be the "correct" answer, while the next 1 or more will be incorrect answers. Don't worry about this, because in the example functions, the answers displayed to the player will be shuffled around. Like questions, answers will be translated and will appear in section 201 of intl.txt.
These are then compiled by Essentials at runtime.
This plugin comes with two example functions:
Ruby:
anTriviaQuestion(id)
id is the value you placed in the Id field above.

Ruby:
anTriviaQuestionToNPC(id,npc_name)
npc_name is the name of the character in question. You may wish to use Astralneko's Miscellaneous Scripts to fill npc_name with a random one from the plugin - just call the function with anRandomName in place of npc_name.

Both functions return true if the answer given is correct, and false if the answer given is incorrect. Run these scripts in your event or other code to ask the player questions!
You may wish to call on how the player answered earlier in the plugin, in which case you should use the following code:
Ruby:
pbSet(1,anTriviaQuestion(id) ? 1 : 0)
This will set game variable 1 to 0 if the answer is incorrect, and 1 if the answer is correct. You can then use these values in a Conditional Branch to manipulate event processing.

If you're using this in a trivia game, you may also replace 1 and 0 with score values and use a Set Variable script to keep track of score, like so:
Screenshot 2023-01-03 200651.png
Credits
Astralnekomimi
Author
Astralneko
Downloads
250
Views
1,841
First release
Last update
Rating
0.00 star(s) 0 ratings

More resources from Astralneko

Latest updates

  1. v21 version released!

    Essentials v21 broke the v19-20.1 version of the plugin, so a new version has been released! It...
Back
Top