Symbol_

Veteran
Veteran
Joined
Nov 28, 2017
Messages
159
Reaction score
28
First Language
English
Primarily Uses
RMMV

MV Prize Wheel​


Hey! I need to know how to set the graphics for the wheel mid-game:
For instance, this script call:

Galv.PRIZE.setFront('picture')

Sets the front image for the wheel graphics, but I'd like to be able to change the wheel graphic itself in game, along with the arrow and notches if possible!

---

I'd also like to know if its possible to have more than one custom slice on the wheel, rather than just one! And if so, how I'd check for each different custom condition!

Thanks in advance and if Galv see's this, many thank you's for your plugins that have helped me so much in my past games!
Appreciated!
 
Last edited:

ShadowDragon

Realist
Veteran
Joined
Oct 8, 2018
Messages
4,918
Reaction score
1,888
First Language
Dutch
Primarily Uses
RMMV
if you have the demo, you can change the images and place them
in the pictures folder.

in the demo, there are 5 images you can change, and use their
respective names :)

if you want to increase the size of it, or how it function, than I dont know,
but you can change the graphics easely to your likings.
 

Symbol_

Veteran
Veteran
Joined
Nov 28, 2017
Messages
159
Reaction score
28
First Language
English
Primarily Uses
RMMV
if you have the demo, you can change the images and place them
in the pictures folder.

in the demo, there are 5 images you can change, and use their
respective names :)

if you want to increase the size of it, or how it function, than I dont know,
but you can change the graphics easely to your likings.

Hey thanks I'm aware of this! What I want is the ability to change the graphics I use in game mid-way through an event. So I could have the wheel start the colour pink, but then the player goes somewhere else, and it turns to blue, and so on!
 

ShadowDragon

Realist
Veteran
Joined
Oct 8, 2018
Messages
4,918
Reaction score
1,888
First Language
Dutch
Primarily Uses
RMMV
ahh, that way, you didn't told that before as in midgame, and to make it
unique to the town/city to change images can nice, but I need to look
if it's possible, but you can make a work around that take a tiny detour
of the plugin.

the mini detour is to copy/paste the plugin, change the name on the
end with "2" as well as the parameters etc.

you might need to change some functions to call, but that is 1 way
that works, but otherwise, I need to check.

if noone respond within 12 hours, I can take a look for you.
 

autodidact

Veteran
Veteran
Joined
Nov 13, 2020
Messages
80
Reaction score
63
First Language
English
Primarily Uses
RMMV
Changing the prize wheel graphic is really easy mid-event, if I understand your request right.

Try inserting this line as a script command in an event before the Prize Wheel's start() is called.
Code:
Galv.PRIZE.wheelimg = "prizewheel2"; //Insert whatever file name you are using in place of prizewheel2

If you use the above code, remember to never use the Prize Wheel's start() without first setting the Galv.PRIZE.wheelimg variable in your event, because it will use whatever is in the plugin parameter or whatever was last set (which may not be what you want).

For the notches and arrows, Galv's code reads these variables:
JavaScript:
Galv.PRIZE.notchimg = p["Notch Graphic"];
Galv.PRIZE.arrowimg = p["Arrow Graphic"];
Just reassign the vars like with Galv.PRIZE.wheelimg and it should work.

EDIT (Custom slices):
This is a neat plugin, but only if I leave out my typos! Galv's plugin does allow multiple custom slices, but you will have to define them and check them all in script commands so don't mistype.

Below has 4 custom slices defined.
JavaScript:
Galv.PRIZE.wheelimg = "prizewheel2";
Galv.PRIZE.addPrizes('c1,Nothing','c2,CustomTwo', 'c3,Same', 'c4,Same');
Galv.PRIZE.start();

Then, make sure that you have the conditional branch command do a script check for Galv.PRIZE.result.isCustom (in blue text below). Then, in a new conditional branch script check for Galv.PRIZE.result.item.name and compare it to the names defined for each of your slices.

1635549695728.png
 
Last edited:

Symbol_

Veteran
Veteran
Joined
Nov 28, 2017
Messages
159
Reaction score
28
First Language
English
Primarily Uses
RMMV
Changing the prize wheel graphic is really easy mid-event, if I understand your request right.

Try inserting this line as a script command in an event before the Prize Wheel's start() is called.
Code:
Galv.PRIZE.wheelimg = "prizewheel2"; //Insert whatever file name you are using in place of prizewheel2

If you use the above code, remember to never use the Prize Wheel's start() without first setting the Galv.PRIZE.wheelimg variable in your event, because it will use whatever is in the plugin parameter or whatever was last set (which may not be what you want).

For the notches and arrows, Galv's code reads these variables:
JavaScript:
Galv.PRIZE.notchimg = p["Notch Graphic"];
Galv.PRIZE.arrowimg = p["Arrow Graphic"];
Just reassign the vars like with Galv.PRIZE.wheelimg and it should work.

EDIT (Custom slices):
This is a neat plugin, but only if I leave out my typos! Galv's plugin does allow multiple custom slices, but you will have to define them and check them all in script commands so don't mistype.

Below has 4 custom slices defined.
JavaScript:
Galv.PRIZE.wheelimg = "prizewheel2";
Galv.PRIZE.addPrizes('c1,Nothing','c2,CustomTwo', 'c3,Same', 'c4,Same');
Galv.PRIZE.start();

Then, make sure that you have the conditional branch command do a script check for Galv.PRIZE.result.isCustom (in blue text below). Then, in a new conditional branch script check for Galv.PRIZE.result.item.name and compare it to the names defined for each of your slices.

View attachment 205271

All of your code/help is appreciated you solved all my issues and then some! Thank you so much!
 

Symbol_

Veteran
Veteran
Joined
Nov 28, 2017
Messages
159
Reaction score
28
First Language
English
Primarily Uses
RMMV
One more issue I have is showing pictures above the wheel itself, if anybody has ideas on that too!
 
Last edited:

autodidact

Veteran
Veteran
Joined
Nov 13, 2020
Messages
80
Reaction score
63
First Language
English
Primarily Uses
RMMV
Hello again,

Just a quick note on my suggestion above.
None of the images defined using the code above are preloaded, so the game could open the prize scene while images are still loading.

You could code proper loading of those images into the plugin, or just use https://galvs-scripts.com/2017/04/26/mv-image-cache/.

About pictures showing above the wheel, after looking at the code I found it is fairly easy to add pictures.
The below code adds a picture above all other graphics (completely centered) and immediately adds it to the minigame scene. If you want to time when it pops up, that will take a little digging through the code.

JavaScript:
var alias_Galv_Scene_PrizeWheelCreateGraphics = Scene_PrizeWheel.prototype.createGraphics;
Scene_PrizeWheel.prototype.createGraphics = function() {
    alias_Galv_Scene_PrizeWheelCreateGraphics.call(this);
        // itemPicture
        this._itemPic = new Sprite();
        this._itemPic.bitmap = ImageManager.loadPicture("prizewheel_arrow2");
        this._itemPic.anchor.y = 0.5;
        this._itemPic.anchor.x = 0.5;
        this._itemPic.y = Graphics.boxHeight /2;
        this._itemPic.x = Graphics.boxWidth / 2;
        this.addChild(this._itemPic);
}
 

Symbol_

Veteran
Veteran
Joined
Nov 28, 2017
Messages
159
Reaction score
28
First Language
English
Primarily Uses
RMMV
T
Hello again,

Just a quick note on my suggestion above.
None of the images defined using the code above are preloaded, so the game could open the prize scene while images are still loading.

You could code proper loading of those images into the plugin, or just use https://galvs-scripts.com/2017/04/26/mv-image-cache/.

About pictures showing above the wheel, after looking at the code I found it is fairly easy to add pictures.
The below code adds a picture above all other graphics (completely centered) and immediately adds it to the minigame scene. If you want to time when it pops up, that will take a little digging through the code.

JavaScript:
var alias_Galv_Scene_PrizeWheelCreateGraphics = Scene_PrizeWheel.prototype.createGraphics;
Scene_PrizeWheel.prototype.createGraphics = function() {
    alias_Galv_Scene_PrizeWheelCreateGraphics.call(this);
        // itemPicture
        this._itemPic = new Sprite();
        this._itemPic.bitmap = ImageManager.loadPicture("prizewheel_arrow2");
        this._itemPic.anchor.y = 0.5;
        this._itemPic.anchor.x = 0.5;
        this._itemPic.y = Graphics.boxHeight /2;
        this._itemPic.x = Graphics.boxWidth / 2;
        this.addChild(this._itemPic);
}

Thank you so much for all your hard work!
 

Latest Threads

Latest Profile Posts

Apparently I'm a grandpa now.

20220128_181216.jpg20220128_181227.jpg
Sales Goal of Learn RPG Maker MV at 64% now! :kaopride:
When I was in the hospital I did actually have a nurse that was funny, did all these extra nice things for me and said she liked me. So you know what that means. That will be the last time I'll hear from her.
Anyone here ever confronted a never-ending loading screen? Took me 3 hours to realize the problem was the font format :yswt:
Ah, the problems a noob runs into...

Forum statistics

Threads
118,803
Messages
1,118,822
Members
155,983
Latest member
DJC
Top