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,835
Reaction score
952
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,835
Reaction score
952
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,756
Reaction score
2,849
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

RivalRamen_Games wrote on jacobv1014's profile.
I really like your profile picture! Who is that in it? is she an OC?
Making his first game
This scene was suppose to be a test... but now, it's going in the game as official side/optional content. :kaosalute:


functionality(This is function demo not game demo)
1 The door of ABS map can open upon clearing all the monsters
2 Secret room/road arrow/lighting/whatever others can be shown upon clearing too
3 Boss HP bar and loot effect, loot jump and item name color as well as the pick-up animation effect
4 Back to town and "victory aftermath" screen for ABS maps/rooms
Playing one of the two RM2k3 games I was best known for back in the day, one I made in the Spring semester of my Freshmen year in college like 15 years ago, feeling all kinds of ways about it. I have not played this game in WELL over 10 years. I feel a million years old RN.

Forum statistics

Threads
115,328
Messages
1,089,017
Members
149,989
Latest member
myj3775
Top