What's new

RPG Maker VX Ace <Common event scripting>:


Frostleaf

Demon Girl
Joined
Jun 1, 2015
Messages
112
Reputation score
69
Ok after some trial and errors I finally found a way to get a common event to call a script function up.
Code1:
This goes in the common event that have to get triggered by something...
-Common Event insert-
Script:
<name here>

Code 2:
This is in an empty script page in script editor...
Script Editor:
class Game_Interpreter #It calls for the Game Interpreter command list so it can find what it needs for this script to work...
def <Name here>(target) #The Def is just definition of the name, (target) is the actors ID please make sure you have the actor id set to the player actor ID IDK what would happen if its set to other party members never really got into this much...
# The code1 is the in game common event script <Pls make a button map event or a key script to activate this common event in the data base. This way when its triggered it will then call up thy scripts data base and look for what ever that name is in " Def <Name here>(target)" and yes you can change only the "<Name here>" to what ever you want. Now below this "Def" on script that where you add the things you want your script to do. Code 3 will have an sample of it.

end
end


Code 3:
This is just an example of script data base:

The End!
 
Top