Item Charges

DiegoBinder

Villager
Member
Joined
May 26, 2019
Messages
15
Reaction score
3
First Language
Portuguese
Primarily Uses
RMVXA
*reads other thread as well* Under the assumption that the item(quiver) would simply be in your invenory the following should work.

Code:
<custom cost requirement>
$game_party.find_instance_item($data_items[X])
</custom cost requirement>

<custom cost perform>
$game_party.consume_item($game_party.find_instance_item($data_items[X]))
</custom cost perform>
The above of course doesn't work properly(negative charge o.o) if you use the <no charge keep> notetag but in the event that you do use it then add the following to the bottom of my script.

Code:
class Game_Party < Game_Unit
  def find_instance_item_wc(template_item)
    container_list = item_container_list(template_item)
    return container_list.find {|obj| obj.template_id == template_item.template_id && obj.current_charge > 0 }
  end
end
Then use...

Code:
<custom cost requirement>
$game_party.find_instance_item_wc($data_items[X])
</custom cost requirement>

<custom cost perform>
$game_party.consume_item($game_party.find_instance_item_wc($data_items[X]))
</custom cost perform>
In both cases X would be the ID of your item who's charge you wish to consume.
I want my items to still be in my inventory...but when I use the <no charge keep> they can still be used with negative charges...I tried using those codes but I don't understand it...were is the "bottom" of the script...and where do I use the third code?
 

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
2,660
Reaction score
563
First Language
English
Primarily Uses
RMVXA
@DiegoBinder I suggest you read some tutorials.
In my signature block are links to tutorials on new users and using scripts.
Please read those, they will help.
 

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

Latest Threads

Latest Posts

Latest Profile Posts

People3_5 and People3_8 added!

so hopefully tomorrow i get to go home from the hospital i've been here for 5 days already and it's driving me mad. I miss my family like crazy but at least I get to use my own toiletries and my own clothes. My mom is coming to visit soon i can't wait to see her cause i miss her the most. :kaojoy:
Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.

Forum statistics

Threads
105,868
Messages
1,017,085
Members
137,583
Latest member
write2dgray
Top