Vlue combo script stops MP cost

Status
Not open for further replies.

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,712
First Language
English
Primarily Uses
RMVXA
I am using Vlue's Basic Combo script. However, now I have begun battle testing, a problem has shown up.

An actor has a healing skill which can be used outside of battle. When it is used outside battle, the heal takes effect, but the MP is not removed, meaning that the player has a totally free heal. In battle is fine, the MP is subtracted in the normal way.

Can anyone see how that is happening, and what might be done to fix it?
Thanks.
 

GGZiron

Veteran
Veteran
Joined
Nov 6, 2016
Messages
89
Reaction score
32
First Language
Bulgarian
Primarily Uses
RMVXA
You can try with this two bulelts.
The first one you put before Vlue's script.

Code:
class Game_Battler
  alias_method :use_item_original, :use_item
end
And this one, after his script:

Code:
class Scene_ItemBase < Scene_MenuBase
    def use_item
    play_se_for_item
    user.use_item_original(item)
    use_item_to_actors
    check_common_event
    check_gameover
    @actor_window.refresh
  end
end
In my test seems to solved the problem, although didn't tested too deeply. What I do is to make actor use the original
use_item method, when from Scene Item Base, one which will take the skill cost (MP reduction).
Vlue modified use_item at game battler to not take cost. I could add the cost right at his modifed method, but then during battle the skill would cost double. Seems he take the skill cost somewhere else, but that works only in battle scene.

Edit: Actually, you can put both bullets before Vlue's script.
 
Last edited:
  • Like
Reactions: Kes

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,712
First Language
English
Primarily Uses
RMVXA
@GGZiron Just tested this and seems to work perfectly.
Thank you very much for this. I would have been very sad to have to ditch the combo script as I've built my skill system around it for this project. Now I shan't have to.
 

GGZiron

Veteran
Veteran
Joined
Nov 6, 2016
Messages
89
Reaction score
32
First Language
Bulgarian
Primarily Uses
RMVXA
You are welcome :). Though I am not too happy with this solution I gave above, so I have one more.
Again I give two bullets.
The first one must be above combos script(if in same page, above everything else).

Code:
class Game_Battler
  alias_method :use_item_original, :use_item
end

And the second one is after (this time for real, must be after). If on same page, then after everything, including the last end operator.

Code:
class Game_Battler
 
  alias_method :combos_use_item, :use_item
 
  def use_item(item)
    return unless item
    if SceneManager.scene.is_a?(Scene_Battle)
      combos_use_item(item)
    else
      use_item_original(item)
    end
  end
 
end

I think this way is bit better, and have better compability. Tested it and worked, but of course, I recomend you to test it too, if you go with this.
 
  • Like
Reactions: Kes

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,712
First Language
English
Primarily Uses
RMVXA
@GGZiron I have tested this out and it appears to be working as intended.
Thank you for continuing to refine your solution. Much appreciated.
 
Status
Not open for further replies.

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

Latest Threads

Latest Posts

Latest Profile Posts

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.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD

Forum statistics

Threads
105,868
Messages
1,017,078
Members
137,580
Latest member
Snavi
Top