查看: 1378|回复: 2

[已经解决] 求教一下制作地面机关的问题

[复制链接]
梦石
0
星屑
2019
在线时间
940 小时
注册时间
2015-10-26
回帖
293

开拓者

发表于 2016-7-13 13:11:53 | 显示全部楼层 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有账号?注册会员

×
我想在迷宫里做一个机关,就是每隔几秒在某个地点冒个地刺出来,然后又缩回去,如果冒出来的时候人正好站在上面就会受伤
怎么设置都不行,特地求教一下,怎么弄这个……
梦石
0
星屑
2116
在线时间
950 小时
注册时间
2015-7-16
回帖
692

开拓者

发表于 2016-7-13 15:42:41 | 显示全部楼层
首先你需要這個腳本
然後!

設定兩個事件,一個是並行處理,一個是你的陷阱
並行處理使用腳本 輸入$game_self_switches[[地圖編號 , 陷阱事件編號 , "獨立開關"]] = true
打開你陷阱的獨立開關,假設是獨立開關A  會是令人受傷的尖刺,那麼 輸入 $game_self_switches[[地圖編號 , 陷阱事件編號 , "A"]] = true
假設這是第1張地圖,陷阱是第2個事件,那就 輸入 $game_self_switches[[1 , 2 , "A"]] = true
執行完畢後,接著等待幾秒(看你),再次使用腳本 輸入 $game_self_switches[[地圖編號 , 陷阱事件編號 , "A"]] = false
這樣就會關閉獨立開關A

設定好以後,我們回來看看陷阱,獨立開關A還沒打開時,陷阱不會害人,打開則反之



[pre lang="ruby"]#-------------------------------------------------------------------------------
# * Khas Self Switches
#-------------------------------------------------------------------------------
# * By Khas Arcthunder
# * Version: 1.0
# * Released on: 11/09/2012
#
# * Blog: http://arcthunder.com/
# * Forum: http://rgssx.com/
# * Twitter: http://twitter.com/arcthunder
# * Youtube: http://youtube.com/user/darkkhas
#
#-------------------------------------------------------------------------------
# Terms of Use | Termos de Uso
#-------------------------------------------------------------------------------
# * ENGLISH
# Read updated terms of use at http://arcthunder.com/terms
#
# * PORTUGUES
# Leia os termos atualizados em http://arcthunder.com/termos
#
#-------------------------------------------------------------------------------
# How to use - English Instructions
#-------------------------------------------------------------------------------
# You can use Call Script with the following commands:
#
# Switch_Core.toggle(event_id,switch)
# Toggle a switch. If it's ON, this command will turn it to OFF. And if it's
# OFF, this command will turn it to ON.
# event_id -> The ID of the event
# switch -> Can be "A", "B", "C" or "D"
#
# Switch_Core.toggle(event_id,switch,map_id)
# Toggle a switch. If it's ON, this command will turn it to OFF. And if it's
# OFF, this command will turn it to ON.
# event_id -> The ID of the event
# switch -> Can be "A", "B", "C" or "D"
# map_id -> ID of the map
#
# Switch_Core.turn_on(event_id,switch)
# Turn ON command.
# event_id -> The ID of the event
# switch -> Can be "A", "B", "C" or "D"
#
# Switch_Core.turn_on(event_id,switch,map_id)
# Turn ON command.
# event_id -> The ID of the event
# switch -> Can be "A", "B", "C" or "D"
# map_id -> ID of the map
#
# Switch_Core.turn_off(event_id,switch)
# Turn OFF command.
# event_id -> The ID of the event
# switch -> Can be "A", "B", "C" or "D"
#
# Switch_Core.turn_off(event_id,switch,map_id)
# Turn OFF command.
# event_id -> The ID of the event
# switch -> Can be "A", "B", "C" or "D"
# map_id -> ID of the map
#
# Switch_Core.set(event_id,switch,value)
# Set command. If value is true, it will be turned ON. If value is false,
# it will be turned OFF.
# event_id -> The ID of the event
# switch -> Can be "A", "B", "C" or "D"
# value -> Can be true or false
#
# Switch_Core.set(event_id,switch,value,map_id)
# Set command. If value is true, it will be turned ON. If value is false,
# it will be turned OFF.
# event_id -> The ID of the event
# switch -> Can be "A", "B", "C" or "D"
# value -> Can be true or false
# map_id -> ID of the map
#
#-------------------------------------------------------------------------------
#
# Switch_Core.toggle_all(event_id)
# Toggle all the event's self switches.
# event_id -> The ID of the event
#
# Switch_Core.toggle_all(event_id,map_id)
# Toggle all the event's self switches.
# event_id -> The ID of the event
# map_id -> ID of the map
#
# Switch_Core.turn_on_all(event_id)
# Turn ON all the event's self switches.
# event_id -> The ID of the event
#
# Switch_Core.turn_on_all(event_id,map_id)
# Turn ON all the event's self switches.
# event_id -> The ID of the event
# map_id -> ID of the map
#
# Switch_Core.turn_off_all(event_id)
# Turn OFF all the event's self switches.
# event_id -> The ID of the event
#
# Switch_Core.turn_off_all(event_id,map_id)
# Turn OFF all the event's self switches.
# event_id -> The ID of the event
# map_id -> ID of the map
#
# Switch_Core.set_all(event_id,value)
# Set all command. If value is true, all self switches will be turned ON. If  
# value is false, all self switches will be turned OFF.
# event_id -> The ID of the event
# value -> Can be true or false
#
# Switch_Core.set_all(event_id,value,map_id)
# Set all command. If value is true, all self switches will be turned ON. If  
# value is false, all self switches will be turned OFF.
# event_id -> The ID of the event
# value -> Can be true or false
# map_id -> ID of the map
#
#-------------------------------------------------------------------------------
# Como usar - Instruções em Português
#-------------------------------------------------------------------------------
# Você pode usar o Chamar Script com os seguintes comandos:
#
# Switch_Core.toggle(event_id,switch)
# Alterna o switch. Se ele estiver ligado, será então desligado. Se ele estiver
# ligado, será então desligado.
# event_id -> O ID do evento
# switch -> Pode ser "A", "B", "C" ou "D"
#
# Switch_Core.toggle(event_id,switch,map_id)
# Alterna o switch. Se ele estiver ligado, será então desligado. Se ele estiver
# ligado, será então desligado.
# event_id -> O ID do evento
# switch -> Pode ser "A", "B", "C" ou "D"
# map_id -> ID do Mapa
#
# Switch_Core.turn_on(event_id,switch)
# Comando que liga o switch.
# event_id -> O ID do evento
# switch -> Pode ser "A", "B", "C" ou "D"
#
# Switch_Core.turn_on(event_id,switch,map_id)
# Comando que liga o switch.
# event_id -> O ID do evento
# switch -> Pode ser "A", "B", "C" ou "D"
# map_id -> ID do Mapa
#
# Switch_Core.turn_off(event_id,switch)
# Comando que desliga o switch.
# event_id -> O ID do evento
# switch -> Pode ser "A", "B", "C" ou "D"
#
# Switch_Core.turn_off(event_id,switch,map_id)
# Comando que desliga o switch.
# event_id -> O ID do evento
# switch -> Pode ser "A", "B", "C" ou "D"
# map_id -> ID do Mapa
#
# Switch_Core.set(event_id,switch,value)
# Comando que ajusta o switch. Se value for true, o switch será ligado. Se
# value for false, o switch será desligado.
# event_id -> O ID do evento
# switch -> Pode ser "A", "B", "C" ou "D"
# value -> Pode ser true ou false
#
# Switch_Core.set(event_id,switch,value,map_id)
# Comando que ajusta o switch. Se value for true, o switch será ligado. Se
# value for false, o switch será desligado.
# event_id -> O ID do evento
# switch -> Pode ser "A", "B", "C" ou "D"
# value -> Pode ser true ou false
# map_id -> ID do Mapa
#
#-------------------------------------------------------------------------------
#
# Switch_Core.toggle_all(event_id)
# Alterna todos os switches locais do evento.
# event_id -> O ID do evento
#
# Switch_Core.toggle_all(event_id,map_id)
# Alterna todos os switches locais do evento.
# event_id -> O ID do evento
# map_id -> ID do Mapa
#
# Switch_Core.turn_on_all(event_id)
# Liga todos os switches do evento.
# event_id -> O ID do evento
#
# Switch_Core.turn_on_all(event_id,map_id)
# Liga todos os switches do evento.
# event_id -> O ID do evento
# map_id -> ID do Mapa
#
# Switch_Core.turn_off_all(event_id)
# Desliga todos os switches do evento.
# event_id -> O ID do evento
#
# Switch_Core.turn_off_all(event_id,map_id)
# Desliga todos os switches do evento.
# event_id -> O ID do evento
# map_id -> ID do Mapa
#
# Switch_Core.set_all(event_id,value)
# Ajusta todos os switches do evento.
# event_id -> O ID do evento
# value -> Pode ser true ou false
#
# Switch_Core.set_all(event_id,value,map_id)
# Ajusta todos os switches do evento.
# event_id -> O ID do evento
# value -> Pode ser true ou false
# map_id -> ID do Mapa
#
#-------------------------------------------------------------------------------
# Script
#-------------------------------------------------------------------------------
module Switch_Core
  Switch_Array = ["A","B","C","D"]
  def self.toggle(ei,si,mi=$game_map.map_id)
    $game_self_switches[[mi,ei,si]] = !$game_self_switches[[mi,ei,si]]
  end
  def self.turn_on(ei,si,mi=$game_map.map_id)
    $game_self_switches[[mi,ei,si]] = true
  end
  def self.turn_off(ei,si,mi=$game_map.map_id)
    $game_self_switches[[mi,ei,si]] = false
  end
  def self.set(ei,si,pi,mi=$game_map.map_id)
    $game_self_switches[[mi,ei,si]] = pi
  end
  def self.toggle_all(ei,mi=$game_map.map_id)
    Switch_Array.each {|key| toggle(ei,key,mi)}
  end
  def self.turn_on_all(ei,mi=$game_map.map_id)
    Switch_Array.each {|key| turn_on(ei,key,mi)}
  end
  def self.turn_off_all(ei,mi=$game_map.map_id)
    Switch_Array.each {|key| turn_off(ei,key,mi)}
  end
  def self.set_all(ei,pi,mi=$game_map.map_id)
    Switch_Array.each {|key| set(ei,key,pi,mi)}
  end
end[/pre]

评分

参与人数 1梦石 +1 收起 理由
丿梁丶小柒 + 1 认可答案

查看全部评分

[神性领域扩张:扩张神性领域]
说了等于没说.
回复

使用道具 举报

梦石
0
星屑
2019
在线时间
940 小时
注册时间
2015-10-26
回帖
293

开拓者

 楼主| 发表于 2016-7-14 07:56:57 | 显示全部楼层
duzine 发表于 2016-7-13 15:42
首先你需要這個腳本
然後!

谢谢啦~~
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部