FANDOM


EventsEdit

This folder ("rpgjs/Data/Events/[Map01]") contains the javascript event files ("EV001.json", etc.). An event file is an object with two elements properties and pages.

Events must be loaded when the corresponding map is loaded.

Example:

[
    {
        "x": 16,
        "y": 7,
        "id": "1",
        "name": "EV001"
    },
    [
        {
            "character_hue": "041-Mage09.png",
            "pattern": 0,
            "trigger": "action_button",
            "direction": "bottom",
            "frequence": 16,
            "type": "fixed",
            "through": false,
            "stop_animation": false,
            "no_animation": false,
            "direction_fix": false,
            "alwaysOnTop": false,
            "speed": 4,
            "commands": [
                "SHOW_TEXT: {'text': '%PASS%'}"
            ]
        },
        {
            "conditions": {"switches": [10]},
            "character_hue": "041-Mage09.png",
            "pattern": 0,
            "trigger": "action_button",
            "direction": "bottom",
            "frequence": 16,
            "type": "fixed",
            "through": false,
            "stop_animation": false,
            "no_animation": false,
            "direction_fix": false,
            "alwaysOnTop": false,
            "speed": 4,
            "commands": [
                "SHOW_TEXT: {'text': '%GIVE_ME%'}",
	        "CHANGE_GOLD: 15",
		"SHOW_TEXT: {'text': '%YOU_LOSE%'}",
		"SHOW_ANIMATION: {'name': 'SP Recovery 2'}",
		"SELF_SWITCH_ON: 'A'"
            ]
        }
    ]
]

propertiesEdit

Assigns values to the properties of an event.

  • x {Integer}: X Position of the event on the map.
  • y {Integer}: Y Position of the event on the map.
  • id {String} (optional): Event ID (e.g. for "getEventById()"). If not specified ID is assigned randomly.
  • name {String}: Event name.

pagesEdit

Multiple pages of an event separated by semicolon containing event. Each page can be executed separately.

  • conditions {Object} (optional): Conditions required for this page to be executed.
    • switches {Array}: Required active switch with given ID.
    • self_switch {String}: Required active local switch with given name.
  • character_hue {String}: Path to event sprite.
  • pattern:
  • trigger {String}: action_button|contact|auto Trigger conditions for this event.
  • direction {String}: up|right|bottom|left Direction the event is facing.
  • frequence {Integer}: Animation frequency.
  • through {Boolean}: States if event is passable.
  • stop_animation {Boolean}: States if animation for this event is stopped.
  • no_animation {Boolean}: States if animation for this event is deactivated.
  • direction_fix {Boolean}: States if facing direction of this event is fixed.
  • alwaysOnTop {Boolean}: States if event is always above hero level.
  • speed {Integer}: Movement speed of this event.
  • commands {Object}: commands for execution after event has been triggered.

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.