じ☆ve冰风 发表于 2024-4-19 21:18:00

【脚本】事件复制

有没有想过要用把A地图的事件复制到B地图上过呢?
还是把A地图上的某事件复制出N个呢?
或是复制完的脚本想要保存在地图上呢?
现在有了事件复制脚本,以上问题皆可解决!!!

p.s.使用方式自行看脚本的注解

某月某日修了某個bug....#========================================================#★ 事件複製 -by joe59491#========================================================#========參數設定========================================$Eve_Control = 18#是否要關閉自動回復地圖上的事件的開關編號#========================================================#========使用說明========================================#複製事件#Eve_To_Map.new(新X座標,新Y座標,複製事件所在地圖的編號,複製事件編號)#新事件编号是从200开始算起的,如果你这张地图内有超过200普通事件,会爆,记得改一下下面的脚本#预设一张图最多复制100个事件(够多了吧?)#刪除事件(全部,針對複製的)#Dis_Eve.new#儲存事件(非自動,針對複製的)#Save_Eve.new #讀取事件(非自動,針對複製的)#Load_Eve.new#p.s. 當開關關閉時,會事件會被保留,否則會消失。#========================================================class Game_Characterattr_accessor   :id                     # IDendclass Eve_To_Mapdef initialize(x, y, map_id, eve_id)    map = load_data(sprintf("Data/Map%03d.rxdata", map_id))    #p map.events    for i in 200..300      if $game_map.events == nil      $game_map.events = Game_Event.new($game_map.map_id, map.events)      $game_map.events.moveto(x,y)      $game_map.events.id=i      $scene.spriteset.dispose      $scene.spriteset = Spriteset_Map.new      break      end    end      endendclass Game_Mapattr_accessor :SEvealias initialize_seve initializedef initialize    @SEve=    initialize_seveendalias update_seve updatedef update      if $game_map.need_refresh    #p      endupdate_seveendendclass Save_Evedef initialize    $game_map.SEve[$game_map.map_id]=    for i in 200..300      if $game_map.events != nil      $game_map.SEve[$game_map.map_id] = $game_map.events      end    end      endendclass Load_Evedef initialize    if $game_map.SEve[$game_map.map_id]!=nil      for i in 0..100      if $game_map.SEve[$game_map.map_id] != nil and $game_map.SEve[$game_map.map_id] != 0          $game_map.events=$game_map.SEve[$game_map.map_id]      end      end      $scene.spriteset = Spriteset_Map.new    endendendclass Dis_Evedef initialize    for i in 200..300      if $game_map.events != nil      $game_map.events.erase      end    end    endendclass Interpreteralias command_201_seve command_201def command_201    if !$game_switches[$Eve_Control]      Save_Eve.new    end    command_201_seveendendclass Scene_Mapattr_accessor :spritesetalias transfer_player_seve transfer_playerdef transfer_player      transfer_player_seve    if !$game_switches[$Eve_Control]      Load_Eve.new      endendend复制代码
             本帖来自P1论坛作者joe5491,因Project1站服务器在国外有时候访问缓慢不方便作者交流学习,经联系P1站长fux2同意署名转载一起分享游戏制作经验,共同为国内独立游戏作者共同创造良好交流环境,原文地址:https://rpg.blue/forum.php?mod=viewthread&tid=303868若有侵权,发帖作者可联系底部站长QQ在线咨询功能删除,谢谢。
页: [1]
查看完整版本: 【脚本】事件复制