Alador

Captain Cute
Veteran
Joined
Apr 16, 2020
Messages
205
Reaction score
241
First Language
English
Primarily Uses
RMMV
JavaScript:
CopyTiles 1 1 'layout' $gameVariables.value(6) 1 ($gameVariables.value(6) += 15) 11
returns the error "Invalid or unexpected token." How can I get this to use the incremented variable without returning an error message?
 

Restart

Veteran
Veteran
Joined
Mar 15, 2019
Messages
797
Reaction score
642
First Language
English
Primarily Uses
RMMV
JavaScript:
CopyTiles 1 1 'layout' $gameVariables.value(6) 1 ($gameVariables.value(6) += 15) 11
returns the error "Invalid or unexpected token." How can I get this to use the incremented variable without returning an error message?
use a script call instead of a plugin command - plugin commands don't evaluate inputs (so it is trying to read the text string '$gameVariables.value(6)' instead of the value of game variable 6.)

Code:
changeTile(1,1,'layout', $gameVariables.value(6), 1, ($gameVariables.value(6) += 15), 11)
should probably work
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
42,522
Reaction score
14,846
First Language
English
Primarily Uses
RMMV
plugin commands don't evaluate inputs

this one does, but

($gameVariables.value(6) += 15)
this isn't valid. The plugin uses spaces to delimit terms, not parentheses. And what is the += for? That's an assignment operator and shouldn't be used here at all. If you want to increment the value, do it either before or after the plugin command. If you just want that value plus 15, get rid of the =.


All arguments can be script commands that will be evaluated - make sure there are no spaces anywhere within the individual arguments/script commands.

Change it to
Code:
$gameVariables.value(6)+15
(with no spaces)
 
Last edited:

Restart

Veteran
Veteran
Joined
Mar 15, 2019
Messages
797
Reaction score
642
First Language
English
Primarily Uses
RMMV
I stand corrected!
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
32,921
Reaction score
8,255
First Language
German
Primarily Uses
RMMV
@patternBlue I doubt that would work because that editor uses a different tileset structure
 

Latest Threads

Latest Posts

Latest Profile Posts

For a long time I always consider XP soundtracks as the best one.
Just listened to some of MZ tracks from the free version.
It's... Quite mindblowing. xD
Only listened to the battles, towns, and fields.
But I'm sure the rest are equally good. :D
What do you guys want to see for the new Jump into Javascript? A continuation of the rpg_objects, or would you prefer a "lesson 0" where I go back to the absolute basics of Javascript and cover the fundamentals of the language and its construction?
Hey RPG members!!

How do you finish projects? Some new game developers start off strong but end up losing momentum. What keeps you motivated while working on new projects?
Feeling wee sleepy.. ZzzZ
So many threads to move to the right place. My post count is awesome, but 95% of it is due to moving things.

Forum statistics

Threads
112,454
Messages
1,068,394
Members
146,110
Latest member
xxsampahxx
Top