How do I pull a script from a file?

MyInfo

Warper
Member
Joined
Nov 1, 2020
Messages
3
Reaction score
0
First Language
English
Primarily Uses
RMMZ
Is there a way to import an events script from a file?
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,252
Reaction score
7,629
First Language
German
Primarily Uses
RMMV
not really.

and please note that "script" is a term that has a lot of meanings, and in the RPG-Makers it is usually used for something that has nothing to do with events and event code - it's used for script commands and scripts in either Javascript (MV and MZ) or Ruby/RGGS (older makers).

Using this term for event code will cause confusions...
 

MyInfo

Warper
Member
Joined
Nov 1, 2020
Messages
3
Reaction score
0
First Language
English
Primarily Uses
RMMZ
So you have to use the in engine script editor? (I have MZ)
 

Soulrender

Jack Of All Trades
Veteran
Joined
Jan 12, 2019
Messages
836
Reaction score
466
First Language
Poland
Primarily Uses
RMMV
Not really, you can do something like that:
Code:
lotOfStuff = function(){
$gameParty.leader().changeLevel(99);
$gameParty.gainGold(99999);
}
save your scripts as plugins and execute them from game, by calling them from script editor.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,252
Reaction score
7,629
First Language
German
Primarily Uses
RMMV
@Soulrender
the OP has no script code at all, he called a sequence of event commands written alsewhere a script.
That is why I added the description what a script is for this community to my post.
 

Soulrender

Jack Of All Trades
Veteran
Joined
Jan 12, 2019
Messages
836
Reaction score
466
First Language
Poland
Primarily Uses
RMMV
Then no, events are stored in JSON files of maps, wich they are JavaScript Object Notation
JSON:
{
            "id": 9,
            "name": "Warp to Section 1-1e",
            "note": "",
            "pages": [
                {
                    "conditions": {
                        "actorId": 1,
                        "actorValid": false,
                        "itemId": 1,
                        "itemValid": false,
                        "selfSwitchCh": "A",
                        "selfSwitchValid": false,
                        "switch1Id": 1,
                        "switch1Valid": false,
                        "switch2Id": 1,
                        "switch2Valid": false,
                        "variableId": 1,
                        "variableValid": false,
                        "variableValue": 0
                    },
                    "directionFix": false,
                    "image": {
                        "characterIndex": 0,
                        "characterName": "",
                        "direction": 2,
                        "pattern": 0,
                        "tileId": 0
                    },
                    "list": [
                        {
                            "code": 108,
                            "indent": 0,
                            "parameters": [
                                "<activation column: 0>"
                            ]
                        },
                        {
                            "code": 201,
                            "indent": 0,
                            "parameters": [
                                0,
                                18,
                                0,
                                7,
                                0,
                                0
                            ]
                        },
                        {
                            "code": 205,
                            "indent": 0,
                            "parameters": [
                                -1,
                                {
                                    "list": [
                                        {
                                            "code": 3,
                                            "indent": null
                                        },
                                        {
                                            "code": 3,
                                            "indent": null
                                        },
                                        {
                                            "code": 0
                                        }
                                    ],
                                    "repeat": false,
                                    "skippable": false,
                                    "wait": false
                                }
                            ]
                        },
                        {
                            "code": 505,
                            "indent": 0,
                            "parameters": [
                                {
                                    "code": 3,
                                    "indent": null
                                }
                            ]
                        },
                        {
                            "code": 505,
                            "indent": 0,
                            "parameters": [
                                {
                                    "code": 3,
                                    "indent": null
                                }
                            ]
                        },
                        {
                            "code": 0,
                            "indent": 0,
                            "parameters": []
                        }
                    ],
                    "moveFrequency": 3,
                    "moveRoute": {
                        "list": [
                            {
                                "code": 0,
                                "parameters": []
                            }
                        ],
                        "repeat": true,
                        "skippable": false,
                        "wait": false
                    },
                    "moveSpeed": 3,
                    "moveType": 0,
                    "priorityType": 0,
                    "stepAnime": false,
                    "through": false,
                    "trigger": 1,
                    "walkAnime": true
                }
            ],
            "x": 19,
            "y": 8
        },
and via those values and parameters are passed to game interpreter and thus code from rpg_*.js files are executed.

In short. Map you are painting in rpg maker and edit events are stored as sample code above
 

MyInfo

Warper
Member
Joined
Nov 1, 2020
Messages
3
Reaction score
0
First Language
English
Primarily Uses
RMMZ
Not really, you can do something like that:
Code:
lotOfStuff = function(){
$gameParty.leader().changeLevel(99);
$gameParty.gainGold(99999);
}
save your scripts as plugins and execute them from game, by calling them from script editor.
Thanks a lot! This helps.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

Once again working on a game I'm not sure I'm going to sell or even publish
That feel when you're awake past midnight and suddenly you're one year older :ninja:
I miss collaborations, but I don't know how to find someone to make face parts just to share them with others, and even though I don't like writing or music, I can't trust anyone with writing on my game because it has themes that are easy to mess up, and music needs a clear tone and scenes.
People donating to me for my upcoming birthday so I can pay my team a little. Such angels, I'm so happy. T uT I smile so much my face hurts. Good souls in this world.
Playing Ragnarok Online again is very nostalgic. The last time I played it was 20 years ago, when I was ten-twelve old.
My first mmorpg.^^

Forum statistics

Threads
105,571
Messages
1,014,723
Members
137,245
Latest member
dashstop
Top