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
28,997
Reaction score
6,676
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,305
Reaction score
11,902
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
983
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,305
Reaction score
11,902
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 Profile Posts

Cheerleaders are my favorite thing on Czech hockey. Too bad they're the only thing worth watching on it.
meet with Quon,
the goddess of Rakuen (circle mascot)
It turns out that if I set the collider to 0,0,0,0 before despawning an event.... QMovement will actually play nice with Galv Event Spawner! :LZSexcite:
So I cloned an event in MV today.
Just got two custom tracks for my game. Things are shaping up nicely. :)

Forum statistics

Threads
93,503
Messages
913,069
Members
123,038
Latest member
ohsh
Top