DepressedHarold

Villager
Member
Joined
May 10, 2021
Messages
8
Reaction score
1
First Language
German
Primarily Uses
RMMV
Hello,
I am trying to create a food system for my MV RPG. I made food items to decrease the characters' hunger on the menu screen, however when I use the battler variable (which should in theory point to the character selected) it always points to the first actor of the party.

My itme requirement code looks like this:

<Custom Enable Requirement>
console.log("battler = ", battler)
condition = getTravelVariable(battler, 0) > 0
</Custom Enable Requirement>

Whenever I try to use the item on any actor in the party the console always prints out the first actor in the party. This also means my script only checks the usage requirement of the first actor, so it does not work.
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
1,159
Reaction score
630
First Language
English
Primarily Uses
RMMV
If you're using it in the menu screen, "battler" wouldn't work because you're not in a battle.

If you notice...when you use an item outside of combat, you don't choose a character to be using it, you use it directly from the menu - you only choose the character it's being used on.

So you can't use the Item Requirements plugin for this purpose. I would suggest trying the Selection Control to restrict who the item is being used on, not by.
 

DepressedHarold

Villager
Member
Joined
May 10, 2021
Messages
8
Reaction score
1
First Language
German
Primarily Uses
RMMV
If you're using it in the menu screen, "battler" wouldn't work because you're not in a battle.

If you notice...when you use an item outside of combat, you don't choose a character to be using it, you use it directly from the menu - you only choose the character it's being used on.

So you can't use the Item Requirements plugin for this purpose. I would suggest trying the Selection Control to restrict who the item is being used on, not by.
Selection Control looks good at first, but it seems like it only runs when in a battle, so it unfortunately I still run into the same problem.
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
1,159
Reaction score
630
First Language
English
Primarily Uses
RMMV
Did you try it? I thought I recalled that my targeting restrictions held true to menu use, but I might be misremembering.
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
3,438
Reaction score
2,547
First Language
English
Primarily Uses
RMMZ
You need to use $gameParty._menuActor for this, at least I think that's what it's called. I can't double check it atm.
 

DepressedHarold

Villager
Member
Joined
May 10, 2021
Messages
8
Reaction score
1
First Language
German
Primarily Uses
RMMV
Did you try it? I thought I recalled that my targeting restrictions held true to menu use, but I might be misremembering.
I made two custon (javascript) conditions, one with selection control like you said and after that i tried one with target eval. I made both log something to the console everytime it runs. They both only output something when in a battle, but not in the menu screen. This would mean it does not even check the condition in the menu screen so I assume it's impossible to make things work on the menu screen with those plugins.
 

DepressedHarold

Villager
Member
Joined
May 10, 2021
Messages
8
Reaction score
1
First Language
German
Primarily Uses
RMMV
I have finally found a rather hacky way of getting what I want: I let my script give the actors an invisible hunger state whenever their hunger is above 0. (This of course gets checked everytime hunger changes) Now i make every food item remove the hunger state (with a 0% chance), meaning the item is only used whenever the actor is actualy hungry. Problem solved.
Not really a satisfying solution, but hey, it works :D
 

Latest Threads

Latest Posts

Latest Profile Posts

Working on a slightly experimental horror game. It will be finished in approximately 88888888888 years.
Y'all will enjoy it though, I put lots of effort into making it stand out.

It's called Red Light and it's inspired by another obscure RPG Maker horror game, but I don't want to give too much away just yet.
Ohh man, Weapon animations plugin feels so mandatory. Seeing that same image regardless of the icon of the weapon....ugh :p
Ok so......Maaaaybe I've taken a ''little'' bit of inspiration from FF9 when it comes to battle hud xD

ff9.PNG

Just maybe....
New version of my wife's art for Tundra's opening map. No new version of Katrina yet, but I think this looks awesome.1624062754755.png

Forum statistics

Threads
112,354
Messages
1,067,706
Members
146,002
Latest member
Raytoly
Top