[XP] Simple Plant Growing System for RMX-OS

Started by MOAL, December 30, 2014, 07:08:29 am

Previous topic - Next topic

MOAL

December 30, 2014, 07:08:29 am Last Edit: December 30, 2014, 08:25:19 am by MOAL
I just put this together really quickly but I've tested and it works, plants grow as long as somebody is on the map otherwise is paused until someone enters, then continues where it was left off. But anyone can take whatever grows and plant more plants themselves. Each planting spot needs its own global variable depending on how many spaces you want to grow stuff. Thankfully, you can copy and paste the event en masse and just change the variable to a different one. Due to an error that occurs when you put text on an event while having global switches and variables installed, you cannot put text otherwise it will crash when there's someone else on the game map as the one activating it.

Note: In this tutorial, since the event lacks a graphic for the first page, it will be able to be walked on even if Through isn't checked. So you will have to stand on top of the event and press the action button to trigger it instead of being in front of it.

Requires: RMX-OS, and Global Switches and Variables.

1.
Spoiler: ShowHide
Make a new event that is triggered using the action button, then insert a Control Variables command, select a variable that you've set to be global and set it to 0 (Operation: set. Operand: Constant 0) so that the variable is now set to 0. Set a conditional branch if [seed] is in inventory, change items [seed] -1 to remove it from the inventory, then add another Control Variables command to now set the variable to 1.


2.
Spoiler: ShowHide
Make a new event page, parallel process with the conditions that the variable is set to 1 or above. Now add a wait command with your desired number of frames, and add a Control Variables command to set the variable to 2. Copy this event page and duplicate it to only change the variable to be set to 3 on this page, then do the same for however many more pages you want. Add a seedling graphic and the rest of its stages after the first step, be sure to keep the first event page graphic cleared.


3.
Spoiler: ShowHide
To end the event and make the plant able to be harvested, make a new event page triggered with the action button and set that the variable must be the # of the final stage, in this case, I used 4. For the event commands list, add a change items command and have it add the resulting item to the inventory, then a final Control Variables command and have it set the variable back to 0. This allows it to reset the growing area so another plant can be grown.


There you have it. Hopefully someone finds this helpful.