Home
Help
Search
Calendar
Login
Register
Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News:
New forum theme up and running!
Charas-Project
»
Game Creation
»
Requests
»
RPG Maker Programming
»
Ring Menu in RPG Maker XP
« previous
next »
Print
Pages: [
1
]
Author
Topic: Ring Menu in RPG Maker XP (Read 5331 times)
forgetaboutit
Acolyte
Posts: 307
Ring Menu in RPG Maker XP
«
on:
April 22, 2007, 08:15:25 PM »
NOT MADE BY ME!!!!!!!!!!! I AM NOT SURE WHO MADE IT, BUT CREDITS GO TO MakirouAru FOR EDITING AND boushy FOR MODIFYING.
Its very easy:
1st: Insert a new Script, call it whatever you want.
2nd: Paste the following text:
#==============================================================================
# Scene_RingMenu
# Scene_Menu
#==============================================================================
#class Scene_RingMenu
class Scene_Menu
#--------------------------------------------------------------------------
#
#--------------------------------------------------------------------------
def initialize(menu_index = 0)
@menu_index = menu_index
end
#--------------------------------------------------------------------------
#
#--------------------------------------------------------------------------
def main
#
@spriteset = Spriteset_Map.new
#
px = $game_player.screen_x - 15
py = $game_player.screen_y - 24
@command_window = Window_RingMenu.new(px,py)
@command_window.index = @menu_index
#
if $game_party.actors.size == 0
#
@command_window.disable_item(0)
@command_window.disable_item(1)
@command_window.disable_item(2)
@command_window.disable_item(3)
end
@command_window.z = 100
#
if $game_system.save_disabled
#
@command_window.disable_item(4)
end
#
px2 = $game_player.screen_x - 15
py2 = $game_player.screen_y - 24
@status_window = Window_RingMenuStatus.new(px2,py2)
@status_window.visible = false
#
Graphics.transition
#
loop do
#
Graphics.update
#
Input.update
#
update
#
if $scene != self
break
end
end
#
Graphics.freeze
#
@spriteset.dispose
#
@command_window.dispose
@status_window.dispose
end
#--------------------------------------------------------------------------
#
#--------------------------------------------------------------------------
def update
#
@command_window.update
@status_window.update
#
if @command_window.active
update_command
return
end
#
if @status_window.active
update_status
return
end
end
#--------------------------------------------------------------------------
#
#--------------------------------------------------------------------------
def update_command
#
if Input.trigger?(Input::B)
#
$game_system.se_play($data_system.cancel_se)
#
$scene = Scene_Map.new
return
end
#
if Input.trigger?(Input::C)
#
if $game_party.actors.size == 0 and @command_window.index < 4
#
$game_system.se_play($data_system.buzzer_se)
return
end
#
case @command_window.index
when 0 #
#
$game_system.se_play($data_system.decision_se)
#
$scene = Scene_Item.new
when 1 #
#
$game_system.se_play($data_system.decision_se)
#
@command_window.active = false
@status_window.active = true
@status_window.visible = true
@status_window.index = 0
when 2 #
#
$game_system.se_play($data_system.decision_se)
#
@command_window.active = false
@status_window.active = true
@status_window.visible = true
@status_window.index = 0
when 3 #
#
$game_system.se_play($data_system.decision_se)
#
@command_window.active = false
@status_window.active = true
@status_window.visible = true
@status_window.index = 0
when 4 # ???
#
if $game_system.save_disabled
#
$game_system.se_play($data_system.buzzer_se)
return
end
#
$game_system.se_play($data_system.decision_se)
#
$scene = Scene_Save.new
when 5 #
#
$game_system.se_play($data_system.decision_se)
#
$scene = Scene_End.new
end
return
end
#
return if @command_window.animation?
#
if Input.press?(Input::UP) or Input.press?(Input::LEFT)
$game_system.se_play($data_system.cursor_se)
@command_window.setup_move_move(Window_RingMenu::MODE_MOVEL)
return
end
#
if Input.press?(Input::DOWN) or Input.press?(Input::RIGHT)
$game_system.se_play($data_system.cursor_se)
@command_window.setup_move_move(Window_RingMenu::MODE_MOVER)
return
end
end
#--------------------------------------------------------------------------
#
#--------------------------------------------------------------------------
def update_status2
#
if Input.trigger?(Input::B)
#
$game_system.se_play($data_system.cancel_se)
#
@command_window.active = true
@status_window.active = false
@status_window.visible = false
@status_window.index = -1
return
end
#
if Input.trigger?(Input::C)
#
case @command_window.index
when 1 #
#
if $game_party.actors[@status_window.index].restriction >= 2
#
$game_system.se_play($data_system.buzzer_se)
return
end
#
$game_system.se_play($data_system.decision_se)
#
$scene = Scene_Skill.new(@status_window.index)
when 2 #
#
$game_system.se_play($data_system.decision_se)
#
$scene = Scene_Equip.new(@status_window.index)
when 3 #
#
$game_system.se_play($data_system.decision_se)
#
$scene = Scene_Status.new(@status_window.index)
end
return
end
end
def update_status
@command_window.visible=false
#
if Input.trigger?(Input::B)
#
$game_system.se_play($data_system.cancel_se)
#
$scene = Scene_Menu.new
return
end
#
if Input.trigger?(Input::C)
#
if $game_party.actors.size == 0 and @command_window.index < 4
#
$game_system.se_play($data_system.buzzer_se)
return
end
#
case @command_window.index
when 0 #
#
$game_system.se_play($data_system.decision_se)
#
$scene = Scene_Item.new
when 1 #
#
$game_system.se_play($data_system.decision_se)
#
$scene = Scene_Skill.new(@status_window.index)
when 2 #
#
$game_system.se_play($data_system.decision_se)
#
$scene = Scene_Equip.new(@status_window.index)
when 3 #
#
$game_system.se_play($data_system.decision_se)
#
$scene = Scene_Status.new(@status_window.index)
when 4 #
#
if $game_system.save_disabled
#
$game_system.se_play($data_system.buzzer_se)
return
end
#
$game_system.se_play($data_system.decision_se)
#
$scene = Scene_Save.new
when 5 #
#
$game_system.se_play($data_system.decision_se)
#
$scene = Scene_End.new
end
return
end
#
return if @status_window.animation2?
#
if Input.press?(Input::UP) or Input.press?(Input::LEFT)
$game_system.se_play($data_system.cursor_se)
@status_window.setup_move_move(Window_RingMenuStatus::MODE_MOVEL)
return
end
#
if Input.press?(Input::DOWN) or Input.press?(Input::RIGHT)
$game_system.se_play($data_system.cursor_se)
@status_window.setup_move_move(Window_RingMenuStatus::MODE_MOVER)
return
end
end
end
3rd: Create 2 scrpits bettwen "Arrow_Base" and "Window_DebugRight". Paste this text in the first script:
#==============================================================================
# Window_RingMenu
#==============================================================================
#==============================================================================
#
#==============================================================================
class Window_RingMenu < Window_Base
#--------------------------------------------------------------------------
#
#--------------------------------------------------------------------------
STARTUP_FRAMES = 20 #
MOVING_FRAMES = 5 #
RING_R = 64 #
ICON_ITEM = RPG::Cache.icon("034-Item03") #
ICON_SKILL = RPG::Cache.icon("044-Skill01") #
ICON_EQUIP = RPG::Cache.icon("001-Weapon01") #
ICON_STATUS = RPG::Cache.icon("050-Skill07") #
ICON_SAVE = RPG::Cache.icon("038-Item07") #
ICON_EXIT = RPG::Cache.icon("046-Skill03") #
ICON_DISABLE= RPG::Cache.icon("") #
SE_STARTUP = "056-Right02" #
MODE_START = 1 #
MODE_WAIT = 2 #
MODE_MOVER = 3 #
MODE_MOVEL = 4 #
#--------------------------------------------------------------------------
#
#--------------------------------------------------------------------------
attr_accessor :index
#--------------------------------------------------------------------------
#
#--------------------------------------------------------------------------
def initialize( center_x, center_y )
super(0, 0, 640, 480)
self.contents = Bitmap.new(width-32, height-32)
self.contents.font.name = "Arial"
self.opacity = 0
self.back_opacity = 0
s1 = "Itens"
s2 = "Magias"
s3 = "Equipamento"
s4 = "Status"
s5 = "Salvar"
s6 = "Sair"
@commands = [ s1, s2, s3, s4, s5, s6 ]
@item_max = 6
@index = 0
@items = [ ICON_ITEM, ICON_SKILL, ICON_EQUIP, ICON_STATUS, ICON_SAVE, ICON_EXIT ]
@disabled = [ false, false, false, false, false, false ]
@cx = center_x - 16
@cy = center_y - 16
setup_move_start
refresh
end
#--------------------------------------------------------------------------
#
#--------------------------------------------------------------------------
def update
super
refresh
end
#--------------------------------------------------------------------------
#
#--------------------------------------------------------------------------
def refresh
self.contents.clear
# -------------------
case @mode
when MODE_START
refresh_start
when MODE_WAIT
refresh_wait
when MODE_MOVER
refresh_move(1)
when MODE_MOVEL
refresh_move(0)
end
# ---------------
rect = Rect.new(@cx - 272, @cy + 24, self.contents.width-32, 32)
self.contents.draw_text(rect, @commands[@index],1)
end
#--------------------------------------------------------------------------
#
#--------------------------------------------------------------------------
def refresh_start
d1 = 2.0 * Math::PI / @item_max
d2 = 1.0 * Math::PI / STARTUP_FRAMES
r = RING_R - 1.0 * RING_R * @steps / STARTUP_FRAMES
for i in 0...@item_max
j = i - @index
d = d1 * j + d2 * @steps
x = @cx + ( r * Math.sin( d ) ).to_i
y = @cy - ( r * Math.cos( d ) ).to_i
draw_item(x, y, i)
end
@steps -= 1
if @steps < 1
@mode = MODE_WAIT
end
end
#--------------------------------------------------------------------------
#
#--------------------------------------------------------------------------
def refresh_wait
d = 2.0 * Math::PI / @item_max
for i in 0...@item_max
j = i - @index
x = @cx + ( RING_R * Math.sin( d * j ) ).to_i
y = @cy - ( RING_R * Math.cos( d * j ) ).to_i
draw_item(x, y, i)
end
end
#--------------------------------------------------------------------------
#
#--------------------------------------------------------------------------
def refresh_move( mode )
d1 = 2.0 * Math::PI / @item_max
d2 = d1 / MOVING_FRAMES
d2 *= -1 if mode != 0
for i in 0...@item_max
j = i - @index
d = d1 * j + d2 * @steps
x = @cx + ( RING_R * Math.sin( d ) ).to_i
y = @cy - ( RING_R * Math.cos( d ) ).to_i
draw_item(x, y, i)
end
@steps -= 1
if @steps < 1
@mode = MODE_WAIT
end
end
#--------------------------------------------------------------------------
#
#--------------------------------------------------------------------------
def draw_item(x, y, i)
#p "x=" + x.to_s + " y=" + y.to_s + " i=" + @items
.to_s
rect = Rect.new(0, 0, @items
.width, @items
.height)
if @index == i
self.contents.blt( x, y, @items
, rect )
if @disabled[@index]
self.contents.blt( x, y, ICON_DISABLE, rect )
end
else
self.contents.blt( x, y, @items
, rect, 128 )
if @disabled[@index]
self.contents.blt( x, y, ICON_DISABLE, rect, 128 )
end
end
end
#--------------------------------------------------------------------------
#
#--------------------------------------------------------------------------
def disable_item(index)
@disabled[index] = true
end
#--------------------------------------------------------------------------
#
#--------------------------------------------------------------------------
def setup_move_start
@mode = MODE_START
@steps = STARTUP_FRAMES
if SE_STARTUP != nil and SE_STARTUP != ""
Audio.se_play("Audio/SE/" + SE_STARTUP, 80, 100)
end
end
#--------------------------------------------------------------------------
#
#--------------------------------------------------------------------------
def setup_move_move(mode)
if mode == MODE_MOVER
@index -= 1
@index = @items.size - 1 if @index < 0
elsif mode == MODE_MOVEL
@index += 1
@index = 0 if @index >= @items.size
else
return
end
@mode = mode
@steps = MOVING_FRAMES
end
#--------------------------------------------------------------------------
#
#--------------------------------------------------------------------------
def animation?
return @mode != MODE_WAIT
end
end
The other script:
#==============================================================================
# Window_MenuStatus
#==============================================================================
class Window_RingMenuStatus < Window_Base
#--------------------------------------------------------------------------
#
#--------------------------------------------------------------------------
STARTUP_FRAMES = 20 #
MOVING_FRAMES = 5 #
RING_R = 64 #
ICON_SKILL = RPG::Cache.icon("044-Skill01") #
ICON_EQUIP = RPG::Cache.icon("001-Weapon01") #
ICON_STATUS = RPG::Cache.icon("050-Skill07") #
ICON_SAVE = RPG::Cache.icon("038-Item07") #
ICON_EXIT = RPG::Cache.icon("046-Skill03") #
ICON_DISABLE= RPG::Cache.icon("") #
SE_STARTUP = "056-Right02" #
MODE_START = 1 #
MODE_WAIT = 2 #
MODE_MOVER = 3 #
MODE_MOVEL = 4 #
#--------------------------------------------------------------------------
#
#--------------------------------------------------------------------------
attr_accessor :index
#--------------------------------------------------------------------------
#
#--------------------------------------------------------------------------
def initialize( center_x, center_y )
actor=$game_party.actors[0]
if actor !=nil
bitmap = RPG::Cache.character(actor.character_name, actor.character_hue)
end
actor1=$game_party.actors[1]
if actor1 !=nil
bitmap1 = RPG::Cache.character(actor1.character_name, actor.character_hue)
end
actor2=$game_party.actors[2]
if actor2 !=nil
bitmap2 = RPG::Cache.character(actor2.character_name, actor.character_hue)
end
actor3=$game_party.actors[3]
if actor3 !=nil
bitmap3 = RPG::Cache.character(actor3.character_name, actor.character_hue)
end
super(0, 0, 640, 480)
self.contents = Bitmap.new(width-32, height-32)
self.contents.font.name = "Arial Black"
self.opacity = 0
self.back_opacity = 0
if $game_party.actors.size==4
s1 = actor.name
s2 = actor1.name
s3 = actor2.name
s4 = actor3.name
@commands = [ s1, s2, s3, s4]
else
if $game_party.actors.size==3
s1 = actor.name
s2 = actor1.name
s3 = actor2.name
@commands = [ s1, s2, s3]
else
if $game_party.actors.size==2
s1 = actor.name
s2 = actor1.name
@commands = [ s1, s2]
else
if $game_party.actors.size==1
s1 = actor.name
@commands = [ s1]
else
if $game_party.actors.size==0
@commands = [ ]
end
end
end
end
end
@item_max = 4
if actor3 ==nil
@item_max = 3
end
if actor2 ==nil and actor3 ==nil
@item_max = 2
end
if actor1 ==nil and actor2 ==nil and actor3 ==nil
@item_max = 1
end
if actor ==nil and actor1 ==nil and actor2 ==nil and actor3 ==nil
@item_max = 0
end
@index = 0
if $game_party.actors.size==4
@items = [ bitmap,bitmap1,bitmap2,bitmap3]
end
if $game_party.actors.size==3
@items = [ bitmap, bitmap1, bitmap2]
end
if $game_party.actors.size==2
@items = [ bitmap, bitmap1]
end
if $game_party.actors.size==1
@items = [ bitmap]
end
if $game_party.actors.size==0
@items = [ ]
end
@disabled = [ false, false, false, false, false, false ]
@cx = center_x - 16
@cy = center_y - 16
setup_move_start
refresh
end
#--------------------------------------------------------------------------
#
#--------------------------------------------------------------------------
def update
super
refresh
end
#--------------------------------------------------------------------------
#
#--------------------------------------------------------------------------
def refresh
self.contents.clear
# ---------------------
case @mode
when MODE_START
refresh_start
when MODE_WAIT
refresh_wait
when MODE_MOVER
refresh_move(1)
when MODE_MOVEL
refresh_move(0)
end
# ------------------
rect = Rect.new(@cx - 272, @cy + 24, self.contents.width-32, 32)
self.contents.draw_text(rect, @commands[@index],1)
end
#--------------------------------------------------------------------------
#
#--------------------------------------------------------------------------
def refresh_start
d1 = 2.0 * Math::PI / @item_max
d2 = 1.0 * Math::PI / STARTUP_FRAMES
r = RING_R - 1.0 * RING_R * @steps / STARTUP_FRAMES
for i in 0...@item_max
j = i - @index
d = d1 * j + d2 * @steps
x = @cx + ( r * Math.sin( d ) ).to_i
y = @cy - ( r * Math.cos( d ) ).to_i
draw_item(x, y, i)
end
@steps -= 1
if @steps < 1
@mode = MODE_WAIT
end
end
#--------------------------------------------------------------------------
#
#--------------------------------------------------------------------------
def refresh_wait
d = 2.0 * Math::PI / @item_max
for i in 0...@item_max
j = i - @index
x = @cx + ( RING_R * Math.sin( d * j ) ).to_i
y = @cy - ( RING_R * Math.cos( d * j ) ).to_i
draw_item(x, y, i)
end
end
#--------------------------------------------------------------------------
#
#--------------------------------------------------------------------------
def refresh_move( mode )
d1 = 2.0 * Math::PI / @item_max
d2 = d1 / MOVING_FRAMES
d2 *= -1 if mode != 0
for i in 0...@item_max
j = i - @index
d = d1 * j + d2 * @steps
x = @cx + ( RING_R * Math.sin( d ) ).to_i
y = @cy - ( RING_R * Math.cos( d ) ).to_i
draw_item(x, y, i)
end
@steps -= 1
if @steps < 1
@mode = MODE_WAIT
end
end
#--------------------------------------------------------------------------
#
#--------------------------------------------------------------------------
def draw_item(x, y, i)
#p "x=" + x.to_s + " y=" + y.to_s + " i=" + @items
.to_s
cw = @items
.width / 4
ch = @items
.height / 9#4 pour taille normal
rect = Rect.new(0, 0, cw, ch)
if @index == i
self.contents.blt( x, y, @items
, rect )
if @disabled[@index]
self.contents.blt( x, y, ICON_DISABLE, rect )
end
else
self.contents.blt( x, y, @items
, rect, 128 )
if @disabled[@index]
self.contents.blt( x, y, ICON_DISABLE, rect, 128 )
end
end
end
#--------------------------------------------------------------------------
#
#--------------------------------------------------------------------------
def disable_item(index)
@disabled[index] = true
end
#--------------------------------------------------------------------------
#
#--------------------------------------------------------------------------
def setup_move_start
@mode = MODE_START
@steps = STARTUP_FRAMES
if SE_STARTUP != nil and SE_STARTUP != ""
Audio.se_play("Audio/SE/" + SE_STARTUP, 80, 100)
end
end
#--------------------------------------------------------------------------
#
#--------------------------------------------------------------------------
def setup_move_move(mode)
if mode == MODE_MOVER
@index -= 1
@index = @items.size - 1 if @index < 0
elsif mode == MODE_MOVEL
@index += 1
@index = 0 if @index >= @items.size
else
return
end
@mode = mode
@steps = MOVING_FRAMES
end
#--------------------------------------------------------------------------
#
#--------------------------------------------------------------------------
def animation2?
return @mode != MODE_WAIT
end
end
Logged
Ben
Some dude
Staff
Royal
Posts: 4,844
butts
(No subject)
«
Reply #1 on:
April 22, 2007, 08:45:03 PM »
Im glad to see people posting scripts.
But I gotta say, it looks (edit: nearly) EXACTLY like one I saw made on another forum. By Somebody who isn't you.Im not saying you didn't make it...But I am saying that IF you didn't, please dont assume credit for it.
Please, if credit is due, Give it.
And if you DID make this, then brag about it a lil....theres like, zero ruby scripters here these days
Logged
DragonBlaze
A Wild DB Appeared!
Royal
Posts: 3,329
(No subject)
«
Reply #2 on:
April 23, 2007, 02:37:08 AM »
Yeah, I doubt you made this since I saw very simular scripts out there, anyway, DO NOT post other peoples scirpts, tutorials, graphics, or anything without giving them credit, and if you don't know who made it, at least say that YOU didnt make it.
If you did make it, sorry.
Logged
Hell Yeah! Just recovered all my old rm2k/3 games from my 10 year old, broken laptop hard drive that had been formatted and had a new OS installed on it. Oh, and I did all of this from my phone. WIN
Dele
Maker of um... Stuff.
Initiate
Posts: 49
(No subject)
«
Reply #3 on:
May 02, 2007, 03:58:57 AM »
Quote
Originally posted by lucas_irineu
Its very easy
Doesn't look like it... >.>;
Logged
Sig edited by me, original artist Lasaro.
"Cry not for what I am, cry for what I have become..."
-Kaijji
Luminus v1.2
Ben
Some dude
Staff
Royal
Posts: 4,844
butts
(No subject)
«
Reply #4 on:
May 02, 2007, 04:28:03 AM »
It dosent get much easier. Copy it (CTRL + C) and then go into your scripts editor.
Right click "Main"
Select Paste.
Youre done.
Ruby is beautifull.
I can hardly wait for 3.0 and quote/script boxes
and a scripts section
Logged
A Forgotten Legend
Your neighborhood box of colors
Royal
Posts: 4,428
(No subject)
«
Reply #5 on:
May 02, 2007, 08:14:54 PM »
...i may help it you set it so they won't turn to smilies?
Or get rid of the similes if you put them there.
Logged
Print
Pages: [
1
]
« previous
next »
Charas-Project
»
Game Creation
»
Requests
»
RPG Maker Programming
»
Ring Menu in RPG Maker XP