Beef. It's what's for dinner.

Tanarex

Scrub
Veteran
Joined
Sep 14, 2014
Messages
468
Reaction score
306
First Language
English
Primarily Uses
RMVXA
I was wondering if there was a way a temporary food buff could give a random stat bonus? I thought of using states and setting parameters to different stats at small percentages. But didn't want to give them either no bonuses or too many bonuses.
 

TakeHomeTheCup

Veteran
Veteran
Joined
Oct 15, 2013
Messages
244
Reaction score
460
First Language
English
Primarily Uses
I think something like that would require a script. It also may be possible to do it in the damage formula...
 

JGreene

Veteran
Veteran
Joined
Oct 24, 2015
Messages
395
Reaction score
297
First Language
English
Primarily Uses
RMMV
You could possibly run a random variable in a common event to decide which buff to apply. Depends on how you have it set up. You may need a script call, like @TakeHomeTheCup said.
 

Tanarex

Scrub
Veteran
Joined
Sep 14, 2014
Messages
468
Reaction score
306
First Language
English
Primarily Uses
RMVXA
So how would I do that?
 

Darkanine

...In my thoughts and in my dreams...
Veteran
Joined
Sep 9, 2012
Messages
354
Reaction score
218
First Language
English
Primarily Uses
RMMV
I'm thinking a random variable call that triggers a random state for your bonus might be able to work like @JGreene said. I don't think a script is necessary for something like this. I can probably jot down a step by step tutorial if you'd like, random variables is kind of my thing.
 

Tanarex

Scrub
Veteran
Joined
Sep 14, 2014
Messages
468
Reaction score
306
First Language
English
Primarily Uses
RMVXA
That would be very helpful.
 

Lord Vectra

Master Eventer
Veteran
Joined
Dec 6, 2015
Messages
211
Reaction score
336
First Language
English
Primarily Uses
RMVXA
If doing it by states:
Let's say you make a state for each parameter buff.


Assuming Beef is an item, you will put this in the damage formula:
eval $data_items[ITEM-ID].note[/<formula>(.*?)<\/formula>/m, 1]

ITEM-ID = the ID of the item in the database

In the notebox, you put

<formula>
(What you would normally put in the damage formula)
</formula>

What you normally would've put is:
<formula>
rand(4) = v[x]; if v[x] == 1; a.add_state(27); end; if v[x] == 2; a.add_state(28); end; if v[x] = 3; a.add_state(29); end; if v[x] = 4; a.add_state(30); end; 0
</formula>
"x" in v[x] is the variable ID (You will need a variable with this)

The 0 is at the end in case no numerical value is added or subtracted. The skill should look like this:


Haven't tested it, but it should work. The code in the damage formula tells the database to look in the notebox of the specified Item ID (or skill).
If anything doesn't make sense, don't be afraid to ask ^_^
 

Tanarex

Scrub
Veteran
Joined
Sep 14, 2014
Messages
468
Reaction score
306
First Language
English
Primarily Uses
RMVXA
Nope. Can't use it on them.Screenshot 2017-06-24 21.20.29.png Screenshot 2017-06-24 21.20.43.png
 

Lord Vectra

Master Eventer
Veteran
Joined
Dec 6, 2015
Messages
211
Reaction score
336
First Language
English
Primarily Uses
RMVXA
On you second screenshot, in v[x], the "x" isn't the same number throughout the formula. It's 29 then it goes to 27, and then 28. v[x] must be consistent.

Your damage formula is also wrong. See where you put...
[item-66]

It is just
[66]

You already told the database it's an item's notebox you're looking for when you put $data_items right before it.
 

Tanarex

Scrub
Veteran
Joined
Sep 14, 2014
Messages
468
Reaction score
306
First Language
English
Primarily Uses
RMVXA
states.PNG variable.PNG Item.PNG Ok, so I made a mystery meat variable as 31. I don't know if I'm doing the variable right. But I made sure to add 31 in each of the v[x] spots. I added [66] before but it didn' work. It seems you have an error between the formula under 'What you normally would've put is: "if v[x] = 3;" and in the note tag directly below you have "if c [29] ==3." A 'c' instead of an 'if v'. So is it == or =? Before 3 and 4 there is only a = instead of ==. On "1; a.add_state [26]" I have Beef Buff under 'states.' On ""2; a.add_state [27]" I have Fish Food under 'states.' On "3; a.add_state [28]" I have Chessy Buff under 'states.' On 4; a.add_state [31] I have Bread Buff under 'states.' I finally understand the formula. But still can't get it to work.
 

Lord Vectra

Master Eventer
Veteran
Joined
Dec 6, 2015
Messages
211
Reaction score
336
First Language
English
Primarily Uses
RMVXA
I made a rookie mistake. Do v[31] = rand(4)

At first, i showed random of 1 - 4 is equal to whatever variable 31 is which makes no sense; wouldnt be random if so.

Now, with my suggestion, it'll say variable 31 equals to whatever random 1 - 4 is which does make sense.

Its == bc thats the sign u use for conditionals.
 

Tanarex

Scrub
Veteran
Joined
Sep 14, 2014
Messages
468
Reaction score
306
First Language
English
Primarily Uses
RMVXA
Nope. Have you tried to see if it works?variable2.PNG redo item 2.PNG
 

Lord Vectra

Master Eventer
Veteran
Joined
Dec 6, 2015
Messages
211
Reaction score
336
First Language
English
Primarily Uses
RMVXA
Fixed it. And no, I haven't until now. This one works for me, so if it doesn't work for you, it's not because of this.

If you put this in the notebox, it should work (U may copy/paste as I used ur numbers).
v[31] = rand(4); if v[31] == 1; a.add_state(26); if v[31] == 2; a.add_state(27); if v[31] == 3; a.add_state(28); if v[31] == 4; a.add_state(31); end; end; end; end; 0

All I did was move all the "end" to the end of the damage formula. It worked for me, BUT you'll get a fail message at the top. I suggest using the Anti-Fail script of Yanfly OR go to "Vocab" under "Modules" in the script editor, go to line 82 and make it say nothing.

Anti-Fail Script: Link
 

Tanarex

Scrub
Veteran
Joined
Sep 14, 2014
Messages
468
Reaction score
306
First Language
English
Primarily Uses
RMVXA
Nope. No fail message. Script didn't have any effect either. Just the SF of buzzer1. When something doesn't work.
 

Lord Vectra

Master Eventer
Veteran
Joined
Dec 6, 2015
Messages
211
Reaction score
336
First Language
English
Primarily Uses
RMVXA
So did it give you an error message or is it that it won't allow you to select it?
 

Tanarex

Scrub
Veteran
Joined
Sep 14, 2014
Messages
468
Reaction score
306
First Language
English
Primarily Uses
RMVXA
No error message. Just the buzzer sound when I try to use it in on the menu screen.
 

Lord Vectra

Master Eventer
Veteran
Joined
Dec 6, 2015
Messages
211
Reaction score
336
First Language
English
Primarily Uses
RMVXA
I'm assuming the issue has something to do with damage formula, but I found a workaround. Put Gain TP 0%, and it should work.
 

Tanarex

Scrub
Veteran
Joined
Sep 14, 2014
Messages
468
Reaction score
306
First Language
English
Primarily Uses
RMVXA
Well, I can use it now. It just doesn't do anything. I copied pasted the damage formula again. With the [66] as the item number.
 

Lord Vectra

Master Eventer
Veteran
Joined
Dec 6, 2015
Messages
211
Reaction score
336
First Language
English
Primarily Uses
RMVXA
It certainly works for me. Do you mind sending a demo, so I can look at it?
 

Tanarex

Scrub
Veteran
Joined
Sep 14, 2014
Messages
468
Reaction score
306
First Language
English
Primarily Uses
RMVXA
That's ok. I will just go with my original idea. At least it works for me. I used one mystery meat on each character. One buff, two buffs, one buff, and no buff. But they all still heals for 25% HP. So it's still useful even without a bonus.
beefcake!.PNG for me.old idea.PNG
 

Attachments

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

Latest Threads

Latest Posts

Latest Profile Posts

Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c

Forum statistics

Threads
105,857
Messages
1,017,019
Members
137,564
Latest member
McFinnaPants
Top