以下引用jackxiao于2008-6-25 18:29:40的发言:
你仿佛多打了一个等号。你忘记刷新了。
要改成这样:
$game_switches[1] = true
if $game_switches[1] = true
$game_switches[2] = true
end
$game_map.need_refresh = true
[本贴由作者于 2008-6-25 18:32:29 最后编辑]
$game_switches[1] = true
if $game_switches[1] == true
$game_switches[2] = true
end
p $game_switches[2]
以下引用jackxiao于2008-6-25 18:40:35的发言:
不会是半角全角之类的吧。ms不会这样
以下引用jackxiao于2008-6-25 18:51:12的发言:
只能在事件中写,或者重新定域一个。
例如:在Scene_Map中def main后加上去。
[本贴由作者于 2008-6-25 18:54:33 最后编辑]
class Scene_Menu
alias o_main main
def main
$game_switches[1] = true
o_main
end
alias o_update_command update_command
def update_command
o_update_command
if Input.trigger?(Input::B)
$game_switches[1] = false
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Map.new
return
end
end
end
以下引用jackxiao于2008-6-25 21:06:49的发言:
菜单画面
是指标题画面还是按esc出来的?
如果是标题画面加在Scene_Title里
如果是按esc出来的加在Scene_Menu里。
class Game_Event
attr_accessor :flag
end
class Game_Map
#--------------------------------------------------------------------------
# ● 检查鼠标处是否有自定义的事件并返回类型
#--------------------------------------------------------------------------
def check_event_custom(mouse_x, mouse_y)
for event in $game_map.events.values #循环所有事件检查
event_width = RPG::Cache.character(event.character_name,event.character_hue).width / 4
event_height = RPG::Cache.character(event.character_name,event.character_hue).height / 4
if mouse_x > event.screen_x - event_width / 2 and mouse_x < event.screen_x + event_width / 2 and mouse_y + 32 > event.screen_y + 32 - event_height and mouse_y + 32 < event.screen_y + 32
for i in 0...event.list.size
if event.list.parameters[0] == "Item" #类型判断
event.flag = 1
elsif event.list.parameters[0] == "Npc" #类型判断
event.flag = 2
else
event.flag = 0 if $game_player.get_mouse_sta != 2 #无标志
end
return event.flag #返回事件类型标志
end
end
end
return 0 if $game_player.get_mouse_sta != 2 #如果不是在跟随鼠标状态,则返回无标志
return $mouse_icon_id #使鼠标图不变化
end
#--------------------------------------------------------------------------
# ● 检查鼠标处是否有事件可以开启
#--------------------------------------------------------------------------
def check_event_custom_start(mouse_x, mouse_y)
for event in $game_map.events.values #循环所有事件检查
#事件角色图片宽度、高度
event_width = RPG::Cache.character(event.character_name,event.character_hue).width/4
event_height = RPG::Cache.character(event.character_name,event.character_hue).height/4
#判断是否鼠标在事件上
if mouse_x > event.screen_x - event_width / 2 and mouse_x < event.screen_x + event_width / 2 and mouse_y + 32 > event.screen_y + 32 - event_height and mouse_y + 32 < event.screen_y + 32
way_x = $game_player.x - event.x
way_y = $game_player.y - event.y
if ([1, -1].include?($game_player.x-event.x) and $game_player.y-event.y == 0) or ([1, -1].include?($game_player.y-event.y) and $game_player.x-event.x == 0)
for i in 0...event.list.size
if ["Item","Npc"].include?(event.list.parameters[0]) #当事件属于自定义事件
#判断主角朝向
if way_x == -1
p_direction = 6 if way_y == 0
elsif way_x == 0
p_direction = 2 if way_y == -1
p_direction = 8 if way_y == 1
else
p_direction = 4 if way_y == 0
end
event.start #开启事件
return 1, p_direction #返回即将开启事件以及角色朝向
end
end
end
end
end
return 0, 5 #返回不会开启事件以及角色朝向不变
end
以下引用jackxiao于2008-6-25 18:45:09的发言:
你在哪里写脚本的?
欢迎光临 Project1 (https://rpg.blue/) | Powered by Discuz! X3.1 |