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
Installation
- Download the psdkplugin, throw it in your project's script folder
- Run the game
Credits
How to use
RandomHelper
RandomHelper provides several helper classes allowing to select an option randomly with custom weights.
The default helper is RandomHelper and accepts any kind of values. Example:
helper = RandomHelper.new
helper.add(50, "SomeString")
helper.add(25, 6)
helper.add(25, :some_symbol)
value = helper.get # => 50% "SomeString"; 25% 6; 25% :some_symbolYou can use a RandomHelper for items:
helper = ItemRandomHelper.new
helper.add(60, :potion)
helper.add(30, :antidote)
helper.add(10, :ether)
give_item(helper.get, 1) # => 60% chance getting potion; 30% getting antidote; 10% getting etherYou can use a RandomHelper for Creatures:
helper = PokemonRandomHelper.new
helper.add(50, :pikachu)
helper.add(50, :meowth)
add_pokemon(helper.get, 5) # => 50% chance getting Pikachu; 50% getting MeowthNote: ItemRandomHelper and PokemonRandomHelper will actively check if the dbSymbol of the entity you're trying to randomize actually exists in Game Data. If it doesn't, the game will crash (unless you catch it).
Variable Switches Alias
Utility classes allowing you to defined Aliases for Switches or Variables.
Alias for switches
In a script, you can add the following code:
$gs = SwitchesAlias.new({
alias1: 36,
alias2: 58
})This allows you to pull the value from Switch 36 using $gs[:alias1] and pull the value from Switch 58 using $gs[:alias2].
Of course, you can also assign Switch state, example: $gs[:alias1] = true
Alias for variables
In a script, you can add the following code:
$gv = VariablesAlias.new({
aliasForSomething: 899,
elite4BeatCount: 556
})This allows you to pull the value for Variable 899 using $gv[:aliasForSomething] and pull the value from Variable 556 using $gv[:elite4BeatCount].
Of course, you can also update Variable value, example: $gv[:elite4BeatCount] += 1
Note: Unlike RMXP or Essentials, PSDK variables are only accepting Integers. If you need to store any other sort of data, please use the standard variable $user_data for that.
Tweener
The tweener utility is a nice alternative to Yuki::Animation, take a look on the official documentation to understand how it's used: https://github.com/FL-/RMXP-FLUtil?tab=readme-ov-file#tweener