Idea:
Sometimes a complex event might need additional data that can't be stored in the database directly. In the case of scripts that is where notetags were often used, but there currently is no way to access notetags from events.
This script should give the developer that option by using a script call that transfers notetag data into switches and variables.
Examples:
A common event might load an enemy number from a map notetag and disable random encounters after that number of battles
A map event needs to check if the main actor has the gender-tag <male> or <female> in the notebox before proceeding
An event's battleprocessing needs to check if the selected troop (by variable) has special effects
Details:
It should be a number of script calls that check and return different values to switches and/or variables.
Some of them will require a specific format, others should enable checks for any notetag to allow checking for notetags that are for different scripts.
The script calls should enable checking different object type, either by giving an object itself or by using different functions for different objects.
Object type: Read data from
Map: Map Notebox (active map or map ID)
Map Event: comment box (on active page only)
Tileset: Tileset Notebox (active tileset or tileset ID)
Class, Skill, Item, Weapon, Armor, State: corresponding notebox by ID
Actor: Actor notebox by ID
Actor special: combined noteboxes of actor plus equipments by actor ID
Enemy: Enemy notebox by ID
Troop: comment box (on first troop event only, by ID)
Notebox format:
This format might be rewritten if the scripter has better ideas.
<custom values>Maplevel: 7Mapencounters: 20Surprise: OFFCrafting: OFF</custom values>
Error-check:
In all cases, the function should return true if the notetag exists and false if not - this can be stored in a switch for later checks.
In the case of custom values, the data received if the notetag exists should be stored inside the switch/variable whose ID was given.
Function names are examples to describe what should happen, may be redefined by scripter if needed - for example if the functions need to be split on different functions or if additional data needs to be given (tag for object kind and object-ID for example)
1) Check for general notetag (independent, might work with any notetag from any script):
$game_switches[check-ID]=notetag_present(object, 'notetagstring')
Examples:
notetag_present(currentmap,'<lock parallax x>')
When using Yanfly's parallax-lock script, this would detect if the map has that notetag to change other options in addition to yanfly's script function.
2) Check for custom switch value:
$game_switches[check-ID]=custom_switch(object, 'namestring', Switch-ID)
Example:
$game_switches[99]=custom_switch($game_party.members[0], 'Crafting', 100)
Stores into switch ID 100 the result of the custom value 'Crafting' to allow or forbid accessing the crafting event depending on who leads the party (if the custom values are places in the actor notetags)
3) Check for custom variable value:
$game_switches[check-ID]=custom_variable(object, 'namestring', Variable-ID)
Example:
$game_switches[99]=custom_variable(currentmap, 'Mapencounters', 81)
Stores into variable 81 after how many battles the event should do something (if the battles are counted with other commands)
For compatibility reasons I would like the scripter to add completely new functions to the Game interpreter to achieve this.
All examples above (function names, notetag format) might be rewritten if that makes it easier for the scripter.
For example the functions might be rewritten to
custom_variable
key, ID, 'namestring', Var-ID)
where key can be something like :actor or :weapon or so and the ID then identifies the exact object.
That might even be better usable by non-scripters who don't know the script names for the game objects.
Sometimes a complex event might need additional data that can't be stored in the database directly. In the case of scripts that is where notetags were often used, but there currently is no way to access notetags from events.
This script should give the developer that option by using a script call that transfers notetag data into switches and variables.
Examples:
A common event might load an enemy number from a map notetag and disable random encounters after that number of battles
A map event needs to check if the main actor has the gender-tag <male> or <female> in the notebox before proceeding
An event's battleprocessing needs to check if the selected troop (by variable) has special effects
Details:
It should be a number of script calls that check and return different values to switches and/or variables.
Some of them will require a specific format, others should enable checks for any notetag to allow checking for notetags that are for different scripts.
The script calls should enable checking different object type, either by giving an object itself or by using different functions for different objects.
Object type: Read data from
Map: Map Notebox (active map or map ID)
Map Event: comment box (on active page only)
Tileset: Tileset Notebox (active tileset or tileset ID)
Class, Skill, Item, Weapon, Armor, State: corresponding notebox by ID
Actor: Actor notebox by ID
Actor special: combined noteboxes of actor plus equipments by actor ID
Enemy: Enemy notebox by ID
Troop: comment box (on first troop event only, by ID)
Notebox format:
This format might be rewritten if the scripter has better ideas.
<custom values>Maplevel: 7Mapencounters: 20Surprise: OFFCrafting: OFF</custom values>
Error-check:
In all cases, the function should return true if the notetag exists and false if not - this can be stored in a switch for later checks.
In the case of custom values, the data received if the notetag exists should be stored inside the switch/variable whose ID was given.
Function names are examples to describe what should happen, may be redefined by scripter if needed - for example if the functions need to be split on different functions or if additional data needs to be given (tag for object kind and object-ID for example)
1) Check for general notetag (independent, might work with any notetag from any script):
$game_switches[check-ID]=notetag_present(object, 'notetagstring')
Examples:
notetag_present(currentmap,'<lock parallax x>')
When using Yanfly's parallax-lock script, this would detect if the map has that notetag to change other options in addition to yanfly's script function.
2) Check for custom switch value:
$game_switches[check-ID]=custom_switch(object, 'namestring', Switch-ID)
Example:
$game_switches[99]=custom_switch($game_party.members[0], 'Crafting', 100)
Stores into switch ID 100 the result of the custom value 'Crafting' to allow or forbid accessing the crafting event depending on who leads the party (if the custom values are places in the actor notetags)
3) Check for custom variable value:
$game_switches[check-ID]=custom_variable(object, 'namestring', Variable-ID)
Example:
$game_switches[99]=custom_variable(currentmap, 'Mapencounters', 81)
Stores into variable 81 after how many battles the event should do something (if the battles are counted with other commands)
For compatibility reasons I would like the scripter to add completely new functions to the Game interpreter to achieve this.
All examples above (function names, notetag format) might be rewritten if that makes it easier for the scripter.
For example the functions might be rewritten to
custom_variable
where key can be something like :actor or :weapon or so and the ID then identifies the exact object.
That might even be better usable by non-scripters who don't know the script names for the game objects.


