• Do not use Discord to host any images you post, these links expire quickly! You can learn how to add images to your posts here.
  • Eevee Expo's webhost has been having technical issues since Nov. 20th and you might be unable to connect to our site. Staff are also facing issues connecting, so please send a DM to Cat on-site or through Discord directly for faster service!
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:
Expand Collapse Copy
anTriviaQuestion(id)
id is the value you placed in the Id field above.

Ruby:
Expand Collapse Copy
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:
Expand Collapse Copy
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
334
Views
1,914
First release
Last update

Ratings

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