RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
[RESOLVED] Battle Icon Command Script

0 Members and 1 Guest are viewing this topic.

***
Rep:
Level 88
Menu & Battle System Guru
Hey I'm looking for a battle icon command script (as the title explains, haha). Basically what Im looking for is, that instead of the normal text/window, a command window with just icons.

thanks guys!
« Last Edit: January 21, 2007, 05:24:55 PM by Blizzard »

pokeball :)OfflineMale
********
Cheese
Rep:
Level 95
?
like in legend of dragoon?
Watch out for: HaloOfTheSun

pokeball :)OfflineMale
********
Cheese
Rep:
Level 95
?
Code: [Select]
module BattleIconCommand_Settings
#--------------------------------------------------------------------------
# * Main Settings
#--------------------------------------------------------------------------
Y = 208
Outline = true
#--------------------------------------------------------------------------
# * Icons' Names
#--------------------------------------------------------------------------
Attack = '001-Weapon01'
Skill = '044-Skill01'
Guard = '009-Shield01'
Item = '032-Item01'
end

class Window_BattleActorCommand < Window_Selectable
#--------------------------------------------------------------------------
# * Include Settings
#--------------------------------------------------------------------------
include BattleIconCommand_Settings
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize(words)
super(0, Y, 160, 80)
self.contents = Bitmap.new(128, 48)
contents.font.size = 14
self.opacity = 0
@item_max = @column_max = 4
@old = -1
@words = words
@icons = []
[Attack, Skill, Guard, Item].each { |x| @icons << RPG::Cache.icon(x) }
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
if @index != @old
contents.clear
0.upto(3) do |i|
opacity = @index == i ? 255 : 128
contents.blt(8 + i * 32, 18, @icons[i], Rect.new(0, 0, 24, 24), opacity)
if @index == i
if Outline
contents.font.color.set(0, 0, 0)
contents.draw_text(1 + i * 32, 2, 36, 14, @words[i], 1)
contents.draw_text(3 + i * 32, 2, 36, 14, @words[i], 1)
contents.draw_text(2 + i * 32, 1, 36, 14, @words[i], 1)
contents.draw_text(2 + i * 32, 3, 36, 14, @words[i], 1)
contents.font.color = normal_color
end
contents.draw_text(2 + i * 32, 2, 36, 14, @words[i], 1)
end
end
@old = @index
end
end
#--------------------------------------------------------------------------
# * Update Cursor Rectangle
#--------------------------------------------------------------------------
def update_cursor_rect
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
super
refresh if active
end
end

class Scene_Battle
#--------------------------------------------------------------------------
# * Main
#--------------------------------------------------------------------------
def main
$game_temp.in_battle = true
$game_temp.battle_turn = 0
$game_temp.battle_event_flags.clear
$game_temp.battle_abort = false
$game_temp.battle_main_phase = false
$game_temp.battleback_name = $game_map.battleback_name
$game_temp.forcing_battler = nil
$game_system.battle_interpreter.setup(nil, 0)
@troop_id = $game_temp.battle_troop_id
$game_troop.setup(@troop_id)
s1 = $data_system.words.attack
s2 = $data_system.words.skill
s3 = $data_system.words.guard
s4 = $data_system.words.item
# Begin Slipknot edit
@actor_command_window = Window_BattleActorCommand.new([s1, s2, s3, s4])
# End Slipknot edit
@actor_command_window.back_opacity = 160
@actor_command_window.active = false
@actor_command_window.visible = false
@party_command_window = Window_PartyCommand.new
@help_window = Window_Help.new
@help_window.back_opacity = 160
@help_window.visible = false
@status_window = Window_BattleStatus.new
@message_window = Window_Message.new
@spriteset = Spriteset_Battle.new
@wait_count = 0
if $data_system.battle_transition == ""
Graphics.transition(20)
else
Graphics.transition(40, "Graphics/Transitions/" +
$data_system.battle_transition)
end
start_phase1
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
$game_map.refresh
Graphics.freeze
@actor_command_window.dispose
@party_command_window.dispose
@help_window.dispose
@status_window.dispose
@message_window.dispose
if @skill_window != nil
@skill_window.dispose
end
if @item_window != nil
@item_window.dispose
end
if @result_window != nil
@result_window.dispose
end
@spriteset.dispose
if $scene.is_a?(Scene_Title)
Graphics.transition
Graphics.freeze
end
if $BTEST and not $scene.is_a?(Scene_Gameover)
$scene = nil
end
end
end
« Last Edit: January 21, 2007, 04:25:10 PM by Blizzard »
Watch out for: HaloOfTheSun

***
Rep:
Level 88
Menu & Battle System Guru
thanks, but im getting this error:

Script '' line43: typeerror occured
cannot convert array into bitmap

the line is:

contents.blt(8 + i * 32, 18, @icons, Rect.new(0, 0, 24, 24), opacity)

any ideas?

********
EXA
Rep:
Level 92
Pikachu on a toilet
Project of the Month winner for April 2007
Nouman just hit the wrong tags, try to copy it again.
Get King of Booze for Android, for iOS, for OUYA or for Windows!
Visit our website.
You can also love/hate us on Facebook or the game itself.


Get DropBox, the best free file syncing service there is!

***
Rep:
Level 88
Menu & Battle System Guru
awesome, thanks guys!

pokeball :)OfflineMale
********
Cheese
Rep:
Level 95
?
Nouman just hit the wrong tags, try to copy it again.

whoops... ;D

anyways since your question was awnsered, can you add [RESOLVED] to the topic title, so we know your question on awnsered. BUt leave the topic unlocked in case someone else has a question on this.
Watch out for: HaloOfTheSun

********
EXA
Rep:
Level 92
Pikachu on a toilet
Project of the Month winner for April 2007
I was faster I guess. =P
Get King of Booze for Android, for iOS, for OUYA or for Windows!
Visit our website.
You can also love/hate us on Facebook or the game itself.


Get DropBox, the best free file syncing service there is!