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,283
Reaction score
7,635
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,283
Reaction score
7,635
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

being able to transition music seamlessly is amazing. my main character's theme has lyrics and it goes from vocal version to istrumental when he leaves his room. and vice versa. and thanks to a plugin, the transition is seamless. I love it.
All of the auditions for our game are so good, I'm so glad I'm not in charge of choosing completely. lol I just can't with some of them. I listen to them on repeat. XD
Working on a Patch to integrate AlphaABS into random generated Dungeons. Was a bit tricky, but the outcome is a real Life Changer!!

Will release it the next days!
Been pretty busy... but I got a better headset for recording and listening today. Dad says that he'll consider taking me to Great Wolf Lodge for the first time once I finish summer classes (my final semester!) I'll be taking my plushie friends with me: Bendy, Lolbit, and Helen Henny. (I WUV PLUSHIES!)
SF_Monster3,4 added!

Forum statistics

Threads
105,651
Messages
1,015,304
Members
137,327
Latest member
Mezzy
Top