• 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.
  • Reminder: AI-generated content is not allowed on the forums per the Rules and Regulations. Please contact us if you have any questions!
Mining Rig

v21.1 Mining Rig 3.0.0

This resource pertains to version 21.1 of Pokémon Essentials.
Pokémon Essentials Version
v21.1 ✅
Mining Rig script by RegalSword
Tested in Pokémon Essentials v21.
Note: a portion of the code uses BluMasc's Pokemon Adventures plugin as a reference.
Description:
This plugin is loosely based on the Electric Mining Rig from Arknights: Endfield.
What is customizable:
SWITCH_ID = 59 # Switch that controls mining rig activity (active/inactive)
ITEM = :BLUESHARD # Item that will be produced by the rig.
STEP_INTERVAL = 100 # Number of steps before an item is produced.
Instructions:
1) Design a mining spot. In my GIF I have a little 3x3 plot of land made using the default tileset.
2) Create an event that will call the relevant functions.
Here's how I made mine:
My event is size 3 x 3 and uses player touch as an event trigger. Whenever the player walks into the 3x3 zone, the event will trigger. Because it's easy to softlock the player, I made sure to add the move route commands 'turn 180 degrees' and 'move 1 step forward' to the very end of my event to ensure the player will always successfully leave the event the way they came.
A conditional branch checks if a mining rig is already placed. I simply check if a certain switch of choice (here I chose switch 59) is on or off.
I) If there is no mining rig placed, the player will be asked if they'd like to place a mining rig. Two outcomes are possible:
1) the player places a rig, then leaves.
Note: in this branch, you will have to "place" the rig somehow. In my case, I have a second event containing the graphic. This event is made visible or invisible through its self switch A.
2) the player leaves the site without doing anything.
II) If there is a rig placed, a message will appear saying "[machine] is hard at work extracting [item]!"
The player then receives three options.
1) Check progress
Here is where the script's functions finally come into play.
I recommend calling them in this order:
I) checkForNewPCItems
Will notify the player if new items have been deposited in the PC since the last time the player called this function.
II) showStepsUntilNextPCItem
Will report how many more steps the player has to take before the mining rig produces another item.
III) cheat_AdvancePCItemSteps (optional)
I place this one in a debug branch. It's mostly for debug purposes to test whether items are being added properly. As the name suggests, this will set step count to x - 1, so that taking one more step is enough to trigger the next payday (similar to how the instant hatch egg debug option in vanilla Essentials functions).
2) Remove rig
Hide the mining rig graphic (i use turn self switch a off) and turn the mining rig switch (in my case, 59) off.
3) Do nothing
Self-explanatory.
Note: as of right now, you have to add the above functionality manually. I may eventually incorporate these features into the script itself.
To make setting up the event easier, I have included an example map (Map031.rxdata) that contains the two events of interest "mining rig controller" and "mining rig graphic". However, this is a modified version of the Route 3 map included with default Essentials, so you will either have to replace that map or change the map ID before importing the map. Alternatively, you can look at the gallery where I have included a screenshot of how I set up the "mining rig controller" and "mining rig graphic" events.
Send me a message if you are confused as to how to get this plugin working, or if you have suggestions on how to make things better.
Gallery
Credits
RegalSword
BluMasc
  • Like
Reactions: DerxwnaKapsyla
Author
RegalSword
Downloads
6
Views
24
First release
Last update

Ratings

0.00 star(s) 0 ratings

More resources from RegalSword

Back
Top