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
45,990
Reaction score
16,776
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,940
Reaction score
750
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,230
Reaction score
2,503
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,502
Reaction score
3,013
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,401
Reaction score
10,835
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

I've been working furiously on a small demo slice. But with King Slime so busy assets have been slow to form. No matter! I've got the demo for rpgmaker MZ and I'm using the 20 days to make a short and sweet demo game of fighting alongside your rival/boyfriend hehe Kind of like a mini challenge to myself
Yes my images are back ^^, hopefully they won't disappear again.:kaoangry:
It's Sunday. Stop working and take a break. Relax a little.
Ooops ended up trying out making my own A2 tile page instead of testing doors everywhere. Went well so far I think.

Forum statistics

Threads
131,487
Messages
1,220,235
Members
173,225
Latest member
ZecaVn
Top