Is there a way to import an events script from a file?
How do I pull a script from a file?
RPG Maker MZ Supportnot 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...
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...
So you have to use the in engine script editor? (I have MZ)
Not really, you can do something like that:
save your scripts as plugins and execute them from game, by calling them from script editor.
Code:
lotOfStuff = function(){
$gameParty.leader().changeLevel(99);
$gameParty.gainGold(99999);
}
@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.
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.
Then no, events are stored in JSON files of maps, wich they are JavaScript Object Notation
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
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
},
In short. Map you are painting in rpg maker and edit events are stored as sample code above
Thanks a lot! This helps.
Original thread: https://forums.rpgmakerweb.com/threads/how-do-i-pull-a-script-from-a-file.129408/