#==============================================================================# #==============â–º Name: Portals â—„==============# #==============â–º Author: AmIMeYet â—„==============# #==============â–º Version: 1.1 â—„==============# #==============â–º Release: 13/02/09 (dd/mm/yy) â—„==============# #==============â–º Website: amimeyet.890m.com / amimeyet.nl.tp â—„==============# #==============================================================================# ##§Description::::: # This script adds a portal-gun/shooter to RPG Maker VX # #§Instructions:::: # All you need to do is look at the first lines of 'module Amimeyet_portals'; # Look for ###BASIC SETTINGS###.. that's where you want to edit.. # Look at the comments there to find out what to do. # # These are the settings: # SHOOT_B, SHOOT_R, REMOVE, CHECK, GUN_ID, START_SHOOTABLE, RANGE, # BULLET_SPEED # The default values are: # Input::X, Input::Z, Input::Y, 1, 31, true, 20, 6 # #§New in v1.1::::: # â—added BULLET_SPEED # â—fixed player from gettings stuck in wall # #§Bugs:::::::::::: # â—There may be no event ID missing in your map # (Example: 9 events.. but no event 3) # So say you create three events on a map.. and then delete the second, # instead of a portal erasing.. you erase the third event. # counteract this by cutting (Ctrl+X) and pasting (Ctrl+V) the last event, # (in this case the third), so that it gets an ID of '2'. # #§Special thanks:: # SephirothSpawn, # for his map data decrypter (a MUST HAVE to do this sort of thing) # http://www.rmxp.org/forums/viewtopic.php?f=7&t=60928 # #§Disclaimer:::::: # â—If you use this script on your game, you must credit me. # â—If you want to put this script on a website or forum, # you must ask me for permission. # â—You are free to use any graphics found in this demo, but, # you MUST ABSOLUTELY credit me. # â—Portal is a registered trademark of Valve Corporation # #§Advanced usage:: # Advanced settings: # â—Take a look at ###ADVANCED SETTINGS### # Functions: # â—Amimeyet_portals::erase(type) - "blue","red" - Erase the specified portals # â—Amimeyet_portals::teleport(type) - "blue","red" - Teleport to oposite portal # "blue" teleports player to red # "red" teleports player to blue # â—Amimeyet_portals::shoot(type) - "blue","red" - Launch specified portal # Aliases: # â—Game_System:initialize || Also added attr_accessor :shoot_enabled # â—Scene_Map:update # â—Scene_Map:start #==============================================================================#
#==============================================================================# #======================== module Amimeyet_portals =============================# #========= Includes all settings and functions of the portals script ==========# #==============================================================================# module Amimeyet_portals ###BASIC SETTINGS### SHOOT_B = Input::X #What button to press, to shoot the blue portal SHOOT_R = Input::Z #What button to press, to shoot the red portal REMOVE = Input::Y #What button to press, to remove both portals
CHECK = 1 #Type of the 'can shoot' check #1 = Equipped weapon with id of GUN_ID #2 = Use the START_SHOOTABLE value #3 = I'll set it later using #$game_system.shoot_enabled = true
GUN_ID = 31 #The ID of the portalgun weapon. #Only works if CHECK = 1
START_SHOOTABLE = true #Can you shoot at the beginning?
RANGE = 20 #Number of tiles you can shoot BULLET_SPEED = 6 #The speed of the bullet #1 = x8 slower #2 = x4 slower #3 = x2 slower #4 = normal #5 = x2 faster #6 = x4 faster
###ADVANCED SETTINGS###
#These are little pieces of code to execute at the specific error.. #This can be anything from a message window ('p'), to s $scene change.. #Its pure RUBY, and my script eval()'s it...
#The piece of code to run when the user tries to shoot, but it is disabled.. DISABLED_SHOOT = "#do nothing.. it's a comment" #The piece of code to run when the erase function is called, # but no type is supplied NO_ERASE_TYPE = "#do nothing.. it's a comment"
DB_ALLOW_MULT_PORTALS = false #Set to true to stop portals from auto-deleting DB_ALLOW_REMOVE = true #If true, the erase button can be pressed
###END OF SETTINGS###
@prev_blue_id = [] @prev_red_id = []
def self.erase(type = "none") if DB_ALLOW_REMOVE if type == "blue" if @prev_blue_id.length > 0 for i in 0...@prev_blue_id.length $game_map.events[@blue_id].erase end end elsif type == "red" if @prev_red_id.length > 0 for i in 0...@prev_red_id.length $game_map.events[@red_id].erase end end else #What to do when no erasy type is supplied: eval(NO_ERASE_TYPE) end $scene = Scene_Map.new #Refresh end end
def self.teleport(type) direction = $game_player.direction for i in 0...30 Graphics.update end if type == "blue" if $game_map.events.has_key?(@red_id) x = $game_map.events[@red_id].x y = $game_map.events[@red_id].y if $game_map.events[@red_id].direction == 8 #if the portal is looking up y += 1 #get it out of the wall/block end $game_player.moveto(x, y) end elsif type == "red" if $game_map.events.has_key?(@blue_id) x = $game_map.events[@blue_id].x y = $game_map.events[@blue_id].y if $game_map.events[@blue_id].direction == 8 #if the portal is looking up y += 1 #get it out of the wall/block end $game_player.moveto(x, y) end end end def self.shoot(type) #dir case $game_player.direction when 8 #up pdir = 8 x = $game_player.x y = $game_player.y - 1 dir = RPG::MoveCommand.new(19) when 6 #right pdir = 6 x = $game_player.x + 1 y = $game_player.y dir = RPG::MoveCommand.new(18) when 4 #down pdir = 4 x = $game_player.x - 1 y = $game_player.y dir = RPG::MoveCommand.new(17) when 2 #left pdir = 2 x = $game_player.x y = $game_player.y + 1 dir = RPG::MoveCommand.new(16) end #move if $game_map.passable?(x, y) mv1 = RPG::MoveCommand.new(12) mv2 = RPG::MoveCommand.new(0) move_r = RPG::MoveRoute.new() move_r.repeat = false move_r.skippable = true move_r.wait = true move_r.list = [dir] for i in 0...RANGE move_r.list.push(mv1) end move_r.list.push(mv2) move = RPG::EventCommand.new(205, 0, [0, move_r]) end #touch t1 = RPG::MoveCommand.new(37) if pdir == 8 and #up if $game_map.passable?(x, y) t2 = RPG::MoveCommand.new(12) #move 1 tile further else t2 = RPG::MoveCommand.new(15, [0]) #wait 0 frames end else if $game_map.passable?(x, y) t2 = RPG::MoveCommand.new(15, [0]) #wait 0 frames else t2 = RPG::MoveCommand.new(13, [0]) #move 1 tile back end end t3 = RPG::MoveCommand.new(38) t4 = RPG::MoveCommand.new(35) t5 = RPG::MoveCommand.new(34) case type when "blue" t6 = RPG::MoveCommand.new(41, ["!portals", 0]) #BP opening sequence t8 = RPG::MoveCommand.new(41, ["!portals", 1]) t9 = RPG::MoveCommand.new(41, ["!portals", 2]) when "red" t6 = RPG::MoveCommand.new(41, ["!portals", 4]) #RP opening sequence t8 = RPG::MoveCommand.new(41, ["!portals", 5]) t9 = RPG::MoveCommand.new(41, ["!portals", 6]) end t7 = RPG::MoveCommand.new(15, [10]) t10 = RPG::MoveCommand.new(0) touch_r = RPG::MoveRoute.new() touch_r.repeat = false touch_r.skippable = false touch_r.wait = true #13 if $game_map.passable?(x, y) touch_r.list = [dir, t1, t2, t3, t4, t5, t6, t7, t8, t7, t9, t7, t10] else touch_r.list = [dir, t1, t2, t3, t4, t5, t6, t7, t8, t7, t9, t7, t10] end touch = RPG::EventCommand.new(205, 0, [0, touch_r]) #tp case type when "blue" tp = RPG::EventCommand.new(355, 0, ["Amimeyet_portals::teleport(\"blue\")"]) when "red" tp = RPG::EventCommand.new(355, 0, ["Amimeyet_portals::teleport(\"red\")"]) end #turn turn_r = RPG::MoveRoute.new() turn_r.repeat = false turn_r.skippable = false turn_r.wait = true turn_r.list = [dir] turn = RPG::EventCommand.new(205, 0, [0, turn_r]) #switch switch = RPG::EventCommand.new(123, 0, ["A", 0]) #pend pend = RPG::EventCommand.new(0, 0, []) #cond cond = RPG::Event::Page::Condition.new cond.self_switch_valid = true cond.self_switch_ch = "A" #img img = RPG::Event::Page::Graphic.new #Set the bullet image if $game_map.passable?(x, y) img.tile_id = 0 img.character_name = "!Flame" img.character_index = 6 img.direction = 2 img.pattern = 1 else img.character_index = 0 img.direction = 2 img.pattern = 0 end
#img2 img2 = RPG::Event::Page::Graphic.new #Set the open portal image.. Deprecated img2.tile_id = 0 img2.character_name = "!portals" case type when "blue" img2.character_index = 2 when "red" img2.character_index = 6 end img2.direction = pdir img2.pattern = 1 #page 1 p1 = RPG::Event::Page.new p1.trigger = 4 p1.priority_type = 1 if $game_map.passable?(x, y) p1.list = [move, touch, switch, pend] else p1.list = [touch, switch, pend] end p1.graphic = img p1.move_speed = BULLET_SPEED #Set the speed to more than the default.. #page 2 p2 = RPG::Event::Page.new p2.condition = cond p2.trigger = 1 p2.priority_type = 1 p2.graphic = img2 p2.walk_anime = true p2.step_anime = false p2.list = [tp, pend] p2.direction_fix = true #bullet bullet = RPG::Event.new(x,y) bullet.id = $game_map.events.size + 1 bullet.pages = [p1, p2] case type when "blue" bullet.name = "blue portal" #It's important to erase the previous portal, before overwriting it below self.erase("blue") if !DB_ALLOW_MULT_PORTALS @blue_id = bullet.id @prev_blue_id[@prev_blue_id.length + 1] = @blue_id when "red" bullet.name = "red portal" #It's important to erase the previous portal, before overwriting it below self.erase("red") if !DB_ALLOW_MULT_PORTALS @red_id = bullet.id @prev_red_id[@prev_red_id.length + 1] = @red_id end if type == "red" || "blue" event = Game_Event.new($game_map.map_id, bullet) $game_map.events[$game_map.events.size + 1] = event end $scene = Scene_Map.new #Refresh end end
#==============================================================================# #=========================== class Game_System ================================# #========= Aliassed [initialize], added attr_accessor :shoot_enabled ==========# #==============================================================================# class Game_System #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # * Public Instance Variables #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ attr_accessor :shoot_enabled # Can you shoot? #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # * Object Initialization #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ alias amimeyet_shoot_enabled_initialize initialize def initialize # Run Original Method amimeyet_shoot_enabled_initialize # can shoot if the check type is 2 @shoot_enabled = true if Amimeyet_portals::CHECK == 2 end end
#==============================================================================# #============================ class Scene_Map =================================# #======================= Aliassed [start, update]==============================# #==============================================================================# class Scene_Map < Scene_Base #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # * Frame Update #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ alias amimeyet_shoot_key_update update alias amimeyet_shoot_start start def update amimeyet_shoot_key_update
if $game_system.shoot_enabled Amimeyet_portals::shoot("blue") if Input.trigger? (Amimeyet_portals::SHOOT_B) Amimeyet_portals::shoot("red") if Input.trigger? (Amimeyet_portals::SHOOT_R) if Input.trigger? (Amimeyet_portals::REMOVE) Amimeyet_portals::erase("blue") Amimeyet_portals::erase("red") end else #What to do when shooting is disabled: eval(Amimeyet_portals::DISABLED_SHOOT) end end def start amimeyet_shoot_start if Amimeyet_portals::CHECK == 1 for item in $game_party.members[0].equips if item.id == Amimeyet_portals::GUN_ID $game_system.shoot_enabled = true break end end end end end
#==============================================================================# #==============â–º Name: Portals â—„==============# #==============â–º Author: AmIMeYet â—„==============# #==============â–º Version: 1.0 â—„==============# #==============â–º Release: 13/02/09 (dd/mm/yy) â—„==============# #==============â–º Website: amimeyet.890m.com / amimeyet.nl.tp â—„==============# #==============================================================================# ##§Description::::: # This script adds a portal-gun/shooter to RPG Maker VX # #§Instructions:::: # All you need to do is look at the first lines of 'module Amimeyet_portals'; # Look for ###BASIC SETTINGS###.. that's where you want to edit.. # Look at the comments there to find out what to do. # # These are the settings: # SHOOT_B, SHOOT_R, REMOVE, CHECK, GUN_ID, START_SHOOTABLE, RANGE # The default values are: # Input::X, Input::Z, Input::Y, 1, 31, true, 20 # #§Bugs:::::::::::: # â—There may be no event ID missing in your map # (Example: 9 events.. but no event 3) # So say you create three events on a map.. and then delete the second, # instead of a portal erasing.. you erase the third event. # counteract this by cutting (Ctrl+X) and pasting (Ctrl+V) the last event, # (in this case the third), so that it gets an ID of '2'. # #§Special thanks:: # SephirothSpawn, # for his map data decrypter (a MUST HAVE to do this sort of thing) # http://www.rmxp.org/forums/viewtopic.php?f=7&t=60928 # #§Disclaimer:::::: # â—If you use this script on your game, you must credit me. # â—If you want to put this script on a website or forum, # you must ask me for permission. # â—You are free to use any graphics found in this demo, but, # you MUST ABSOLUTELY credit me. # â—Portal is a registered trademark of Valve Corporation # #§Advanced usage:: # Advanced settings: # â—Take a look at ###ADVANCED SETTINGS### # Functions: # â—Amimeyet_portals::erase(type) - "blue","red" - Erase the specified portals # â—Amimeyet_portals::teleport(type) - "blue","red" - Teleport to oposite portal # "blue" teleports player to red # "red" teleports player to blue # â—Amimeyet_portals::shoot(type) - "blue","red" - Launch specified portal # Aliases: # â—Game_System:initialize || Also added attr_accessor :shoot_enabled # â—Scene_Map:update # â—Scene_Map:start #==============================================================================#
#==============================================================================# #======================== module Amimeyet_portals =============================# #========= Includes all settings and functions of the portals script ==========# #==============================================================================# module Amimeyet_portals ###BASIC SETTINGS### SHOOT_B = Input::X #What button to press, to shoot the blue portal SHOOT_R = Input::Z #What button to press, to shoot the red portal REMOVE = Input::Y #What button to press, to remove both portals
CHECK = 1 #Type of the 'can shoot' check #1 = Equipped weapon with id of GUN_ID #2 = Use the START_SHOOTABLE value #3 = I'll set it later using #$game_system.shoot_enabled = true
GUN_ID = 31 #The ID of the portalgun weapon. #Only works if CHECK = 1
START_SHOOTABLE = true #Can you shoot at the beginning?
RANGE = 20 #Number of tiles you can shoot
###ADVANCED SETTINGS###
#These are little pieces of code to execute at the specific error.. #This can be anything from a message window ('p'), to s $scene change.. #Its pure RUBY, and my script eval()'s it...
#The piece of code to run when the user tries to shoot, but it is disabled.. DISABLED_SHOOT = "#do nothing.. it's a comment" #The piece of code to run when the erase function is called, # but no type is supplied NO_ERASE_TYPE = "#do nothing.. it's a comment"
DB_ALLOW_MULT_PORTALS = false #Set to true to stop portals from auto-deleting DB_ALLOW_REMOVE = true #If true, the erase button can be pressed
###END OF SETTINGS###
@prev_blue_id = [] @prev_red_id = []
def self.erase(type = "none") if DB_ALLOW_REMOVE if type == "blue" if @prev_blue_id.length > 0 for i in 0...@prev_blue_id.length $game_map.events[@blue_id].erase end end elsif type == "red" if @prev_red_id.length > 0 for i in 0...@prev_red_id.length $game_map.events[@red_id].erase end end else #What to do when no erasy type is supplied: eval(NO_ERASE_TYPE) end $scene = Scene_Map.new end end
def self.teleport(type) direction = $game_player.direction for i in 0...30 Graphics.update end if type == "blue" if $game_map.events.has_key?(@red_id) x = $game_map.events[@red_id].x y = $game_map.events[@red_id].y $game_player.moveto(x, y) end elsif type == "red" if $game_map.events.has_key?(@blue_id) x = $game_map.events[@blue_id].x y = $game_map.events[@blue_id].y $game_player.moveto(x, y) end end end def self.shoot(type) #dir case $game_player.direction when 8 #up pdir = 8 x = $game_player.x y = $game_player.y - 1 dir = RPG::MoveCommand.new(19) when 6 #right pdir = 6 x = $game_player.x + 1 y = $game_player.y dir = RPG::MoveCommand.new(18) when 4 #down pdir = 4 x = $game_player.x - 1 y = $game_player.y dir = RPG::MoveCommand.new(17) when 2 #left pdir = 2 x = $game_player.x y = $game_player.y + 1 dir = RPG::MoveCommand.new(16) end #move if $game_map.passable?(x, y) mv1 = RPG::MoveCommand.new(12) mv2 = RPG::MoveCommand.new(0) move_r = RPG::MoveRoute.new() move_r.repeat = false move_r.skippable = true move_r.wait = true move_r.list = [dir] for i in 0...RANGE move_r.list.push(mv1) end move_r.list.push(mv2) move = RPG::EventCommand.new(205, 0, [0, move_r]) end #touch t1 = RPG::MoveCommand.new(37) if pdir == 8 and #up if $game_map.passable?(x, y) t2 = RPG::MoveCommand.new(12) #move 1 tile further else t2 = RPG::MoveCommand.new(15, [0]) #wait 0 frames end else if $game_map.passable?(x, y) t2 = RPG::MoveCommand.new(15, [0]) #wait 0 frames else t2 = RPG::MoveCommand.new(13, [0]) #move 1 tile back end end t3 = RPG::MoveCommand.new(38) t4 = RPG::MoveCommand.new(35) t5 = RPG::MoveCommand.new(34) case type when "blue" t6 = RPG::MoveCommand.new(41, ["!portals", 0]) #BP opening sequence t8 = RPG::MoveCommand.new(41, ["!portals", 1]) t9 = RPG::MoveCommand.new(41, ["!portals", 2]) when "red" t6 = RPG::MoveCommand.new(41, ["!portals", 4]) #RP opening sequence t8 = RPG::MoveCommand.new(41, ["!portals", 5]) t9 = RPG::MoveCommand.new(41, ["!portals", 6]) end t7 = RPG::MoveCommand.new(15, [10]) t10 = RPG::MoveCommand.new(0) touch_r = RPG::MoveRoute.new() touch_r.repeat = false touch_r.skippable = false touch_r.wait = true #13 if $game_map.passable?(x, y) touch_r.list = [dir, t1, t2, t3, t4, t5, t6, t7, t8, t7, t9, t7, t10] else touch_r.list = [dir, t1, t2, t3, t4, t5, t6, t7, t8, t7, t9, t7, t10] end touch = RPG::EventCommand.new(205, 0, [0, touch_r]) #tp case type when "blue" tp = RPG::EventCommand.new(355, 0, ["Amimeyet_portals::teleport(\"blue\")"]) when "red" tp = RPG::EventCommand.new(355, 0, ["Amimeyet_portals::teleport(\"red\")"]) end #turn turn_r = RPG::MoveRoute.new() turn_r.repeat = false turn_r.skippable = false turn_r.wait = true turn_r.list = [dir] turn = RPG::EventCommand.new(205, 0, [0, turn_r]) #switch switch = RPG::EventCommand.new(123, 0, ["A", 0]) #pend pend = RPG::EventCommand.new(0, 0, []) #cond cond = RPG::Event::Page::Condition.new cond.self_switch_valid = true cond.self_switch_ch = "A" #img img = RPG::Event::Page::Graphic.new #Set the bullet image if $game_map.passable?(x, y) img.tile_id = 0 img.character_name = "!Flame" img.character_index = 6 img.direction = 2 img.pattern = 1 else img.character_index = 0 img.direction = 2 img.pattern = 0 end
#img2 img2 = RPG::Event::Page::Graphic.new #Set the open portal image.. Deprecated img2.tile_id = 0 img2.character_name = "!portals" case type when "blue" img2.character_index = 2 when "red" img2.character_index = 6 end img2.direction = pdir img2.pattern = 1 #page 1 p1 = RPG::Event::Page.new p1.trigger = 4 p1.priority_type = 1 if $game_map.passable?(x, y) p1.list = [move, touch, switch, pend] else p1.list = [touch, switch, pend] end p1.graphic = img #page 2 p2 = RPG::Event::Page.new p2.condition = cond p2.trigger = 1 p2.priority_type = 1 p2.graphic = img2 p2.walk_anime = true p2.step_anime = false p2.list = [tp, pend] p2.direction_fix = true #bullet bullet = RPG::Event.new(x,y) bullet.id = $game_map.events.size + 1 bullet.pages = [p1, p2] case type when "blue" bullet.name = "blue portal" #It's important to erase the previous portal, before overwriting it below self.erase("blue") if !DB_ALLOW_MULT_PORTALS @blue_id = bullet.id @prev_blue_id[@prev_blue_id.length + 1] = @blue_id when "red" bullet.name = "red portal" #It's important to erase the previous portal, before overwriting it below self.erase("red") if !DB_ALLOW_MULT_PORTALS @red_id = bullet.id @prev_red_id[@prev_red_id.length + 1] = @red_id end if type == "red" || "blue" event = Game_Event.new($game_map.map_id, bullet) $game_map.events[$game_map.events.size + 1] = event end $scene = Scene_Map.new end end
#==============================================================================# #=========================== class Game_System ================================# #========= Aliassed [initialize], added attr_accessor :shoot_enabled ==========# #==============================================================================# class Game_System #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # * Public Instance Variables #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ attr_accessor :shoot_enabled # Can you shoot? #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # * Object Initialization #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ alias amimeyet_shoot_enabled_initialize initialize def initialize # Run Original Method amimeyet_shoot_enabled_initialize # can shoot if the check type is 2 @shoot_enabled = true if Amimeyet_portals::CHECK == 2 end end
#==============================================================================# #============================ class Scene_Map =================================# #======================= Aliassed [start, update]==============================# #==============================================================================# class Scene_Map < Scene_Base #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # * Frame Update #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ alias amimeyet_shoot_key_update update alias amimeyet_shoot_start start def update amimeyet_shoot_key_update
if $game_system.shoot_enabled Amimeyet_portals::shoot("blue") if Input.trigger? (Amimeyet_portals::SHOOT_B) Amimeyet_portals::shoot("red") if Input.trigger? (Amimeyet_portals::SHOOT_R) if Input.trigger? (Amimeyet_portals::REMOVE) Amimeyet_portals::erase("blue") Amimeyet_portals::erase("red") end else #What to do when shooting is disabled: eval(Amimeyet_portals::DISABLED_SHOOT) end end def start amimeyet_shoot_start if Amimeyet_portals::CHECK == 1 for item in $game_party.members[0].equips if item.id == Amimeyet_portals::GUN_ID $game_system.shoot_enabled = true break end end end end end
Though it requires so many images, I really reccomend the demo!
SHOOT_B = Input::X #What button to press, to shoot the blue portal
SHOOT_R = Input::Z #What button to press, to shoot the red portal
REMOVE = Input::Y #What button to press, to remove both portals
CHECK = 1 #Type of the 'can shoot' check #1 = Equipped weapon with id of GUN_ID #2 = Use the START_SHOOTABLE value #3 = I'll set it later using #$game_system.shoot_enabled = true
GUN_ID = 31 #The ID of the portalgun weapon. #Only works if CHECK = 1
START_SHOOTABLE = true #Can you shoot at the beginning?
#These are little pieces of code to execute at the specific error.. #This can be anything from a message window ('p'), to s $scene change.. #Its pure RUBY, and my script eval()'s it...
#The piece of code to run when the user tries to shoot, but it is disabled..
DISABLED_SHOOT = "#do nothing.. it's a comment" #The piece of code to run when the erase function is called, # but no type is supplied
NO_ERASE_TYPE = "#do nothing.. it's a comment"
DB_ALLOW_MULT_PORTALS = false #Set to true to stop portals from auto-deleting
DB_ALLOW_REMOVE = true #If true, the erase button can be pressed
Compatibility Maximum. All methods except for my own module have been aliased; so nothing is overwritten
Screenshot
Installation Copy the script and place it above 'main'; the default place where you install scripts. Next, copy all the images from the 'Graphics' folder to your game, and edit them to your liking Also, there are a few methods my script uses to check if it can shoot portals, and the default is set to GUN_ID. So, if you don't change this.. the portal gun won't shoot.. so please make sure you configure this.
FAQ/Bugs
There may be no event ID missing in your map (Example: 9 events.. but no event 3) So say you create three events on a map.. and then delete the second, instead of a portal erasing.. you erase the third event. Counteract this by cutting (Ctrl+X) and pasting (Ctrl+V) the last event, (in this case the third), so that it gets the ID of the missing one (in this case 2).
Know another bug? Contact me here, or via mail.
Terms and Conditions If you use this script on your game, you must credit me. If you want to put this script on a website or forum, you must ask me for permission. You are free to use any graphics found in this demo, but you MUST ABSOLUTELY credit me. Portal is a registered trademark of Valve Corporation If you run into any issues, or have a question, please contact me, using the forum or using mail.
$LOAD_PATH << Dir.getwd #You only need to call this once Kernel.require("includable.rb") #replace includable.rb with the name of the file you want to load
#=============================================================================# # # # ANTI DASH HACK # # # # # # By AmIMeYet # # # # # # please credit me # # # #=============================================================================# class Game_Player < Game_Character def dash? return false if @move_route_forcing return false if in_vehicle? return true if Input.press?(Input::A) and $game_map.disable_dash? end end
This snippet basically inverts the dashing.. allowing you to dash only when 'disable dashing' is checked. This way, normal maps disable dashing, but the ones you set to disable actually allow dashing..
It should be placed where you normally place the scripts ('above main', in the materials section of the scripts window)..
Heheh.. thanks! There's a lot wrong with it though.. .. but I'm gonna do my best to fix those issues.. One big thing is giving the player the direction of the portal it's coming out of..
$LOAD_PATH << Dir.getwd #You only need to call this once Kernel.require("includable.rb") #replace includable.rb with the name of the file you want to load
#=============================================================================# # # # ANTI DASH HACK # # # # # # By AmIMeYet # # # # # # please credit me # # # #=============================================================================# class Game_Player < Game_Character def dash? return false if @move_route_forcing return false if in_vehicle? return true if Input.press?(Input::A) and $game_map.disable_dash? end end
This snippet basically inverts the dashing.. allowing you to dash only when 'disable dashing' is checked. This way, normal maps disable dashing, but the ones you set to disable actually allow dashing..
It should be placed where you normally place the scripts ('above main', in the materials section of the scripts window)..
For the past couple of months I've been learning RGSS and I've got the basic stuff down such windows, variables, conditional statements, ect. But, I can't see myself making big scripts such as a jumping system or a side view battle system. I was wondering how you learned to script because I really want to know how to script really well.
Thanks in advance.
Hey there,
Well I don't make battle neither though I can still teach you some things :)... The way I've learned to script is by reading other scripts for the most part. I've allways been interested in other peoples work but this time I though I had to try to make something myself...and it worked!! The most importand thing when you go scripting is (at least in my case) that you want to make something to help an other wich can't script. You also need to feel the competition that's around in the scripting-community. Cause, I have to say, if you get pushed to get a sertain request done before an other scripter does, you feel POWERFULL!! :P So that's an other thing... You also don't need to be afraid to learn from others or helpfiles. When I write my scripts, I actualy always have the helpfiles open to look things up I don't know or remember. Then, you must be calm, cause you need to try the script a lot of times. When I write a script, I test it after almost every changes. First I set up the major structure. Like when I make a window-script or part of a script I start with something like this:
CODE
class Window_Name < Window_Base def initialize(x,y,width,height) super(x,y,width,height) refresh end
def refresh self.contents.clear draw_contents end
def draw_contents draw_something(with, some, parameters) end
def update refresh if @something != @what_it_should_be end end
So that's also very important. Then, the biggest thing I learned scripting from is TRIAL AND ERROR. That's the most irritating way to learn something, cause it's more ERROR than TRIAL, but it does the trick realy good.
So that's it how I did it. Now it's up to you. Do some requests (if I didn't do it allready :P) and learn from them.
Hope that helped you out a little. If not, keep your eye on the Scriptology-topic (see my sig) where I'll be updating for my scripting(video)tutorials. Perhaps they're going to be usefull for you one day ;)
$LOAD_PATH << Dir.getwd #You only need to call this once Kernel.require("includable.rb") #replace includable.rb with the name of the file you want to load
#=============================================================================# # # # ANTI DASH HACK # # # # # # By AmIMeYet # # # # # # please credit me # # # #=============================================================================# class Game_Player < Game_Character def dash? return false if @move_route_forcing return false if in_vehicle? return true if Input.press?(Input::A) and $game_map.disable_dash? end end
This snippet basically inverts the dashing.. allowing you to dash only when 'disable dashing' is checked. This way, normal maps disable dashing, but the ones you set to disable actually allow dashing..
It should be placed where you normally place the scripts ('above main', in the materials section of the scripts window)..
$LOAD_PATH << Dir.getwd #You only need to call this once Kernel.require("includable.rb") #replace includable.rb with the name of the file you want to load
#=============================================================================# # # # ANTI DASH HACK # # # # # # By AmIMeYet # # # # # # please credit me # # # #=============================================================================# class Game_Player < Game_Character def dash? return false if @move_route_forcing return false if in_vehicle? return true if Input.press?(Input::A) and $game_map.disable_dash? end end
This snippet basically inverts the dashing.. allowing you to dash only when 'disable dashing' is checked. This way, normal maps disable dashing, but the ones you set to disable actually allow dashing..
It should be placed where you normally place the scripts ('above main', in the materials section of the scripts window)..
For the past couple of months I've been learning RGSS and I've got the basic stuff down such windows, variables, conditional statements, ect. But, I can't see myself making big scripts such as a jumping system or a side view battle system. I was wondering how you learned to script because I really want to know how to script really well.
Thanks in advance.
Hey there,
Well I don't make battle neither though I can still teach you some things :)... The way I've learned to script is by reading other scripts for the most part. I've allways been interested in other peoples work but this time I though I had to try to make something myself...and it worked!! The most importand thing when you go scripting is (at least in my case) that you want to make something to help an other wich can't script. You also need to feel the competition that's around in the scripting-community. Cause, I have to say, if you get pushed to get a sertain request done before an other scripter does, you feel POWERFULL!! :P So that's an other thing... You also don't need to be afraid to learn from others or helpfiles. When I write my scripts, I actualy always have the helpfiles open to look things up I don't know or remember. Then, you must be calm, cause you need to try the script a lot of times. When I write a script, I test it after almost every changes. First I set up the major structure. Like when I make a window-script or part of a script I start with something like this:
CODE
class Window_Name < Window_Base def initialize(x,y,width,height) super(x,y,width,height) refresh end
def refresh self.contents.clear draw_contents end
def draw_contents draw_something(with, some, parameters) end
def update refresh if @something != @what_it_should_be end end
So that's also very important. Then, the biggest thing I learned scripting from is TRIAL AND ERROR. That's the most irritating way to learn something, cause it's more ERROR than TRIAL, but it does the trick realy good.
So that's it how I did it. Now it's up to you. Do some requests (if I didn't do it allready :P) and learn from them.
Hope that helped you out a little. If not, keep your eye on the Scriptology-topic (see my sig) where I'll be updating for my scripting(video)tutorials. Perhaps they're going to be usefull for you one day ;)
good, can't use it, my stack is too big.. (scripts)
__________________________
I QUIT RRR, HEY Zehnire, i'm sorry i cannot finish your request, first off, i'll need some information and second, i can't post =( MY NEW ACCOUNT WILL BE http://www.rpgmakervx.net/index.php?showuser=28688 I'm deeply sorry, message me on there and i'll ask a few questions and complete your request. SORRY MAN... I HATE RRR MODS
good, can't use it, my stack is too big.. (scripts)
Sorry, I don't really understand.. Are you getting the error when you test your game, called 'stack level too deep'.. or do you have too many scripts installed? Do you require assistance?
$LOAD_PATH << Dir.getwd #You only need to call this once Kernel.require("includable.rb") #replace includable.rb with the name of the file you want to load
#=============================================================================# # # # ANTI DASH HACK # # # # # # By AmIMeYet # # # # # # please credit me # # # #=============================================================================# class Game_Player < Game_Character def dash? return false if @move_route_forcing return false if in_vehicle? return true if Input.press?(Input::A) and $game_map.disable_dash? end end
This snippet basically inverts the dashing.. allowing you to dash only when 'disable dashing' is checked. This way, normal maps disable dashing, but the ones you set to disable actually allow dashing..
It should be placed where you normally place the scripts ('above main', in the materials section of the scripts window)..
this is pretty nice. i dont i would use it yet, my game full of different animations, but maybe in the future! good work tho! it really is nice
Thanks, but it's not _that_ nice actually; pretty bad, infact. It's got so many terrible bugs.. you might even be better off just installing one of those on-map-battlesystems, and then adding in a teleporter. [OLD SCRIPT]
$LOAD_PATH << Dir.getwd #You only need to call this once Kernel.require("includable.rb") #replace includable.rb with the name of the file you want to load
#=============================================================================# # # # ANTI DASH HACK # # # # # # By AmIMeYet # # # # # # please credit me # # # #=============================================================================# class Game_Player < Game_Character def dash? return false if @move_route_forcing return false if in_vehicle? return true if Input.press?(Input::A) and $game_map.disable_dash? end end
This snippet basically inverts the dashing.. allowing you to dash only when 'disable dashing' is checked. This way, normal maps disable dashing, but the ones you set to disable actually allow dashing..
It should be placed where you normally place the scripts ('above main', in the materials section of the scripts window)..