Correlation Javascript <-> Event - Questions

Kayokensa

Warper
Member
Joined
Feb 7, 2016
Messages
4
Reaction score
6
First Language
German
Primarily Uses
Hello RPG and Coding-fans,


So I acquired RPGM MV and I have mediocre skills in scripting events in RPGMMV and javascript. I couldn't quite grasp the correlation and I have some questions about that. Sorry if wrong category. What I got so far as a plugin.js :

var commands = Game_Interpreter.prototype.pluginCommand;

Game_Interpreter.prototype.pluginCommand = function(command, args)
{
commands.call(this, command, args);

if(command == 'aCommandTriggeredByEvent')
{
anotherCommand();
}
}



Now the following questions:

  • I want to control the movement of the character in the plugin. Do I need to copy-pasta the entire Game_CharacterBase.prototype or is there a way so I can do something like 

  • Game_CharacterBase.prototype.moveStraight(2); //2 for down


    in the anotherCommand()

  • The bit parameter Game_Map.prototype.checkPassage = function(x, y, bit) (the Help-page doenst say anything about the expected value of a parameter) ? -> the implementation into my plugin is kinda related to the first question.

  • Is it possible to create a if-clause in the event-scripting which evaluates to true/false returned by a plugin? If so, where (I guess -> Tab 4 script) and how (pluginCommand() ?)



Thanks in Advance
 
Last edited by a moderator:

Kino

EIS Game Dev
Veteran
Joined
Nov 27, 2015
Messages
556
Reaction score
794
First Language
English
Primarily Uses
RMMV
So, just a question, but what's  the goal of the  plugin? Because,  there a script calls you can use in an event page to do things like moving a character I believe.


Things like $gameActors, $gameVariables  contain methods to do  things such as movement or editing player hp.


But  to answer other questions.


Yes  you  can do if else inside  an event page via scripts. You could make  your plugin return or store a value in a gameVariable ($gameVariables).


I'd have to look at Game_CharacterBase, but  I can say it's  probably used by another  class in the  code. Other than that, you can copy and paste  the entire  prototype for your own use, but you'd  need to alias it  if you  plan to make changes to it. If you want  to  use the commands, you don't  need to copy and paste it anywhere; you can use it on any Game_CharacterBase instance, or anything  that inherits from that class.


Hope this helps in someway; not near my computer  unfortunately. Will edit later to be more descriptive on Game_CharacterBase.
 

Kayokensa

Warper
Member
Joined
Feb 7, 2016
Messages
4
Reaction score
6
First Language
German
Primarily Uses
Hi,


I already found the solution to my problems.


Most things are accessed via the global variables like


$gamePlayer.moveStraight(2)


makes the player move a tile downward.


Checking passable with something like


$gameMap.passable


etc.


I found the sweet Call script document which helped me.


For now, I don't think the entire CharacterBase is needed, but the goal of the plugin will be like an interface to a more flexible way to gain control over the characters without filling pages of commonevents, because somehow events feel kinda restricted if not thought out entirely.


But thanks anyhow :)  
 

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

Latest Threads

Latest Posts

Latest Profile Posts

How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c
So I was playing with filters and this looked interesting...

Versus the normal look...

Kind of gives a very different feel. :LZSexcite:
To whom ever person or persons who re-did the DS/DS+ asset packs for MV (as in, they are all 48x48, and not just x2 the pixel scale) .... THANK-YOU!!!!!!!!! XwwwwX

Forum statistics

Threads
105,849
Messages
1,016,981
Members
137,563
Latest member
cexojow
Top