Alador

Captain Cute
Veteran
Joined
Apr 16, 2020
Messages
205
Reaction score
237
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
778
Reaction score
631
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,463
Reaction score
14,816
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
778
Reaction score
631
First Language
English
Primarily Uses
RMMV
I stand corrected!
 

Latest Threads

Latest Profile Posts

i want to make videogame, though i am burned out on games with RPG elements, but the only gamedev tool i know how to use is rpg maker. :/
Rakon wrote on xizorandy's profile.
Hello! I found a post of lightning strike pictures you posted. You said you made them, am I allowed to use them in my commercial project. Would be really cool!^^
evhht2zr.png

Have a nice day!
It's almost 3 month and this piece of drawing is still not finished yet.
aaaa.jpg

Really busy with other stuffs like commission and coping with personal problem.
Stella & Elyune, maybe used for promotional art if my game project finished one day.
My ex put my heart upon a self he said don't give me no lines and keep my hands to myself :,(

Forum statistics

Threads
112,251
Messages
1,066,827
Members
145,857
Latest member
DooDoo42
Top