Plugin Command in Events - variable argument

It's possible to send a global variable as a argument using plugin command in the event editor?


For instance, if I want to send the integer value from the game variable 2 to the function, how can I do it? I tried $gameVariables.value(2) and parseInt($gameVariables.value(2)) as part of the argument, but didnt work. 
you need to parse the arguments of the plugin command when you process it, and that does not work in the same way as eval.


Your idea/example would work if you're doing it as a script command, but the plugin command needs a different handling.


A better idea would probably be to just transfer the variable's ID, and have the value inside the variable retrieved by the plugin when processing that command.


This assumes that you're talking of a plugin that you're writing yourself - if you want to use that idea in an existing plugin written by someone else, you'll need a modification or rewrite of that plugin.
Hmmm, understood. I knew that I could've just get the variable from the ID directly by the script, but didn't want to change the script. Anyway, I changed here, and it worked. Thanks for the fast reply 😀  

Original thread: https://forums.rpgmakerweb.com/threads/plugin-command-in-events-variable-argument.74172/