Group: Member
Posts: 19
Type: Artist
RM Skill: Skilled
I have been using FlipelyFlip's Cloning Event System. I'm not sure if it's okay to be modified though, although I'll lovingly credit those who help me with the modifications just in case, and nothing will be on me.
If you are familiar with Sky00Valentine's Decoration script, the event cloning goes along with it. I only need its "removal" feature for erasing events from the map permanently. And then, the Cloning Script would not update! When you enter another map and go back, the cloned events are gone. All these problems have been fixed in the Decoration script, but I don't know which or what part of it does that XD
Can anyone please help? Thank you! I hope it's also possible if they are explained to me so I know what to do the second time around. :)
Here is the script that I use at the moment:
FlipelyFlip's Event Cloning Script
#======================================================================== = ===== # ** Events Cloning Script V1.1 #------------------------------------------------------------------------------ # by FlipelyFlip #------------------------------------------------------------------------------ # thx goes to: Kread-EX #============================================================================== =begin This little script allows you to copy an event from another map to set it on the located coordinates. You can also call it by variables. You have to config the Variables under the module Flipely. So you can set the x and y coordinate at the variables to random. If the coordinates are on an impassable place, they will be set one place right and one place down. If this place is also impassable, it will add again the one place right and one place down. This Feature is only at the variable available.
To call the script you can chose between $game_map.add_event(map_id,event_id,x,y)
or you will do it with variables, then you have to set up the variables before calling it with Flipely.koordinaten .
greetings FlipelyFlip =end
class Spriteset_Map def refresh $game_map.need_refresh = true unless @character_sprites == nil for sprite in @character_sprites sprite.dispose end end @character_sprites = [] for i in $game_map.events.keys.sort sprite = Sprite_Character.new(@viewport1, $game_map.events[i]) @character_sprites.push(sprite) end @character_sprites.push(Sprite_Character.new(@viewport1, $game_player)) end end
class Game_Map def add_event(map_id,id,x,y) s = 1 (1..@events.size + 1).each{|s|break unless @events.keys.include?(s)} map = load_data(sprintf("Data/Map%03d.rvdata", map_id)) ev = map.events[id] ev.id = s @events[s] = Game_Event.new(@map_id, ev) @events[s].moveto(x, y) return @events[s].id end end
module Flipely def self.passable? return $game_map.passable?($game_variables[id], $game_variables[id], flag = 0x01) end end
module Flipely def self.koordinaten if Flipely.passable? == true $game_map.add_event($game_variables[id],$game_variables[id],$game_variables[id],$game_variables[id]) $scene = Scene_Map.new else $game_variables[id] += 1 # change it if you want $game_variables[id] += 1 # change it if you want Flipely.koordinaten end end end
And here's Sky's Deco Script:
Sky00Valentine's Decoration Script
#======================================================================== === # # Sky's Room Decoration System(Upgraded Event Cloning by Flipelyflip) # Version 1.1 # July 8th, 2010 Started # July 14th, 2010 Completed # #=========================================================================== # # Features : # Version 1.0 - (July 14th, 2010) # - Full Wall Decoration Compatibility. # - Floor Tiles # * Graphics that are larger than 1 tile will # only work if they are able to be walked # over. (meaning things like tables won't # work unless you don't mind being able to # walk over it.) So you can use them but # it will just look like a glitch in your # game # - Currently unable to place one event on top # of the other. # - Currently Doors are unable to be placed with # a 100% glitch look as they could be place # high up on a wall. # - In decoration menu you can preview what the # decoration will look like. # - Because of this being event clones if you # make a decoration event with stuff to do # the decoration will also do that when # activated. # Version 1.1 - (July 15th, 2010) # - Bug fixes # *Maps not saving decorations fixed. # #=========================================================================== # # Credit # Sky00Valentine :creator and editor # Flipelyflip :for creating the original event clone script # #=========================================================================== # # Terms of Use # ------------ # # Crediting Rpgmakervx.net and FlipelyFlip # is the only thing I ask. However feel free # to credit Sky00Valentine if you see fit. # #=========================================================================== # # Future improvement # ------------------ # # - Adding Full Functioning Floor tiles including Tables. # - Adding in more ways for setup including but not limited to # Hash Mode, which will be you editting the hash instead of # item noteboxes. # #=========================================================================== # # Instructions & Installation # --------------------------- # - Get Flipelyflips Event Cloning Script, place under materials # # - Get $model_cursor.png(located in demo) # # - Place this script under Event Cloning Script # # - Edit MAP_ID hash by placing in all map_id's you want to have # decoration mode. (This should only include inside maps.) As I did # not make this for outside so there may be some glitches. # # - Edit Event Map, change it to the map id where you will store all of # your decoration evetns. # # - Edit Wall_Map, change it to the map id where you will store all of # your wall tiles.(This is so you can place items on walls. # # - Edit the three Buttons to be which buttons you want to press # to do the given function. By default they will be the A # key to enter into edit mode, S to change from Placement to Removal mode # and Vice-Versa, X key to go into the decoration Menu, and Enter # or Z key to place or remove a decoration. (X key is the only one not # customizable) # # - To setup your items go to your item notebox and place this # Decoration:event_id: where event id is the event you want # to be placed on the map when using that decoration/item. # You will need that item in your party's inventory in order # to place that decoration in placement mode. # You will lose 1 of that item each time you place 1 of that # decoration. And you will gain 1 each time you remove a # decoration from the map. # Also you must put this in an items notebox as well, # <WALL> if you want that decoration to be placed # on the wall, and <FLOOR> if you want it to be placed on # the floor. # # - Make sure you have created the event map and the wall map. # Following the model. # # - Make sure on the Event Map your first event is a blank event # no graphic and priority is set to same as characters. # #=========================================================================== # # Compatibility & Bugs # -------------------- # - Through aliasing this script should be 100% Compatible with # any script. # #============================================================================
module Sky module Decor MAP_ID = [4,5] # all map id's that you can Enter Decoration Mode on. #example MAP_ID = [3,5,6] Can only decorate maps 3,5, and 6
Event_Map = 2 #Map ID of the stored events map. #you store all decoration events on this map
Wall_Map = 1 #Map ID of your wall tiles map. #you store all you wall tiles here on this map.
Button0 = Input::X #The button you want to press to enter decoration mode Button1 = Input::C #The button you want to press to place/remove decorations Button2 = Input::Y #The button you want to press to change to place or remove mode.
alias new_setup setup def setup(map_id) new_setup(map_id) @new_events = {} if $resaved_maps.include?(@map_id) @new_events = $resaved_maps[@map_id] @new_events = {} if @new_events == nil new_event_setup end end
def new_event_setup for i in @new_events.keys @events[i] = Game_Event.new(@map_id, @new_events[i][0]) @events[i].moveto(@new_events[i][1], @new_events[i][2]) @events[i].d_tag = @new_events[i][3] @events[i].item = @new_events[i][4] end end
def add_new(event_id,cevent,x,y,d_tag,item) @new_events[event_id] = [cevent,x,y,d_tag,item] $resaved_maps[@map_id] = @new_events end
alias block_transfers_setup setup_events def setup_events block_transfers_setup @transfers = [] for i in @map.events.keys if @map.events[i].name == "transfer" @transfers.push(i) end end end
def return_location(x,y,direction) @return_to_x = x @return_to_y = y @return_direction = direction end
def return_to $game_player.set_direction(@return_direction) $game_player.moveto(@return_to_x,@return_to_y) end
def delete_event(event_id) if @events[event_id].item != nil $game_party.gain_item($data_items[@events[event_id].item], 1) end @events.delete(event_id) @new_events.delete(event_id) $scene = Scene_Map.new end
def blocking_events return @blocking_events end
def edit_mode(switch) @previous_mode = @editing @editing = switch if @previous_mode != @editing and not @editing placement_mode(true) end end
def edit_mode? return @editing end
def placement_mode? return @placement end
def placement_mode(mode) @previous_mode = @placement @placement = mode if @previous_mode != @placement and not @placement @c_through = [] end if not @placement for i in @events.keys if not @events[i].through @c_through.push(i) @events[i].through = true end end else for i in @events.keys if @c_through.include?(i) @events[i].through = false end end end end
def change_passibility(map_id,x,y) nmap = load_data(sprintf("Data/Map%03d.rvdata",map_id)) tile_id = nmap.data[x,y,0] @changed_tiles[tile_id] = @passages[tile_id] if @passages[tile_id] != 0x00 @passages[tile_id] = 0x00 end
def restore_passage for i in @changed_tiles.keys @passages[i] = 0x01 end refresh end
def add_event(map_id,id,x,y,cg=false) s = 1 (1..@events.size + 1).each{|s|break unless @events.keys.include?(s)} map = load_data(sprintf("Data/Map%03d.rvdata", map_id)) ev = map.events[id] ev.id = s if events_xy(x, y).empty? or (events_xy(x,y)[0].event.name == "transfer" and events_xy(x,y).size == 1) if cg @events[s] = Game_Event.new(@map_id,ev,true) @blocking_events.push(@events[s].id) else @events[s] = Game_Event.new(@map_id, ev) @events[s].d_tag = 1 unless @transfers.include?(@events[s].id) @events[s].item = $game_party.last_decoration unless @transfers.include?(@events[s].id) $game_party.lose_item($data_items[@events[s].item], 1) unless @transfers.include?(@events[s].id) end @events[s].moveto(x, y) add_new(s,ev,x,y,@events[s].d_tag,@events[s].item) return @events[s].id end end end
class Scene_Map
alias new_window start def start new_window unless $cd == nil or $cd.disposed? $cd.dispose end if $game_map.edit_mode? update_current_decoration_window end end
def update_current_decoration_window $cd = Window_Base.new(0,0,190,88) if $cd == nil or $cd.disposed? $cd.contents.clear $cd.opacity = 100 if $game_party.last_decoration > 0 decoration = "#{$data_items[$game_party.last_decoration].name}" else decoration = "None selected" end if $game_map.placement_mode? mode = "Placement Mode" else mode = "Removal Mode" if $game_map.events_xy($game_player.x,$game_player.y).size > 0 and $game_map.events_xy($game_player.x, $game_player.y)[0].item != nil decoration = $data_items[$game_map.events_xy($game_player.x, $game_player.y)[0].item].name else decoration = "" end end $cd.contents.draw_text(0,0,158,24,mode,1) $cd.contents.draw_text(0,32,158,24,decoration,1) end
alias extra_event_update update def update extra_event_update unless $game_message.visible if Sky::Decor::MAP_ID.include?($game_map.map_id) if Input.trigger?(Sky::Decor::Button0) if $game_map.edit_mode? $game_party.members[0].set_graphic($game_party.previous_character, $game_party.previous_index,$game_party.members[0].face_name, $game_party.members[0].face_index) for i in 0...$game_map.blocking_events.size $game_map.delete_event($game_map.blocking_events[i]) end $game_map.blocking_events.clear $game_map.restore_passage $game_map.return_to $game_map.edit_mode(false) else $game_map.add_event(Sky::Decor::Event_Map,1,$game_player.x,$game_player.y,true) $game_map.return_location($game_player.x,$game_player.y,$game_player.direction) $scene = Scene_Map.new $game_party.set_previous($game_party.members[0].character_name,$game_party.members[0].character_index) $game_party.members[0].set_graphic("$Model Cursor",0,$game_party.members[0].face_name,$game_party.members[0].face_index) for i in 0...$game_map.transfers.size enew_x = $game_map.events[$game_map.transfers[i]].event.x enew_y = $game_map.events[$game_map.transfers[i]].event.y $game_map.blocking_events.push($game_map.add_event(Sky::Decor::Event_Map,1,enew_x,enew_y)) end mapp = load_data(sprintf("Data/Map%03d.rvdata", Sky::Decor::Wall_Map)) for i in 0...mapp.width unless i % 4 == 0 for a in 0...mapp.height unless a % 4 == 0 $game_map.change_passibility(Sky::Decor::Wall_Map,i,a) end end end end $game_map.edit_mode(true) update_current_decoration_window end $game_player.refresh elsif Input.trigger?(Sky::Decor::Button2) if $game_map.edit_mode? if $game_map.placement_mode? $game_map.placement_mode(false) $cd.contents.clear unless $cd == nil or $cd.disposed? update_current_decoration_window else $game_map.placement_mode(true) $cd.contents.clear unless $cd == nil or $cd.disposed? update_current_decoration_window end end elsif Input.trigger?(Sky::Decor::Button1) if $game_map.edit_mode? if $game_map.placement_mode? enew_x = $game_player.x enew_y = $game_player.y tile_id = $game_map.data[enew_x,enew_y,0] unless not $game_party.has_item?($data_items[$game_party.last_decoration]) or $game_map.current_d_event_id == 0 if $game_map.changed_tiles.include?(tile_id) $game_map.add_event(Sky::Decor::Event_Map,($game_map.current_d_event_id), enew_x,enew_y) if $game_map.d_type == "Wall" else $game_map.add_event(Sky::Decor::Event_Map,($game_map.current_d_event_id), enew_x,enew_y) if $game_map.d_type == "Floor" end end $scene = Scene_Map.new else event = $game_map.events_xy($game_player.x,$game_player.y) unless event == nil or event.size == 0 $game_map.delete_event(event[event.size - 1].id) unless event[event.size - 1].d_tag == nil end end end end if $game_map.edit_mode? update_current_decoration_window end end end if not $game_party.has_item?($data_items[$game_party.last_decoration]) $game_party.last_decoration = 0 end end
alias insert_decoration_menu call_menu def call_menu unless $game_map.edit_mode? insert_decoration_menu else $game_temp.next_scene = nil $cd.opacity = 0 unless $cd == nil or $cd.disposed? $cd.contents_opacity = 0 unless $cd == nil or $cd.disposed? $scene = Scene_Decoration_Menu.new end end end
class Window_Decoration < Window_Selectable attr_accessor :data def initialize super(0,0,240,416) self.index = 0 refresh end
def item return @data[self.index] end
def decoration(item) return if item == nil notes = item.note notes.each_line{|x| return x[11,x.rindex(':') - 11]} end
def type(item) return if item == nil notes = item.note notes.each_line{|x| if x.include?("<WALL>") return "Wall" elsif x.include?("<FLOOR>") return "Floor" end } end
def refresh @data = [] for item in $game_party.items next unless include?(item) @data.push(item) if item.id == $game_party.last_decoration self.index = @data.size - 1 end end @data.push(nil) if @data.size == 0 @item_max = @data.size width = 0 for i in @data break if i == nil new_width = self.contents.text_size("#{i.name} ").width width = new_width if new_width > width end self.width = [240, width].max self.height = [page_row_max * WLH,@item_max * WLH].min + 32 create_contents for i in 0...@item_max draw_item(i) end end
def include?(item) return false if item == nil notes = item.note notes.each_line{|x| return true if x.include?("Decoration:")} return false end
def draw_item(index) rect = item_rect(index) item = @data[index] if item != nil number = $game_party.item_number(item) rect.width -= 4 draw_item_name(item, rect.x, rect.y) self.contents.draw_text(rect, sprintf(":%2d", number), 2) else rect.width -= 4 self.contents.draw_text(rect,"- None -",1) end end end
Group: Member
Posts: 19
Type: Artist
RM Skill: Skilled
EDIT: I've found a cure for my first problem. I'm going to use Jet's Move Event Snippet and I'll make further updates in case it worked or it did not. :3 Yehey!