Preserved forum archive. This topic stores the original first post and locally mirrored RPG Maker Web attachments when available. It is posted by the BMMPlay archive account, not by the original creator.
Original Source
- Original title: Js-interpreter for MV
- Original author: SaphirAngel
- Original date: August 2, 2019
- Source thread: https://forums.rpgmakerweb.com/threads/js-interpreter-for-mv.111741/
- Source forum path: Game Development Engines > RPG Maker Javascript Plugins > JS Plugins In Development
Summary
Js-event for MV by SaphirAngel Alpha About:
Archived First Post
Js-event for MV
by SaphirAngel
Version
Alpha
About:
Hi, during test game development with RPG Maker MV.
I had the idea to write the events in pure js.
But, the RPG Maker Engine have a particular update loop who run step by step.
So, the purpose of this plugin is to offer the possibility of using a JavaScript interpreter that can run step by step : JS-Interpreter.
Features:
- js only events !!
- Write js in script command which will be run step by step
- Load external script file with plugin command : JSI filename
- JS-Interperter run in sandbox, so the commands must be rewritten but it offers the possibility to personalize and simplify their use.
Valid commands :
Transfered objects
- console
- $gameVariables, $gameSwitches, $gameMessage, $gameScreen
Variables
- __v(variableName) get a variable from $gameVariables
- __v(variableName, value) set a variable with value from $gameVariables
- __v(variableId) get a variable from $gameVariables
- __v(variableId, value) set a variable with value from $gameVariables
Switches
- __s(switchName) get a switch from $gameSwitches
- __s(switchName), value) set a switch with value from $gameSwitches
- __s(switchId) get a switch from $gameSwitches
- __s(switchId, value) set a switch with value from $gameSwitches
Dialog
- say("text", [position]) which will show text (position can be "top", "bottom", "middle")
- choice("text", ["choice_a", "choice_b", "choice_c"]) Show choice to user. Return an int which represent the selected choice position in array
Picture
- show({name: "yourpicturename"}) which will just show a picture (as show picture command).
- showWithDissolve({name: "yourpicturename"}) which will show a picture with 0.5s Dissolve
Additional Planned Features
- Add other commands
Update
2019-08-05
- Yeah ! I managed to wrap the rpg maker mv objects to the sandbox. Not big code but a little research (I'm not familiar with js-interpreter). So, i add code for wrap $gameVariables, $gameSwitches, $gameMessage and $gameScreen. (thanks to BrownBear2)
- I add console object too, debug is life.
License
Apache License 2.0 Terms of use and Credits
Commercial use allowed with a copy of license. (Free to use in any project)
Thanks to Neil Fraser for JS-Interpreter
No credit needed, just have fun.
Script exemple
Installation:
Add acorn_interpreter.js in libs folder
Add ScriptInterpreter.js in plugins folder
Include acorn_interpreter.js in index.html
Add ScriptInterpreter in Plugin Manager
Add script command with on first line, this comment : //@jsi
I do not know if it can be useful to others but as it is for me. Why not !
Enjoy
by SaphirAngel
Version
Alpha
About:
Hi, during test game development with RPG Maker MV.
I had the idea to write the events in pure js.
But, the RPG Maker Engine have a particular update loop who run step by step.
So, the purpose of this plugin is to offer the possibility of using a JavaScript interpreter that can run step by step : JS-Interpreter.
Features:
- js only events !!
- Write js in script command which will be run step by step
- Load external script file with plugin command : JSI filename
- JS-Interperter run in sandbox, so the commands must be rewritten but it offers the possibility to personalize and simplify their use.
Valid commands :
Transfered objects
- console
- $gameVariables, $gameSwitches, $gameMessage, $gameScreen
Variables
- __v(variableName) get a variable from $gameVariables
- __v(variableName, value) set a variable with value from $gameVariables
- __v(variableId) get a variable from $gameVariables
- __v(variableId, value) set a variable with value from $gameVariables
Switches
- __s(switchName) get a switch from $gameSwitches
- __s(switchName), value) set a switch with value from $gameSwitches
- __s(switchId) get a switch from $gameSwitches
- __s(switchId, value) set a switch with value from $gameSwitches
Dialog
- say("text", [position]) which will show text (position can be "top", "bottom", "middle")
- choice("text", ["choice_a", "choice_b", "choice_c"]) Show choice to user. Return an int which represent the selected choice position in array
Picture
- show({name: "yourpicturename"}) which will just show a picture (as show picture command).
- showWithDissolve({name: "yourpicturename"}) which will show a picture with 0.5s Dissolve
Additional Planned Features
- Add other commands
Update
2019-08-05
- Yeah ! I managed to wrap the rpg maker mv objects to the sandbox. Not big code but a little research (I'm not familiar with js-interpreter). So, i add code for wrap $gameVariables, $gameSwitches, $gameMessage and $gameScreen. (thanks to BrownBear2)
- I add console object too, debug is life.
License
Apache License 2.0 Terms of use and Credits
Commercial use allowed with a copy of license. (Free to use in any project)
Thanks to Neil Fraser for JS-Interpreter
No credit needed, just have fun.
Script exemple
Code:
//@jsi
var name = "Saphir";
// Set variable named Day to 12 (need to exist for test)
__v('Day', 12);
// Set switch 1 to false
__s(1, false);
// Print switch 1 value in console
debug(__s(1));
// Get variable named Day (need to exist for test)
var aGameVar = parseInt(__v('Day'));
// Show text at the bottom
say("Hello " + name);
// Show picture with 0.5s dissolve
showWithDissolve({name: "a_picture_name"});
// Show a choice for the player
var c = choice('Hi, what do you want ?', ['A candy', 'A water bottle', 'Nothing']);
switch (c) {
case 0: say("A candy, okay !"); break;
case 1: say("Sorry we don't have this :("); break;
default: say("Oooooh");
}
say("Thanks for this");
// Show picture with 0.5s dissolve
showWithDissolve({name: "a_other_picture_name"});
Installation:
Add acorn_interpreter.js in libs folder
Add ScriptInterpreter.js in plugins folder
Include acorn_interpreter.js in index.html
Add ScriptInterpreter in Plugin Manager
Add script command with on first line, this comment : //@jsi
I do not know if it can be useful to others but as it is for me. Why not !
Enjoy
Features Mentioned
- js only events !!
- Write js in script command which will be run step by step
- Load external script file with plugin command : JSI filename
- JS-Interperter run in sandbox, so the commands must be rewritten but it offers the possibility to personalize and simplify their use.
- Valid commands :
- Transfered objects
- console
- $gameVariables, $gameSwitches, $gameMessage, $gameScreen
- Variables
- __v(variableName) get a variable from $gameVariables
- __v(variableName, value) set a variable with value from $gameVariables
- __v(variableId) get a variable from $gameVariables
- __v(variableId, value) set a variable with value from $gameVariables
- Switches
- __s(switchName) get a switch from $gameSwitches
- __s(switchName), value) set a switch with value from $gameSwitches
- __s(switchId) get a switch from $gameSwitches
- __s(switchId, value) set a switch with value from $gameSwitches
Downloads / Referenced Files
Log in to download
Log in, then follow the RPG Maker Developers Group to see these download links.
Log in to downloadLicense / Terms Note
License Apache License 2.0 Terms of use and Credits Commercial use allowed with a copy of license. (Free to use in any project)
Creator Claims / Removal
If you are the original creator and want this listing reassigned, edited, or removed, join BMMPlay and contact the moderators with proof that matches the original RPG Maker Web profile, linked GitHub, itch.io page, or another public creator identity.
Replies (0)
No replies yet.
0
replies
1
view
Topic Summary
Loading summary...