RandomReward ACE

RandomReward ACE

by Kyonides
​

Introduction

Just as the script's name clearly implies, it allows you to set some sort of reward lotto into motion by using a single script call.

After it has granted the reward to the player, you can press the OK or Cancel button to return to the map. It could also close itself if no input is given.

How Does it Work?

You just need a simple script call to open the Reward scene.

Ruby:
random_reward([Type, ID, Amount], [:g, Amount], etc.)

Available Types: :i for Item, :w for Weapon, :a for Armor, :g for Gold

Example:
Ruby:
now_reward([:i,1,5],[:i,2,3],[:w,1,1],[:w,25,1],[:g,2000])

Spoiler: 2 Snapshots
randomreward_ace01.jpg

randomreward_ace02.jpg


Terms & Conditions

Free for use in ANY game.
Due credit is mandatory.
Include a link to this post in your Credits text file.
That's it! 😛
What is the difference between the VX and the VX Ace version? They seem to be the exact same post.
They are because they do offer the same functionality. Yet, the default font is different and some basic code changes were needed as well.
They are because they do offer the same functionality. Yet, the default font is different and some basic code changes were needed as well.
Oh, the code is not the same? Okay, yeah that is where I was confused 😛
Script Bug Fix + More Customization!​

Oops! I didn't notice that the Viewport class had no width method by default, meaning it would crash after talking to the NPC...
But don't worry about it! 😀
It's been fixed already! :ewink:

From now on, the script allows you to set the Y coordinate of the window you see on screen plus the font's name and size of your reward message.
Script Updated Once Again!​

Version 1.1.0 comes with 2 brand new features:

1. Events can now "get" random rewards, too.
:eswt: Well, it just simulates that they actually did at least.

Example:

Ruby:
now_reward(:e, 3, [:w, 8, 1], [g:, 470], [:i, 12, 1])

There Event #3 will pretend it got the reward.

2. The reward system itself can be rigged from the very beginning! 😮

Here is an example of a rigged system:

Ruby:
now_reward(1, [:w, 8, 1], [g:, 470], [:i, 12, 1])

In the example above you can see how the player will always get the gold reward in position 1 aka the second reward.

Side Note:

:eswt: I had to develop this rigged game feature while developing my short game Just Another Crisis: The Shutdown. Curiously, the one getting that reward was the RTP character Ghost aka Ghost-o in my game.
1706731683770.png

Hey kyonides! I'm trying to use the script but I keep getting this error 🙁
Well, it was a bit complicated to read that message because you didn't crop the screenshot...

It's weird. The method that "cannot be found" DOES exist in my script.

TO BE UPDATED.
Sorry for the crop. Regarding the crash, your demo crashes for me too, and I thought it strange so I tried it both with no other scripts and with my full library and it says the same. It's weird. I'm just doing the basic give one of these rewards, I haven't touched anything. If I can do or try anything to help I'm all for it!
Maintenance Update​

I was in need of fixing the bug reported by gambitben concerning the call of an instance method from a class method aka singleton method. Since that is not supposed to ever work, I moved the call to the main method and now it runs smoothly.

Feel free to download the demo again! :ewink:
Thank you! I'll get it right up 🙂

Original thread: https://forums.rpgmakerweb.com/threads/randomreward-ace.164307/