Shazbot29

Warper
Member
Joined
Nov 24, 2016
Messages
4
Reaction score
0
Primarily Uses
N/A
Hi, hopefully this is an easy one, but I've spent the last hour googling and I can't find it. I need to change an event graphic through a script (to avoid a ridiculous amount of conditional branches, if you must know :p) and I have something I believe is for an earlier version of the software, but I can't find out what the MV equivalent is. I gathered it's "$gameMap.events" but I don't have the second bit. If there's a resource for this (it's not on this I don't think) I'd love to know what it is so I don't have to bother you guys again.


"$game_map.events[id].set_graphic("character_name", character_index)"


is what I was trying to use and it's been failing.


Thanks!
 
Last edited by a moderator:

bgillisp

Global Moderators
Global Mod
Joined
Jul 2, 2014
Messages
13,937
Reaction score
14,774
First Language
English
Primarily Uses
RMVXA
I've moved this thread to Learning JavaScript. Please be sure to post your threads in the correct forum next time. Thank you.



MV doesn't use scripts, they use plug-ins. I assume you meant plug-in call instead? As it is, I put your thread under the learning javascript thread so someone in the know about the command can tell you the JavaScript command that you need.
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
43,406
Reaction score
15,212
First Language
English
Primarily Uses
RMMV
It won't be a plugin call - it'll be a script call.


Whenever you have something that you can do via event commands, and you want to do it with a script call instead, head to the rpg_objects.js file and search for the event command exactly as it appears on the button in the event editor.


The reason what you've tried won't work is that you're using RGSS code with Ace classes and functions, and MV uses Javascript and its classes and functions are named differently, so your code isn't going to work.
 

Shazbot29

Warper
Member
Joined
Nov 24, 2016
Messages
4
Reaction score
0
Primarily Uses
N/A
Basically I wanted to pull in two game variables, one for the event ID and another for which character index I needed for the event (they all use the same character sheet). I got that part sorted, but you're saying there's no call available to set event graphics? Is there another way I'm just overlooking or is this something a plugin would need to be written to do?


And thanks for your help.
 
Last edited by a moderator:

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
43,406
Reaction score
15,212
First Language
English
Primarily Uses
RMMV
Who are you talking to?  I told you to search through rpg_objects.js for the text that's on the event graphic change command, and to see how that does it.  I couldn't tell you what the event text was (so what to search for), or how to do it, because I wasn't at my computer.  But I thought my instructions were pretty simple.
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,006
First Language
Tagalog
Primarily Uses
RMVXA
"$game_map.events[id].set_graphic("character_name", character_index)"


is what I was trying to use and it's been failing.



What happens when you try to do this? And what is the exact script call you're using?
 

Shazbot29

Warper
Member
Joined
Nov 24, 2016
Messages
4
Reaction score
0
Primarily Uses
N/A
Ok, so in the rpg_objects.js file this is the relevant portion.


Game_Character.prototype.processMoveCommand = function(command) {
var gc = Game_Character;
var params = command.parameters;
switch (command.code) {

case gc.ROUTE_CHANGE_IMAGE:
this.setImage(params[0], params[1]);
break;




Still not sure what the the call I need is. I tried something like this,


$gameMap.events[ID].setImage ("characterName", characterIndex)


but still no dice.
 
Last edited by a moderator:

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,006
First Language
Tagalog
Primarily Uses
RMVXA
Does your characterName and characterIndex exist?
 

Shazbot29

Warper
Member
Joined
Nov 24, 2016
Messages
4
Reaction score
0
Primarily Uses
N/A
Does your characterName and characterIndex exist?



As far as I know yes, I've been setting my characterName to the file name in the character folder, and from what I can tell index is just where at on the character sheet (0-7)
 

Latest Threads

Latest Posts

Latest Profile Posts

I'm making Toilet in Wonderland 2. and tell vinny about it lol
WE ARE THE BORG. YOUR BIOLOGICAL AND TECHNOLOGICAL DISTINCTIVENESS WILL BE ADDED TO OUR OWN. RESISTANCE IS FUTILE.
D2R save files are so broken. how was the beta test better then the full release. blizzard's last hope crashed and burned.
they're getting no more chances from me.
Anyone going to talk about Chris Pratt Mario?

Forum statistics

Threads
115,336
Messages
1,089,104
Members
150,008
Latest member
samuca07
Top