DepressedHarold

Villager
Member
Joined
May 10, 2021
Messages
10
Reaction score
2
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,886
Reaction score
982
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
10
Reaction score
2
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,886
Reaction score
982
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,757
Reaction score
2,851
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
10
Reaction score
2
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
10
Reaction score
2
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

Day 2 of my redesign journey, as a follow up from the previous post :kaothx:
pXiRJSm.jpg

This is Cedric's son, Apollo!
New pet peeve: Telling tech support personnel what something is doing, only for them to tell me (in excessively condescending tones) what it should be doing. Yes, I know what it should be doing, and if it was doing that, I wouldn’t be talking to you and your attitude problem about it right now, would I? >.<
uglywolf wrote on Khulse's profile.
Hello.
The rules I makes pun about on your last thread is about "Verify Files" before anything else, if the stuff comes from STEAM. Which means, if it could be fixed with just that, there is no need to redownload the whole stuff.
But glad the reinstall worked, hope you enjoy it and your days too.
uh oh, I just tapped into a fresh, deep vein of nightmare fuel right here guys:

Forum statistics

Threads
115,433
Messages
1,089,819
Members
150,189
Latest member
georgeal365
Top