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,504
Reaction score
14,842
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,904
Reaction score
8,245
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

I always end up having issues with things i'd never expect.

Capture.PNG

Those friggin mountains man xD
Time for my daily walk/jog ''Literally starts raining while I open the door''
I just discovered there's a giant jellyfish in the Ace RTP. My day is made.
I'm pretty sure I submitted a username change like 4 months ago.
...
No offense but uh, still waiting for my name to be updated :/

Forum statistics

Threads
112,398
Messages
1,068,036
Members
146,048
Latest member
Sergibo
Top