RPG Maker Forums

Description of the Feature:
  • In event pages conditions, getting a Script feature instead of/in addition to the second Switch option. Doing so would add more versatility to events and the ability to directly call plugin JS functions.

Code for Implementation:
A script variable to the page events should be added, and the meetsConditions function of Game_Event should be altered as well.

Code:
Game_Event.prototype.meetsConditions = function(page) {
    var c = page.conditions;
    if (c.switch1Valid) {
        if (!$gameSwitches.value(c.switch1Id)) {
            return false;
        }
    }
    if (c.script) {
        if (!eval(c.script)) {
            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;
        }
    }
    return true;
};


Mockups:


Why is this feature good?
This feature is great because of the following:
  • Better conditions in events, including several variables/switches at once through && or || operators
  • Ability to overcome the editor limits through a single textbox.

Possible issues with this feature?
Issues that might arise from this feature:
  • If removal of one of the switch option, it would force users to use a script to have two switches. It is not really difficult, but I understand some users might not want to use scripts. Of course they would be welcome to ask on the forums how this works.

Latest Threads

Latest Posts

Latest Profile Posts

People3_5 and People3_8 added!

so hopefully tomorrow i get to go home from the hospital i've been here for 5 days already and it's driving me mad. I miss my family like crazy but at least I get to use my own toiletries and my own clothes. My mom is coming to visit soon i can't wait to see her cause i miss her the most. :kaojoy:
Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.

Forum statistics

Threads
105,868
Messages
1,017,088
Members
137,585
Latest member
Reversinator
Top