Image for current event

Voidus

Warper
Member
Joined
Jan 22, 2017
Messages
2
Reaction score
1
First Language
English
Primarily Uses
Hi all,

New to javascript and RMMV, I've been trying to get the current image for the event to use for messageboxes, etc.
I think there's some kind of scoping issue where the script is run from the interpreter not events but I cannot for the life of me get this to work.


this.image was my first guess, but then hit the scoping issue, so tried using the event-id but I keep getting undefined functions and being unable to get properties so guessing I'm still going wrong somewhere.

Any help would be appreciated.
 


EDIT: Resolved, was using all pages rather than one from the array, fixed now. :)
 
Last edited by a moderator:

Tarzanthecat

(Meow)
Veteran
Joined
Jan 18, 2017
Messages
61
Reaction score
12
First Language
English
Primarily Uses
N/A
I hope you have fun using RPM maker!  :guffaw:


Also, you can look up questions on the forum, because often they 


have been already asked. You can also see things about how to


change the game's fount etc.


If you need help with plot development, there are a ton of resorces!


Have fun!  ;)
 

Voidus

Warper
Member
Joined
Jan 22, 2017
Messages
2
Reaction score
1
First Language
English
Primarily Uses
Thanks, yeah I took a look around and couldn't see anything on the subject, but my searching skills are a bit rusty so might have missed something.
 


I have actually just hit another bump in the same coding issue, I got the image getting imported properly now but now when I try to set the image it's not working, seems to briefly flicker when the even is activated, I'm guessing there's something else that keeps defaulting the image to the default one set in the events page.

For reference what I ended up with:
To get the current image and use for message box:


var page = $dataMap.events[this._eventId].pages[0];


var image = page.image;


$gameMessage.setFaceImage(image.characterName, image.characterIndex);


$gameMessage.add("hi");


And to set the image:


var page = $dataMap.events[3].pages[0];


var image = page.image;


image.characterName = $gameVariables.value(11);


image.characterIndex = $gameVariables.value(12);


setImage is showing an undefined function, but looking at the function all it really does is the same thing, update the characterName & Index


Previously I was using the setMoveRoute > Change image option which was working but I'd rather have a more generic solution to save some time.
 
Last edited by a moderator:

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

Latest Threads

Latest Posts

Latest Profile Posts

Day 9 of giveaways! 8 prizes today :D
He mad, but he cute :kaopride:

Our latest feature is an interview with... me?!

People4_2 (Capelet off and on) added!

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.

Forum statistics

Threads
106,040
Messages
1,018,470
Members
137,821
Latest member
Capterson
Top