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,759
Reaction score
901
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,759
Reaction score
901
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,747
Reaction score
2,847
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

Too bad the Boss Battle Build Bout isn't also for VXAce.
I might not participate in the Boss Battle contest after all... I have more important things to do, like Wishful Wanda. And of course the Dark Deception spinoff I plan to pitch, Demon Slayer.
Changed my avatar, goodbye Alan Sugar, hello George Carlin (one of my favorite human beings ever)
If you still don't subscribe our Polish channel please consider it :)
1.png
Who wants to see my review of the worst star wars movie? This movie has all the excitement of being on Jury Duty of the most boring case ever about trade negotiations.

Forum statistics

Threads
115,173
Messages
1,087,833
Members
149,727
Latest member
wizard54
Top