Hello, everybody!
Hope you're all doing just fine 🙂
I wanted to see if I could get some help with this scriptlet from Mithran that does the following:
This script was made for the default RPGMVX. Even though I use Tankentai SBS 3.4e, I have thoroughly tested and found that it works exactly the same in both battle systems.
Although this is a rather small bug, I believe it takes you out of the experience a bit, and I'd really like to be able to use this properly.
Thanks all for any attention thrown at this!
Hope you're all doing just fine 🙂
I wanted to see if I could get some help with this scriptlet from Mithran that does the following:
When using an item in battle, the script subtracts 1 of that item immediately after each member selects the item during command selection. This way, the items will be unavailable for the next actors to select if you ran out of them along the way. For example: if Ralph selects to 'use' the last potion, there won't be one for Ulrika to select next. If for some reason Ralph doesn't get to use the potion before the combat round or battle ends, it is still available for use the next round or after battle. If Ralph cancels using the potion, Ulrika can then use it. Also dissalows multiple actors from selecting the same non-consumable item (there must be one for each actor selecting the item).
Ruby:
class Scene_Battle < Scene_Base
alias start_actor_command_selection_item_number_fix start_actor_command_selection
def start_actor_command_selection
start_actor_command_selection_item_number_fix
@active_battler.action.clear
end
alias process_action_item_number_fix process_action
def process_action
$game_temp.action_processing_item_number = true
process_action_item_number_fix
$game_temp.action_processing_item_number = false
end
end
class Game_Temp
attr_accessor :action_processing_item_number
end
class Game_Party < Game_Unit
alias item_number_item_number_fix item_number
def item_number(item)
n = item_number_item_number_fix(item)
return n unless $game_temp.in_battle
return n if item.class != RPG::Item
return n if $game_temp.action_processing_item_number
for member in members
n -= 1 if member.action.kind == 2 && member.action.item_id == item.id
end
return [n, 0].max
end
end
This script was made for the default RPGMVX. Even though I use Tankentai SBS 3.4e, I have thoroughly tested and found that it works exactly the same in both battle systems.
The problem is very small and specific: If, say, you have 1 potion left, and you cancel the use of that potion while selecting the target --which brings you back to the item selection menu-- you won't be able to select the item again (buzzer sound) unless you fully cancel the current actor's action selection turn and go back to the previous actor's action selection turn. By doing this, the item previously selected gets restored correctly and you can try again, hopefully without second thoughts this time.
Although this is a rather small bug, I believe it takes you out of the experience a bit, and I'd really like to be able to use this properly.
Thanks all for any attention thrown at this!