- Joined
- Mar 23, 2017
- Messages
- 4,125
- Reaction score
- 10,639
- First Language
- Czech
- Primarily Uses
- RMMV
Description of the Feature:
Just as the thread suggests. I'm still surprised it actually hasn't been implemented yet, since conditional branch has it. And I don't think I'm the only one who would appreciate this.
The thing is, as it is now, if we want to activate an event based on some weird condition, for example if the party leader is dead, we need a workaround for it, for example a parallel process event that tracks if the hero is dead and turns a switch on or off accodingly.
Having a Script condition would simplify that a lot.
Code for Implementation:
in the rpg_objects:
Mockups:
I made the script window too small, but whatever, the principle is the same.
Why is this feature good?
This feature is great because of the following:
Possible issues with this feature?
Issues that might arise from this feature:
Just as the thread suggests. I'm still surprised it actually hasn't been implemented yet, since conditional branch has it. And I don't think I'm the only one who would appreciate this.
The thing is, as it is now, if we want to activate an event based on some weird condition, for example if the party leader is dead, we need a workaround for it, for example a parallel process event that tracks if the hero is dead and turns a switch on or off accodingly.
Having a Script condition would simplify that a lot.
Code for Implementation:
in the rpg_objects:
Code:
Game_Event.prototype.meetsConditions = function(page) {
var c = page.conditions;
if (c.switch1Valid) {
if (!$gameSwitches.value(c.switch1Id)) {
return false;
}
}
if (c.switch2Valid) {
if (!$gameSwitches.value(c.switch2Id)) {
return false;
}
}
if (c.variableValid) {
if ($gameVariables.value(c.variableId) < c.variableValue) {
return false;
}
}
if (c.selfSwitchValid) {
var key = [this._mapId, this._eventId, c.selfSwitchCh];
if ($gameSelfSwitches.value(key) !== true) {
return false;
}
}
if (c.itemValid) {
var item = $dataItems[c.itemId];
if (!$gameParty.hasItem(item)) {
return false;
}
}
if (c.actorValid) {
var actor = $gameActors.actor(c.actorId);
if (!$gameParty.members().contains(actor)) {
return false;
}
}
if (c.scriptValid) {
if (!eval (c.scriptValue)) {
return false;
}
}
return true;
Mockups:
I made the script window too small, but whatever, the principle is the same.
Why is this feature good?
This feature is great because of the following:
- Puppies will be happy (and me too
)
- User friendliness
- It is easy to implement
- Adds versatility to eventing and improves performance, because it won't require 3rd party plugins or other workarounds that waste precious processing power
Possible issues with this feature?
Issues that might arise from this feature:
- Some 3rd party plugins that use custom conditions might become a bit redundant
- The page editor space might be cramped

