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,133
Reaction score
616
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,133
Reaction score
616
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,363
Reaction score
2,485
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 Profile Posts

Draw something
Me: No problemo! ''draws something''
Now draw the same thing from a different angle
Me: So....You have discovered my weakness...
I got a new PC... Nothing wrong with my lil laptop at all! Still works great, and I'll be using it for school. But, the specs for gaming were falling off fast. So I was selfish and bought myself a beast of a PC ^-^
Newstuff.PNG

Held hostage in my own house half the day by an old man that cant take hints or read body language, STILL manage to make some pixels! booyah! I should get a promotion!....No wait...I should get a job o_O
Potions are to be hoarded, not used... >_>

Forum statistics

Threads
112,237
Messages
1,066,758
Members
145,843
Latest member
N13isa
Top