Skip to content

FL-/RMXP-FLUtil

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FLUtil

This script is for RPG Maker XP. It adds a lot of useful classes and methods for scripters:

  • RandomHelper who make doing things like raffle a lot easier. Recommended even for non-scripters.
  • Variable Switches Alias, who makes switch/variable access shorter and more readable
  • Tween system
  • Multiversion/non-essentials layer (partial)
  • Misc classes and methods

Works with or without Essentials. Partially works as PSDK plugin (only RandomHelper, Variable Switches Alias and Tween).

Download

Installation

  • For Essentials version 19 and above, follow FL's Essentials plugin installation instructions.
  • For PSDK, generate a psdkplug file.
  • For others (non-Essentials and Essentials below version 19), copy and paste the .rb files in FLUtil folder into script sections above main, in order. You can skip the last (only with test stuff for me).

How to Use

Look at 001_Main Notes.rb for instructions.

Examples:

Examples are based in Essentials, but most works in a vanilla RPG Maker XP project.

RandomHelper

helper = ItemRandomHelper.new
helper.add(60, :POTION) 
helper.add(30, :ANTIDOTE)
helper.add(10, :ETHER)
pbItemBall(helper.get)

Variable Switches Alias

Original code to remove an apricorn:

$bag.remove(pbGet(8))
data = GameData::Item.get(pbGet(8))
pbSet(3, data.name)

With this script:

$bag.remove($gv[:APRICORN_DELIVERED])
data = GameData::Item.get($gv[:APRICORN_DELIVERED])
$gv[:TEMP_PKMN_NAME] = data.name

Or

$bag.remove($gv[8])
data = GameData::Item.get($gv[8])
$gv[3] = data.name

Tweener

All movements in this gif were made in sample scene. The first Marill's movement was made with this code:

# Move Marill to (x:Graphics.width/2 and y:64) in 1.5s.
@tweener.add(MoveTween.new(@sprites["Marill"], Graphics.width/2, 64, 1.5))

EsBridge

# Display message in all Essentials versions
EsBridge.message("Message here")
# Returns frame delta. Works with or without MKXP-Z
EsBridge.delta
# Returns item name in all Essentials, and even in base RPG Maker XP (but you should use a number as parameter)
EsBridge.item_name(:POTION)

Misc Util

# Random value from range
(2..5).random
# Access Color rbga like an Array
some_color[1] = 200
# Lerp between two tones (for mixing). Below example means 80% red and 20% blue
Tone.lerp(Tone.new(255,0,0), Tone.new(0,0,255), 0.8)
# Format Time from seconds. This code will returns "01:01:40"
FLUtil.format_time_from_seconds(3700)
# Returns all player pokémon (including party, boxes and Day Care)
FLUtil.all_player_pokemon
# Change all deoxys forms in party to +1. Go to 0 after last
FLUtil.swap_species_form(:DEOXYS)
# Returns if the item is in the bag, pc or hold in any pokémon 
FLUtil.has_item_at_bag_or_pc_or_hold?(:POTION)

About

Adds a lot of useful classes and methods to RPG Maker XP.

Topics

Resources

License

Stars

Watchers

Forks

Languages