Tips and Tricks Tutorial Ver.

Archeia

Level 99 Demi-fiend
Developer
Joined
Mar 1, 2012
Messages
15,109
Reaction score
15,412
First Language
Filipino
Primarily Uses
RMMZ
This topic is to teach people some nifty Tips and Tricks that helps speed up development in a Quality of Life kind of way. You can add your own as well. I'll start with a few examples. All discussions go here.

Saving Memory A
Do you have too many facesets and preloading too much into memory and sometimes they still get delayed? You can stack them like this and still be usable in the editor. Just try to keep it under the height of 1024 to avoid loading issues:

upload_2018-6-28_15-19-41.png

Saving Memory B

How to Setup Teleport/Transfer Locations with just One Event
Normally, you copy and paste numerous events that teleport to different locations or use a parallel process to check regions to know when and where to teleport/transfer your player. Here's a more effective way to do it:

- Use a Plugin that can modify Event Hitboxes. Event Hitbox Resize by @Yanfly, Big Events by @Shaz or Orange Event Hitboxes by @Hudell will do the trick.

- Create a single event and give it the event notetag property based on which Plugin you are using. If you have a map with 5 tiles long to teleport to another location, then give your event either:

Shaz's Plugin:
Code:
<bigEvent: 5x1>
Hudell's Plugin:
Code:
<hitboxWidth:5>
- Grab the x,y based of the tiles you are interested in.
upload_2018-6-28_15-6-59.png

- Add a conditional branch inside that event using the Script Function. We'll be using the following Script Call:
Code:
($gamePlayer.pos(x, y))
It should end up looking like this:
upload_2018-6-28_15-8-37.png

This tutorial doesn't just apply to Teleport/Transfer. It has multiple uses depending on your needs!

My game runs at 120FPS! (Works only in RMMV 1.6.1)
Go and open your project folder/package.json
Make it look like this:
Code:
{
    "name": "",
    "main": "index.html",
    "js-flags": "--expose-gc ",
    "window": {
        "title": "",
        "toolbar": false,
        "width": 816,
        "height": 624,
        "icon": "icon/icon.png"
    },
    "chromium-args": "--limit-fps=60"
}

Disable Window Resizing
Add the propery resizable in package.json.
Code:
{
    "name": "",
    "main": "index.html",
    "js-flags": "--expose-gc ",
    "window": {
        "title": "",
        "toolbar": false,
        "width": 816,
        "height": 624,
        "icon": "icon/icon.png",
        "resizable": false
    }
}
 
Last edited:

ozubon

surströmming?
Veteran
Joined
Oct 16, 2018
Messages
178
Reaction score
168
First Language
English
Primarily Uses
RMMV
How to use strings as variables
There are times you want to store data other than numbers into variables. The string can be any text you want. In this example, I'll store an ingredient for a soup and then check if it's added through a conditional branch.

It's very simple: In control variables, I set a variable to the operand Script and then type the name inside quotation marks.



Now variable 11 is set to Onion instead of a number.

And now let's make something happen if it is!
I make a conditional branch and go to page 4 and in the script option I type $gameVariables.value(11) == "Onion"



This script checks if variable 11 is Onion. :ywink:

So to sum it up:
1. Set a variable with Script to "your text here"
2. In conditional branch you can check with Script $gameVariables.value(ID) == "your text here"
 

Archeia

Level 99 Demi-fiend
Developer
Joined
Mar 1, 2012
Messages
15,109
Reaction score
15,412
First Language
Filipino
Primarily Uses
RMMZ
Spend less time searching for events tip
So, this is just a simple QoL I did for myself while game devving. Sometimes, just putting all your initialize code on the top left isn't enough. Maybe you have to use an empty map for reasons unknown and have 0 visual cues on what's going on. Or even when you do, you have a lot of events that you transform via code or whatsoever with no pictures on them strewn across the map and you don't remember what they're for. There can be a lot of reasons!

Here's a template of what I do to workaround this and how they will appear in editor.


There's two ways you can hide the event markers. Either you make the first page empty and put the 2nd page as the start of your content, events put the latter pages as priority if they don't have conditions, like this:
upload_2019-2-16_6-17-47.png

Alternatively, create a new JS file. In my case I called it SpaghettiCode.js and then add the following snippet. Replace DEV_TEST with the filename of your event marker image. Make sure to activate it in your plugin manager!

Code:
//=============================================================================
// * Hide Event Markers
//=============================================================================
var Archeia = Archeia || {};
Archeia.Game_CharacterBase_isTransparent = Game_CharacterBase.prototype.isTransparent;
Game_CharacterBase.prototype.isTransparent = function() {
    if (this.characterName() === 'DEV_TEST') return true;
    return Archeia.Game_CharacterBase_isTransparent.call(this);;
};
 
Last edited:

Burgerland

Veteran
Veteran
Joined
Sep 26, 2015
Messages
327
Reaction score
88
First Language
English
Primarily Uses
N/A
How to measure time in frames
Since 60 frames = 1 second, you can use frames to count seconds. Create a new Event, go to second page of Event Commands, under Timing on the right hand side of the page is the command Wait. Depending on the duration you want, here's how to convert frames into units of time measurement. It's multiples of 60.

1 second = 60 frames
5 seconds = 300 frames
10 seconds = 600 frames
30 seconds = 1800 frames
1 minute (60 seconds) = 3600 frames
5 minutes = 18000 frames
10 minutes = 36000 frames
30 minutes = 108000 frames
1 hour (60 minutes) = 216000 frames
5 hours = 1080000 frames
10 hours = 2160000 frames
1 day (24 hours) = 5184000 frames
1 week (7 days) = 36288000 frames
1 month (4 weeks) = 145152000 frames
6 months = 870912000 frames
1 year (12 months) = 1741824000 frames

Since the maximum frames for Wait is 999, I recommend using 900 frames per Wait for any time over 10 seconds after dividing the duration you want by 900 to see how many Wait Commands you need. Below is the selfsame list with the number of Wait Commands for each duration when you divide the desired Wait frames by 900.

60 - 600 frames (1 second - 10 seconds) = 1 Wait Command
1800 frames (30 seconds) = 2 Wait Commands
3600 frames (1 minute) = 3 Wait Commands
18000 frames (5 minutes) = 20 Wait Commands
36000 frames (10 minutes) = 40 Wait Commands
108000 frames (30 minutes) = 120 Wait Commands
216000 frames (1 hour) = 240 Wait Commands
1080000 frames (5 hours) = 1200 Wait Commands
2160000 frames (10 hours) = 2400 Wait Commands
5184000 frames (1 day) = 5760 Wait Commands
36288000 frames (1 week) = 40320 Wait Commands
145152000 frames (1 month) = 161280 Wait Commands
870912000 frames (6 months) = 967680 Wait Commands
1741824000 frames (1 year) = 1935360 Wait Commands
 

WickedWolfy

Touch Fluffy Tail!
Veteran
Joined
Nov 27, 2017
Messages
114
Reaction score
49
First Language
En
Primarily Uses
RMMZ
Alternatively, create a new JS file. In my case I called it SpaghettiCode.js and then add the following snippet. Replace DEV_TEST with the filename of your event marker image. Make sure to activate it in your plugin manager!
Great idea!

A simper way might be to replace the the colored "DEV TEST" icons file with a blank/transparent file before publishing in the file system. Do name the file starting with "_" or "z" to place them on top or on the bottom of the file list to find easily and signify an important or test file.
IMPORTANT: Some folks might be tempted to just delete the file... That would generate an error at load-time of the map.
This way you have less JavaScruipt doing not-important work.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

aero the acrobat 2 on sega had some absolute bangers on the ost... why Meeting Dr. Dis was just for a cutscene and not a boss makes me sad lol
"I want custom, more lively looking grass for my forest map."

"Just set overworld grass as outside grass."

--RM Wisdom--
Any thoughts on my hexagon map system?
Idk where this post would go, so how do you change the font of the choice selection window? I have a different font for the game so it looks a little odd could someone tell me where this would go on the forum?
RPG Maker MZ demo -project with some new features:

Forum statistics

Threads
104,619
Messages
1,007,627
Members
136,095
Latest member
loomer_
Top