Preserved forum archive. This topic stores the original first post and locally mirrored RPG Maker Web attachments when available. It is posted by the BMMPlay archive account, not by the original creator.
Original Source
- Original title: Randomized critical messages, help needed
- Original author: cooperlambaste
- Original date: February 24, 2024
- Source thread: https://forums.rpgmakerweb.com/threads/randomized-critical-messages-help-needed.166126/
- Source forum path: Game Development Engines > Ruby Game System (RGSS) Scripts > RGSSx Script Support
Summary
Hello, I'm editing Yanfly Engine Ace - Ace Battle Engine v1.22 script, I want it to be able to display a variety of "CRITICAL" messages, which would be picked at random, instead of having just one. I've tried many things to get it to work. Such as overriding the original output for :critical (it didn't work). Spoiler: failed scripting 1
Archived First Post
Hello, I'm editing Yanfly Engine Ace - Ace Battle Engine v1.22 script, I want it to be able to display a variety of "CRITICAL" messages, which would be picked at random, instead of having just one.
I've tried many things to get it to work.
Such as overriding the original output for :critical (it didn't work).
Then I tried to make the :critical method pick a random position from an array. However, it plainly ignores .sample and .shuffle commands, instead only picking a single position in the array. I've been all evening at it, and it's driving me insane. Help?
Thanks very much in advance. Here's the full script from yanfly (unmodified). https://github.com/Archeia/YEARepo/blob/master/Ace_Battle_Engine.rb
I'm also using an addon called "Fix Critical", to well, make the message actually display.
This is the addon.
I've tried many things to get it to work.
Such as overriding the original output for :critical (it didn't work).
#am meddling MIGRATING ONTO A SEPARATE SCRIPT IT DIDNT WORK ABORT
#class Game_Battler
#
# def criticalmessagerandomizer
# randomcritmsg = [1, 2, 3].sample
# if randomcritmsg = 1
# {:critical => "crit msg 1",}
# elsif randomcritmsg = 2
# {:critical => "crit msg 2",}
# else randomcritmsg = 3
# {:critical => "crit msg 3",}
# end
# end
#
#end
#done meddling
Then I tried to make the :critical method pick a random position from an array. However, it plainly ignores .sample and .shuffle commands, instead only picking a single position in the array. I've been all evening at it, and it's driving me insane. Help?
POPUP_SETTINGS ={
:offset => -24, # Height offset of a popup.
:fade => 12, # Fade rate for each popup.
:full => 90, # Frames before a popup fades.
:hp_dmg => "-%s ", # SprintF for HP damage.
:hp_heal => "+%s ", # SprintF for HP healing.
:mp_dmg => "-%s SP", # SprintF for MP damage.
:mp_heal => "+%s SP", # SprintF for MP healing.
:tp_dmg => "-%s TP", # SprintF for MP damage.
:tp_heal => "+%s TP", # SprintF for MP healing.
:drained => "PARASITIC", # Text display for draining HP/MP.
:critical => ["crit msg 1", "crit msg 2", "crit msg 3"].to_a.sample, #.to_a.shuffle.sample, #.shuffle.first, #.sample
:missed => "TRY AGAIN...", # Text display for missed attack.
:evaded => "HIT DENIED", # Text display for evaded attack.
:nulled => "POOR EFFORT", # Text display for nulled attack.
:failed => "EFFORTS IN VAIN", # Text display for a failed attack.
:add_state => "+%s", # SprintF for added states.
:rem_state => "-%s", # SprintF for removed states.
:dur_state => "%s", # SprintF for during states.
:ele_rates => true, # This will display elemental affinities. :ele_wait => 20, # This is how many frames will wait.
:weakpoint => "SUFFERING INFLICTED", # Appears if foe is weak to element.
:resistant => "FALLING FLAT", # Appears if foe is resistant to element.
:immune => "EFFORT NULLED", # Appears if foe is immune to element.
:absorbed => "SPONGED IN", # Appears if foe can absorb the element.
:add_buff => "+%s", # Appears when a positive buff is applied.
:add_debuff => "-%s", # Appears when a negative buff is applied.
} # Do not remove this.
Thanks very much in advance. Here's the full script from yanfly (unmodified). https://github.com/Archeia/YEARepo/blob/master/Ace_Battle_Engine.rb
I'm also using an addon called "Fix Critical", to well, make the message actually display.
This is the addon.
class Game_Battler
def make_damage_value(user, item)
game_battler_make_damage_value_abe(user, item)
rate = item_element_rate(user, item)
make_rate_popup(rate) unless $game_temp.evaluating
if @result.critical
text = YEA::BATTLE::POPUP_SETTINGS[:critical]
rules = "CRITICAL"
create_popup(text,rules)
end
end
end
Downloads / Referenced Files
Log in to download
Log in, then follow the RPG Maker Developers Group to see these download links.
Log in to downloadCreator Claims / Removal
If you are the original creator and want this listing reassigned, edited, or removed, join BMMPlay and contact the moderators with proof that matches the original RPG Maker Web profile, linked GitHub, itch.io page, or another public creator identity.
Replies (0)
No replies yet.
0
replies
1
view
Topic Summary
Loading summary...