Item user PHA

Topdod

Villager
Member
Joined
Jan 2, 2013
Messages
14
Reaction score
0
Primarily Uses
Not sure if I'm missing something obvious here or not but when from the item menu NOT in battle, using an item uses whoever has the highest PHA stat or leader.

I'm using Hime's Custom Use Conditions script which allows me to have requirements to use an item which in this case is a state but here is the problem as whoever is in front of the party will only ever use the item on the rest of the party and the item's condition isn't used for anybody but the first actor.
If actor 1 uses the item on themselves it locks out the entire party from using this item but if the item is used on anybody but the first it can be used until there is no more of the item left.

I guess like the target of the item would use the item on themselves instead of whoever had the highest PHA.
This would let me give a buff, make the party member wait X amount of battles for it to wear off and then they can use the item again.

Edit:
Ah, sorry about posting in the wrong place.
Hime script
http://himeworks.com/2013/11/custom-use-conditions/
 
Last edited:

Kes

Global Moderators
Global Mod
Joined
Aug 3, 2012
Messages
21,599
Reaction score
10,920
First Language
English
Primarily Uses
RMVXA

I've moved this thread to RGSSx Script Support. Please be sure to post your threads in the correct forum next time. Thank you.


Would you please edit your post to include a link to the web page where you got that script. That way if anyone needs to check something before making a suggestion, they won't have to go hunting.
Thanks
 

Another Fen

Veteran
Veteran
Joined
Jan 23, 2013
Messages
536
Reaction score
249
First Language
German
Primarily Uses
Hey there,

Haven't tested it yet or anything (again), but you could try to use this as an additional script:
Code:
# ============================================================================
#  * Menu Item User Fix
#    Version 1.0 (January 4th, 2019)
#    by Another Fen <forums.rpgmakerweb.com>
# ----------------------------------------------------------------------------
#  This script attempts to change the "user" for items used from the menu, so...
#  ...items with self-scope should now be used by the target.
#  ...items are used by a party member that can actually use the item
#     (e.g. if item usablility is restricted through other scripts).
#  ...reusing an item after immobilizing the party with it does not cause an
#     error.
# ----------------------------------------------------------------------------
#  Place this script within the "▼ Materials" section of the script editor.
#  The script overwrites  Scene_ItemBase#user  and should be placed above
#  other scripts that alias this method.
# ============================================================================

class Scene_ItemBase
  # Scene_ItemBase#user  (Redefined)
  # Try to find a user that can actually use the item, and fix self-scope
  def user
    users = (item && item.for_user?) ? item_target_actors : $game_party.members
    return users.select { |a| a.usable?(item) }.max_by { |a| a.pha } || users[0]
  end
end
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

Person: "Taxes are bs and money is, too! Anarchy!!" *Literally anything goes wrong* Same Person: "Why hasn't the government fixed this???"
Stream will be live shortly with a session of Haunting Ground! Feel free to drop by!
As for the Coronavirus? Well: "People that spend their life avoiding death are already dead (they're also rich, and I like to spend my life with their money.)"
- R. Sanchez, "Edge of Tomorty: Rick, Die, Repeat"
making pierogi and corrupting my game files wbu

Forum statistics

Threads
94,345
Messages
920,111
Members
124,105
Latest member
acelaces
Top