赞 | 0 |
VIP | 0 |
好人卡 | 2 |
积分 | 3 |
经验 | 6114 |
最后登录 | 2013-9-3 |
在线时间 | 371 小时 |
Lv2.观梦者
- 梦石
- 0
- 星屑
- 334
- 在线时间
- 371 小时
- 注册时间
- 2010-8-23
- 帖子
- 418
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
本帖最后由 勇敢的馒头 于 2013-7-7 14:10 编辑
使用了美兽的 提取放置物脚本
http://rpg.blue/thread-50278-1-1.html
正常使用没有问题,只是现在想 控制事件 的朝向
求帮忙修改脚本,添加一个提取出的可控制事件的朝向的功能
或求思路如何实现
万分谢谢
带上附件
Project70.rar
(188.69 KB, 下载次数: 31)
脚本在此- module Drop_Item
- def self.make_events(map_id,event_id,item_x,item_y,save=false)
- return unless self.is_map?
- map = self.map_data_load(map_id)
- temp = Marshal.load(Marshal.dump(map))
- if !$game_system.map_events_number
- $game_system.map_events_number = {}
- end
- sum = $game_system.map_events_number
- m_id = $game_map.map_id
- sum[m_id] == nil ? sum[m_id] = 2000 : sum[m_id] += 1
- new_event_id = sum[m_id]
- temp.events[event_id].id = new_event_id
- temp.events[event_id].x,temp.events[event_id].y = item_x,item_y
- $game_map.events[new_event_id] = Game_Event.new(m_id,temp.events[event_id])
- if save
- now_map = self.map_data_load(m_id)
- now_map.events[new_event_id] = temp.events[event_id]
- self.map_data_save(m_id,now_map)
- end
- refresh_map
- end
-
- def self.map_data_init
- for i in 1..999
- begin
- map = load_data(sprintf("Data/Map%03d.rxdata", i))
- rescue Errno::ENOENT
- next
- end
- $game_system.map_data[i] = Marshal.load(Marshal.dump(map))
- end
- end
- def self.map_data_save(map_id,event)
- $game_system.map_data[$game_map.map_id] = event
- end
- def self.map_data_load(map_id)
- if !$game_system.map_data
- $game_system.map_data = {}
- self.map_data_init
- end
- return $game_system.map_data[map_id]
- end
-
- def self.refresh_map
- return unless self.is_map?
- $scene.spriteset.dispose
- $scene.spriteset = Spriteset_Map.new
- end
- def self.is_map?
- (return true) if $scene.is_a?(Scene_Map)
- return false
- end
- end
- class Game_Map
- def setup(map_id)
- @map_id = map_id
- @map = Drop_Item.map_data_load(@map_id)
- tileset = $data_tilesets[@map.tileset_id]
- @tileset_name = tileset.tileset_name
- @autotile_names = tileset.autotile_names
- @panorama_name = tileset.panorama_name
- @panorama_hue = tileset.panorama_hue
- @fog_name = tileset.fog_name
- @fog_hue = tileset.fog_hue
- @fog_opacity = tileset.fog_opacity
- @fog_blend_type = tileset.fog_blend_type
- @fog_zoom = tileset.fog_zoom
- @fog_sx = tileset.fog_sx
- @fog_sy = tileset.fog_sy
- @battleback_name = tileset.battleback_name
- @passages = tileset.passages
- @priorities = tileset.priorities
- @terrain_tags = tileset.terrain_tags
- @display_x = 0
- @display_y = 0
- @need_refresh = false
- @events = {}
- for i in @map.events.keys
- @events[i] = Game_Event.new(@map_id, @map.events[i])
- end
- @common_events = {}
- for i in 1...$data_common_events.size
- unless $data_common_events[i].trigger == 0
- @common_events[i] = Game_CommonEvent.new(i)
- end
- end
- @fog_ox = 0
- @fog_oy = 0
- @fog_tone = Tone.new(0, 0, 0, 0)
- @fog_tone_target = Tone.new(0, 0, 0, 0)
- @fog_tone_duration = 0
- @fog_opacity_duration = 0
- @fog_opacity_target = 0
- @scroll_direction = 2
- @scroll_rest = 0
- @scroll_speed = 4
- end
- end
- class Game_System
- attr_accessor :map_events_number
- attr_accessor :map_data
- end
- class Scene_Map
- attr_accessor :spriteset
- end
复制代码 |
|