LordSpork

Lord of the Sporks
Member
Joined
Feb 12, 2021
Messages
20
Reaction score
12
First Language
English
Primarily Uses
RMMZ
I'm going to preface this by saying I don't know if what I'm trying to achieve is possible in MZ, but I know I was certainly able to do this using Ren'py/Python back in the day. I have been searching the internet for solutions but I honestly can't find anything similar to what I need, so...

I'm using Visustella's VN Picture Busts plugin. I am trying to create a common event where I can easily change the displayed sprites when needed without the hassle of opening and navigating the plugin command every 2 seconds. This is intended to be done with two identifying varibales. I just don't know how to modify the plugin parameter using in game variables.

To explain further, this is my current (but not working) setup;

Variable 2 = Character (determines which character is shown)
Variable 3 = Expression (determines their expression)

In the plugin parameter for picking the file, there's a text box.
image_2023-03-23_171833943.png

My sprites are all organised in their respective folders and named consistently. I need to be able to write a line of some sort that can use the above variables to determine the sprite that matches the string stored inside the variables.

So, for example, I want "Junpei" and the expression "0" (neutral). The file name/location is
img/pictures/Sprites/Junpei/Junpei_0.png

How do I write that so that MZ can understand it?
I tried to play around with different attempts, but nothing is working. My latest attempt was;

img/pictures/Sprites/'$gameVariable.value(2)'/'$gameVariable.value(2)'_'$gameVariable.value(3)'.png

image_2023-03-23_172854691.png
image_2023-03-23_173048830.png

I reeeeally don't want to have to make a million conditional checks in this event haha.
 

Shaz

Keeper of the Nuts
Global Mod
Joined
Mar 2, 2012
Messages
46,034
Reaction score
16,843
First Language
English
Primarily Uses
RMMV
Well, to begin, it's $gameVariables not $gameVariable.

I don't know if you can actually do it, if the plugin hasn't been specifically written to allow it.
 

Bex

Veteran
Veteran
Joined
Aug 2, 2013
Messages
1,953
Reaction score
756
First Language
German
Primarily Uses
RMMZ
Does the Plugin add anything to the Picture the standard Editor is not offering?
If not, that would allow a wider Solution spectrum.
While if you need that plugin, you would need advanced help, because of what @Shaz said.
 

Eliaquim

Hakuen Studio
Veteran
Joined
May 22, 2018
Messages
3,259
Reaction score
2,530
First Language
Portuguese - Br
Primarily Uses
RMMZ
Hi there!
The right javascript code would be:
$gameVariables.value(ID)

But since it is a plugin parameter, the plugin itself must also evaluate the argument like a javascript formula.

So, I believe if it does not work, you can try asking them to add this feature. So the argument from the plugin command can evaluate the picture file name.
 

LordSpork

Lord of the Sporks
Member
Joined
Feb 12, 2021
Messages
20
Reaction score
12
First Language
English
Primarily Uses
RMMZ
@Shaz Oh, thank you for pointing that out! I guess I'm out of luck here.

@Bex Convenience, mostly! It has a setting to animate/transition sprites on screen in pre-determined locations and a bunch of other features, rather than having to figure out and input coordinates manually each time.

@Eliaquim Thank you. Your explanation does make a lot of sense. I'll try to reach out to the creator and see if it can be done.
 

ShadowDragon

Realist
Veteran
Joined
Oct 8, 2018
Messages
7,513
Reaction score
3,022
First Language
Dutch
Primarily Uses
RMMV
otherwise, if its 2 ways, scriptcall might work anyway :)
for plugin commands, I agree with Eliaquim on this one.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
38,488
Reaction score
10,906
First Language
German
Primarily Uses
RMMV
@LordSpork
if it isn't clear - what the other posts above only hinted at was that this is much easier to do by script call than by plugin command.

in each maker support area there is a pinned topic for script call equivalents to all event commands.
What you want is the script call for "show picture". With that call you can use string operations in javascript to create the filename used for selecting the show picture.

That always works and is not dependent on any plugin - while a plugin command is limited to the options that the programmer allowed it to do.
 
  • Like
Reactions: Bex

Latest Threads

Latest Posts

Latest Profile Posts

Hamburger!? Yeeah.
I love it when the approval queue is 80% spammers. Makes it so fast to power through!
I found some inspiration and have started work on a Point and Click style exploration game in a dead mall. I am hopefully going to push MZ in some unexpected directions. I always love seeing the engine do things that folks might not expect. Its good to have found some direction. Thanks for the support a few weeks back when the writers blog was hitting heavy.
Don't you want your heroes or monsters to lose some of their MAXHP or MAXMP? Don't you?
Really, why wouldn't you? :p
Yeah, it's gonna get worse after every hit they take, but so what?
Aren't they courageous fighters? Or stupidly brute mobsters?

Forum statistics

Threads
131,730
Messages
1,222,708
Members
173,476
Latest member
quicksandJo
Top