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,293
Reaction score
7,637
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,293
Reaction score
7,637
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 Posts

Latest Profile Posts

Evil7 added!


I did a bit of a remake on one of the maps, also I made a particle for jumping into the portal, and one for traveling through the portal. I'll probably add more sparkles later to embellish it. :LZSwink:
Polished the animation and added details :kaojoy:
Ami
What do you think about the Wood Bridge inside of Volcano?
Yet another gaming question, i'm currently playing Last of Us 2 and want to get another game to play next but can't decide between Ghost of Tsushima, Miles Morales & Jedi Fallen Order. After the latest mandalorian i AM on a star wars kick, but i also LOVED the last spiderman game that prequels Miles Morales. Ghost of Tsushima is the bottom of my list but i heard it was AWESOME. Just want a good story & fun gameplay.

Forum statistics

Threads
105,686
Messages
1,015,538
Members
137,362
Latest member
sdramose
Top