Cannot use Variable as Event ID

MoloRid3r

Villager
Member
Joined
Jan 15, 2017
Messages
24
Reaction score
1
First Language
Thai
Primarily Uses
Did i do something wrong?
Code:
$game_map.events[$game_variables[48]].animation_id = 115
Error :

Ps. Variable no.48 = 10 (event no.10)
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
29,068
Reaction score
6,698
First Language
German
Primarily Uses
RMMV
Please post a screenshot of the command in the event - I strongly suspect that you have a space there where it doesn't belong, and automatically corrected that mistake when retyping the command here.
 

Linard

Veteran
Veteran
Joined
Jun 29, 2016
Messages
202
Reaction score
17
First Language
Filipino
Primarily Uses
RMMV
Try to remove "s" on the event.
Just give a try :)

$game_map.event([$game_variables[48]).animation_id = 115
 
Last edited:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
38,352
Reaction score
11,942
First Language
English
Primarily Uses
RMMV
No, it's $game_map.events.

Is that EXACTLY what you have in the script call? Or have you split it onto two lines (or has it done it automatically)? If you've split it onto two lines, it will be because of where the line break occurs. Make the line break after $game_variables[ and before 48.
 

MoloRid3r

Villager
Member
Joined
Jan 15, 2017
Messages
24
Reaction score
1
First Language
Thai
Primarily Uses
No, it's $game_map.events.

Is that EXACTLY what you have in the script call? Or have you split it onto two lines (or has it done it automatically)? If you've split it onto two lines, it will be because of where the line break occurs. Make the line break after $game_variables[ and before 48.
Sry for late reply. Yes! it's automatically split to another line. So how to type all of it in one line?
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
1,483
Reaction score
984
First Language
English
Primarily Uses
The script box for events won't always allow you to put your entire script on one line. Do what Shaz said and make a line break after $game_variables[ but before the 48.
 

MoloRid3r

Villager
Member
Joined
Jan 15, 2017
Messages
24
Reaction score
1
First Language
Thai
Primarily Uses
I figured it out! Thank you by the way!
Code:
a = $game_variables[48]
$game_map.events[a].animation_id = 113
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
38,352
Reaction score
11,942
First Language
English
Primarily Uses
RMMV
yeah, that'd work too. But the way we already told you - splitting it, but at a specific place rather than an auto-line break - would have been fine.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Made Custom ENEMY Information Screen
I'm having such a hard time thinking of an interesting battle system. and not being a coder, certain things I wanna do seem a lot harder lol.
Created a character outline with some code. I have no use for this. I'm....bored.....
Having lots of fun using different PS brushes to add a lil' texture to the floors and walls in my maps.

Forum statistics

Threads
93,721
Messages
914,912
Members
123,324
Latest member
ahmbor
Top