Murakui

Warper
Member
Joined
May 1, 2019
Messages
2
Reaction score
3
First Language
German
Primarily Uses
RMMV
Hello Guys,

i needed to build a plugin to start one common event parallel, when a map is loaded.
When you need something similar you can download the plugin or see how it works in the spoiler.

Code:
//=============================================================================
// MURA_RunParalell.js v1
//=============================================================================
"use strict";
var Imported = Imported || {};
Imported.MURA_RunParalell = true;

var Murakui = Murakui || {};
Murakui.RunParalell = Murakui.RunParalell || {};

//=============================================================================
// Plugin Parameters
//=============================================================================
/*:
 * @plugindesc process one common event anytime
 * @author murakui
 *
 * @param Event ID
 * @desc 1-9999
 * @default 1
 *
 * @help This plugin runs one of the common events globally at any map.
 *
 * Please select one common event that contains the trigger: 'Paralell'
 * and select a switch.
 *
 * When the map is loaded the gameengine updates the switch to true,
 * that will trigger the common event permanently as long the game is running.
 *
 */
(function ($rp) {

    $rp.parameters = PluginManager.parameters('MURA_RunParalell');
    $rp.eventId = $rp.parameters['Event ID'];

    Game_CommonEvent.prototype.isActive = function () {
        $rp.changeSwitchForEvent(this.event());
        return $rp.isTriggerParalell(this.event().trigger) && $rp.isSwitchOn(this.event().switchId);
    };
 
    $rp.changeSwitchForEvent = function (event) {
        if (!$rp.isSwitchOn(event.switchId) && $rp.isEventIdEqual(event.id)) {
            $rp.setSwitch(event.switchId, true);
        };
    };

    $rp.isSwitchOn = function (switchId) {
        return $gameSwitches.value(switchId);
    };

    $rp.isTriggerParalell = function (trigger) {
        return trigger == 2;
    };

    $rp.isEventIdEqual = function (eventId) {
        return $rp.eventId == eventId;
    }

    $rp.setSwitch = function (switchId, bool) {
        $gameSwitches.setValue(switchId, bool);
    }

})(Murakui.RunParalell);

regards,
Mura

Terms of Use: Can be used freely.
 

Attachments

  • MURA_RunParalell.js
    1.9 KB · Views: 11
Last edited:

Latest Threads

Latest Posts

Latest Profile Posts

Jeez...
I finally decide, after several ppl asking me to, to create a gamethread about project M... And my internet craps out on me halfway through the process :(
making my first game is like trying to stuff all my experience with old games into one
so its slow and painful when i dont get it right... i bet the next game is gonna be finished earlier!
When you don't find any time to work... :kaocry:
First Ten Minutes of my Caretaker inspired game

Finally, I got a good Gmail message [from smg5urded]
"This game does look a bit plain, but, I'm sure this does not destroy the experience as a whole. Monsters fit your style of game-play, mapping looks crude but I'm sure you can make it better if you do a remake of Forgotten Eclipse"

Forum statistics

Threads
110,397
Messages
1,052,966
Members
143,456
Latest member
DavishKK
Top