Scriptlets V2.0.1

This is Scriptlets. It is a database of Script Calls in a similar vain of how Common Events work. it was created to be able to shrink down and organize code that
sometimes gets out of hand or too long. some of its uses include shortening down damage formulas and other plugins note-tags, and having code run via
Auto-run or a Parallel Process.

Features
  • The ability to create and store an infinite number of Scriptlets inside the plugin parameters
  • The ability to run large amounts of code in small amounts of characters.
  • The ability to have code run when the game boots up.
  • The ability to run code as a parallel process or auto-run loop.
How to Use
most of the plugin is set up in the parameters. simply create a Scriptlet, add an item to the list and fill out the parameters. some of the parameters are.
– Name: Mainly for organization, not required to be filled in.
  • – Script: The Meat and Potatoes of the script. put js in here and watch it run(or crash)
  • – Type: The type of Scriptlet it will be, there is currently 4 types of Scriptlets.
    *Note: all Scriptlets can also be run using a Script Call or Plugin Command,
    regardless of what type of Scriptlet it is.

    • Normal: A normal Scriptlet. Will not run unless specifically called for.
    • Initialize: This Scriptlet will run at the start of the game(The Creation of the Boot Scene)
    • Parallel: This Scriptlet will run once a frame while in map or in battle.
    • Autorun: Similar to the Parallel but will lock down the game instead of working in the background *Deprecated V2.0.0
      *new*
    • Close – this will run when the game window is closed, currently only works for Desktop Versions of RPG Maker *Deprecated V2.0.0
  • Condition: this is a bit of js that runs to check whether or not this Scriptlet will run.
To run a Scriptlet. you can choose one of two ways. one way is to do a Script Call. to do this simply run this in a script box or anywhere else that accepts Js.
$js.run(id, arguments)
the other way to run Scriptlets is via a plugin Command. to do so just type this into a plugin command.
RunScriptlet id arguments
you can now use Escape Codes in text boxes and such! to use it now use
/js[id,args]
*new*

Action Sequences are now supported. type the following as an action sequence to call the scriptlet

SCRIPTLET ID: ARGUMENTS
*new*

Notetag scriptlets is the newest addition! in an attempt to make scriptlets less plugin dependant, you can now have scriptlets activate on certain events. here is a list of them here

 onLevelUp
 arguments: actor
 activates when an actor levels up.

 onVictory
 arguments: actor
 activates when the actor wins a battle.

 onDefeat
 arguments: actor
 activates when the actor loses a battle.

 onEscapeSuccess
 arguments: actor
 activates when the actor escapes a battle.

 onEscapeFailure
 arguments: actor
 activates when the actor fails to escape a battle

 onLearnedSkill
 arguments: actor, skillId
 activates when the actor learns a skill.

 onNameChanged
 arguments: actor, name
 activates when an actors name is changed

 onNicknameChanged
 arguments: actor, nickname
 activates when an actors nickname is changed

 onChangeEquip
 arguments: actor, slotId, item
 activates when an actor changes their equipment

 onChangeClass
 arguments: actor, classId, keepExp
 activates when an actor changes their class

 onAttack
 arguments: actor
 activates when the actor attacks

 ~actor,class,weapons,armor,states, or enemy~

 onStateAdded
 arguments: battler, stateId;
 is activated whenever the battler gets afflicted with a status effect

 onStateRemoved
 arguments: battler, stateId
 is activated whenever the battler removes a status effect.

 onBuffAdded
 arguments: battler, paramId
 is activated whenever the battler receives a buff

 onDebuffAdded
 arguments: battler, paramId
 is activated whenever the battler receives a debuff

 onBuffRemoved
 arguments: battler, paramId
 is activated whenever the battler gets a buff removed

 onRevival
 arguments: battler
 is activated when the battler is revived from death.

 onHpGain
 arguments: battler, value
 is activated whenever the battler gains or loses hp.

 onHpSet
 arguments: battler, value
 is activated whenever the battler’s hp changes. 

 onMpGain
 arguments: battler, value
 is activated whenever the battler gains or loses Mp.

 onMpSet
 arguments: battler, value
 is activated whenever the battler’s Mp changes. 

 onTpGain
 arguments: battler, value
 is activated whenever the battler gains or loses Tp.

 onTpSet
 arguments: battler, value
 is activated whenever the battler’s Tp changes. 

 onRecoverAll
 arguments: battler
 is activated whenever the battler gets fully recovered.

 onRegenerate
 arguments: battler 
 is activated whenever the battler goes into their regenerate phase

 onDamage
 arguments: battler, value
 is activated whenever the battler takes damage. 
 
 onBattleStart
 arguments: battler
 is activated when the battler is part of the battle start

 onBattleEnd
 arguments: battler
 is activated when the battler is part of the battle end.
 (applies to dead enemies and actors as well)

 onActionStart
 arguments: battler, action
 is activated when the battler begins an action (item/skill)

 onActionEnd
 arguments: battler
 is activated when the battler finishes an action (item/skill)

 onTurnStart
 arguments: battler
 is activated when the turn starts

 onTurnEnd
 arguments: battler
 is activated when the turn ends 

 onItemUsed
 arguments: battler, item
 is activated when an item is used

 onMiss
 arguments: battler
 is activated when an action is missed

 onEvasion
 arguments: battler
 is activated when a physical skill is evaded

 onMagicEvasion
 arguments: battler
 is activated when a magic skill is evaded

 onCounter 
 arguments: battler
 is activated when a physical skill is countered

 onReflection
 arguments: battler
 is activated when a magical skill is countered
FAQ
Q: How do I call arguments?
A: simply use this
args[x]
just make sure that x is equal to the argument number. remember, id is also an argument

Credit and Thanks
  • Pivoo
  • SumRndmDude & LTN Games for helping me solve a few bugs!
  • Kino and Waynee95 for helping with Closing Scriptlets Types (no longer a feature)
  • Thanks To Olivia for helping with The 2.0.1 Patch!

Change-log
  •  V2.0.1
    • fixed bug with Level Up Scriptlet happening when actor changes class.
  •  V2.0.0
    • Deprecated Closing and Auto-run Scriptlets
    • Rewrote code to work for Pivoo-Utility V2.0
    • Added Action Sequence Support for Scriptlets
    • Added Arguments for Escape character Scriptlets
    • Added error reporting for Escape Characters
    • Added a new Scriptlet type, notetag Scriptlets
    • Added 37 note-tag Scriptlets
  •  V1.1.2
    • cleaned up a-lot of code
    • changed Condition from an evaluation to an anonymous function
    • changed how Type Scriptlets are handled to help reduce lag with alot of scriptlets loaded
  • V1.1.1
    • fixed a few bugs with Escape Character Scriptlets
  • V1.1.0
    • added Close Type Scriptlets
    • added Escape Character Support
    • added args[x] to replace arguments[0][x]
    • shifted the index of Scriptlets up by one, as well as making Scriptlet # 0 return null

Leave a Reply

Your email address will not be published. Required fields are marked *