Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

 
Reply to this topicStart new topic
> Portals [V1.1] Warning: OLD, OLD & BUGGY; use at own risk!
AmIMeYet
post Feb 13 2009, 01:24 PM
Post #1


new av & (dynamic) sig!
Group Icon

Group: Revolutionary
Posts: 149
Type: Scripter
RM Skill: Undisclosed




WARNING: THIS SCRIPT IS REALLY REALLY REALLY OLD AND BUGGY

Portals

Version: 1.1
Author: AmIMeYet
Release Date: 13/02/09


Introduction
It's finally here.. a portalgun for RPG Maker VX!

Features
  • Easy to use settings!
  • Works both ways!
  • Red an Blue portal
  • Erase function
  • Advanced function.. (running a script on error; etc.)

    New in V1.1:
  • Added BULLET_SPEED
  • Fixed player from gettings stuck in wall

DEMO
V1.1: (LATEST)
Mediafire
V1.0:
Mediafire
Megaupload

Script -- Use Demo instead! (it includes required images)
[Show/Hide] Portalgun v1.1

CODE
#==============================================================================#
#==============â–º  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

[Show/Hide] Portalgun v1.0

CODE
#==============================================================================#
#==============â–º  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!

Customization
[Show/Hide] Available options:
  • 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
[Show/Hide] 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

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.

Special thanks


This post has been edited by AmIMeYet: Aug 7 2009, 06:15 AM


__________________________

>>Latest EventScripter news: Conditional Branches fully working! Currently working on a documentation site. Topic: EventScripter
>>Portals (yes, in RPG Maker VX!)
>>Working with Sojabird on his Scriptology; I also invented Scriptuzzle.. Try one; make one!
[Show/Hide] USEFULL script snippets:
[Show/Hide] Do require's in VX:
CODE
$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
[Show/Hide] Invert Dash enabling:
CODE
#=============================================================================#
# # #                            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)..
Go to the top of the page
 
+Quote Post
   
onidsouza
post Feb 13 2009, 01:36 PM
Post #2


image master of doom
Group Icon

Group: Revolutionary
Posts: 603
Type: None
RM Skill: Undisclosed




Wow. Nothing more, just wow.


__________________________
Gabba Gabba Hey! enjoy your life ^^
lol (by keet's brother)
some lol
more lol
even MORE lol
Serious Discussion
why all my lol's have Teh Parakeet involved?

me ^^

bacon

Spamming is always better with bacon
Go to the top of the page
 
+Quote Post
   
AmIMeYet
post Feb 13 2009, 02:13 PM
Post #3


new av & (dynamic) sig!
Group Icon

Group: Revolutionary
Posts: 149
Type: Scripter
RM Skill: Undisclosed




QUOTE (onidsouza @ Feb 13 2009, 10:36 PM) *
Wow. Nothing more, just wow.

Heheh.. thanks! biggrin.gif
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..

I should be able to pull that off though.. happy.gif


__________________________

>>Latest EventScripter news: Conditional Branches fully working! Currently working on a documentation site. Topic: EventScripter
>>Portals (yes, in RPG Maker VX!)
>>Working with Sojabird on his Scriptology; I also invented Scriptuzzle.. Try one; make one!
[Show/Hide] USEFULL script snippets:
[Show/Hide] Do require's in VX:
CODE
$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
[Show/Hide] Invert Dash enabling:
CODE
#=============================================================================#
# # #                            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)..
Go to the top of the page
 
+Quote Post
   
SojaBird
post Feb 13 2009, 04:36 PM
Post #4


Level 51
Group Icon

Group: Revolutionary
Posts: 1,573
Type: Scripter
RM Skill: Advanced




Hey,

So ya dare 2 post it hu biggrin.gif
Well pretty cool wink.gif
Hope it's going to be more easy with or upcomming EventScripter biggrin.gif


Greatzz and speak ya soon,
SojaBird.


__________________________
Art from the highest shelf?

Scriptology, scripting podcast



HUD's Request Lobby (multiple hud-scripts)


------------------------------------------------------------------

Random Stuff
OMG, it's Hab!!


This is a crazy drawing application! (by me)

How did I learned to script
QUOTE
Hey pim! I'm the Law G14!

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 ;)


Greatzz,
SojaBird.
Go to the top of the page
 
+Quote Post
   
darkubersaw
post Feb 14 2009, 07:18 AM
Post #5


Level 5
Group Icon

Group: Member
Posts: 67
Type: Event Designer
RM Skill: Beginner




link isnt working...it brings me to the mediafire download page but when i hit "start download" it doesn't download it


__________________________

[Show/Hide] My Gamertag



[Show/Hide] My Personailty Test
Go to the top of the page
 
+Quote Post
   
onidsouza
post Feb 14 2009, 10:25 AM
Post #6


image master of doom
Group Icon

Group: Revolutionary
Posts: 603
Type: None
RM Skill: Undisclosed




The link is working


__________________________
Gabba Gabba Hey! enjoy your life ^^
lol (by keet's brother)
some lol
more lol
even MORE lol
Serious Discussion
why all my lol's have Teh Parakeet involved?

me ^^

bacon

Spamming is always better with bacon
Go to the top of the page
 
+Quote Post
   
AmIMeYet
post Feb 14 2009, 12:32 PM
Post #7


new av & (dynamic) sig!
Group Icon

Group: Revolutionary
Posts: 149
Type: Scripter
RM Skill: Undisclosed




Yeah, I seem to have about 50 downloads.. so it should work..
Is your browser up to date?

Oh wait, I can't download it either anymore.. ... weird..

I'll reupload it somewhere else..

Edit: Wait.. it's working again.. wacko.gif

Edit 2: Okay, I've added a mirror to Megaupoad anyway.. I hope this works for you

This post has been edited by AmIMeYet: Feb 14 2009, 12:42 PM


__________________________

>>Latest EventScripter news: Conditional Branches fully working! Currently working on a documentation site. Topic: EventScripter
>>Portals (yes, in RPG Maker VX!)
>>Working with Sojabird on his Scriptology; I also invented Scriptuzzle.. Try one; make one!
[Show/Hide] USEFULL script snippets:
[Show/Hide] Do require's in VX:
CODE
$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
[Show/Hide] Invert Dash enabling:
CODE
#=============================================================================#
# # #                            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)..
Go to the top of the page
 
+Quote Post
   
darkubersaw
post Feb 14 2009, 02:39 PM
Post #8


Level 5
Group Icon

Group: Member
Posts: 67
Type: Event Designer
RM Skill: Beginner




Works now. tyvm


__________________________

[Show/Hide] My Gamertag



[Show/Hide] My Personailty Test
Go to the top of the page
 
+Quote Post
   
goldensun9753
post Feb 15 2009, 05:09 PM
Post #9


Level 1
Group Icon

Group: Member
Posts: 11
Type: None
RM Skill: Skilled




Thats just amazing, this is excellent work.
Go to the top of the page
 
+Quote Post
   
HeLLRazor
post Feb 15 2009, 05:49 PM
Post #10


Level 2
Group Icon

Group: Member
Posts: 15
Type: Musician
RM Skill: Beginner




banana.gif this is the most awesome new script available until now . Stargate geeks must love this.
Go to the top of the page
 
+Quote Post
   
AmIMeYet
post Feb 16 2009, 12:59 AM
Post #11


new av & (dynamic) sig!
Group Icon

Group: Revolutionary
Posts: 149
Type: Scripter
RM Skill: Undisclosed




Thanks!

Also:

Version 1.1 is out!


__________________________

>>Latest EventScripter news: Conditional Branches fully working! Currently working on a documentation site. Topic: EventScripter
>>Portals (yes, in RPG Maker VX!)
>>Working with Sojabird on his Scriptology; I also invented Scriptuzzle.. Try one; make one!
[Show/Hide] USEFULL script snippets:
[Show/Hide] Do require's in VX:
CODE
$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
[Show/Hide] Invert Dash enabling:
CODE
#=============================================================================#
# # #                            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)..
Go to the top of the page
 
+Quote Post
   
Ark Reaver
post Feb 16 2009, 01:08 AM
Post #12


Level 6
Group Icon

Group: Member
Posts: 79
Type: Developer
RM Skill: Advanced




Wow. This is great. I may just start a new side project because of this. excellent work on a fine script.


__________________________
Winner of the 2008 RRR Winter Art Contest (By default. I was the only one who entered).

[Show/Hide] Unus Volatilis Angelus
Noli manere, manere in memoria

Noli manere, manere in memoria

Sephiroth, Sephiroth





Saevam iram, iram et dolorem

Saevam iram, iram et dolorem

Sephiroth, Sephiroth





Ferum terribile, terribile fatum



Noli manere, manare in memoria

Noli manere, manare in memoria

Sephiroth, Sephiroth





Veni, mi fili. Veni, mi fili

Hic veni, da mihi mortem iterum

Veni, mi fili. Veni, mi fili

Hic veni, da mihi...





Noli manere in memoria

Saevam iram et dolorem

Ferum terribile fatum

Ille iterum veniet





Mi fili, veni, veni, veni, mi fili

Mi fili, veni, veni, veni, mi fili

Mi fili, veni, veni, veni, mi fili

Mi fili, veni, veni, veni, mi fili





Mi fili, veni, veni, veni, mi fili

(Qui mortem invitavis)

Mi fili, veni, veni, veni, mi fili

(Poena funesta natus)

Mi fili, veni, veni, veni, mi fili

(Noli nomen vocare)

Mi fili, veni, veni, veni, mi fili

(Ille iterum veniet)





Sephiroth, Sephiroth

Sephiroth

[Show/Hide] Tonberry's Holiday
Go to the top of the page
 
+Quote Post
   
SojaBird
post Feb 16 2009, 04:13 AM
Post #13


Level 51
Group Icon

Group: Revolutionary
Posts: 1,573
Type: Scripter
RM Skill: Advanced




It's going to right way biggrin.gif


Greatzz,
SojaBird.


__________________________
Art from the highest shelf?

Scriptology, scripting podcast



HUD's Request Lobby (multiple hud-scripts)


------------------------------------------------------------------

Random Stuff
OMG, it's Hab!!


This is a crazy drawing application! (by me)

How did I learned to script
QUOTE
Hey pim! I'm the Law G14!

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 ;)


Greatzz,
SojaBird.
Go to the top of the page
 
+Quote Post
   
Metamorphoze
post Mar 2 2009, 03:35 PM
Post #14


Level 8
Group Icon

Group: Revolutionary
Posts: 115
Type: Developer
RM Skill: Skilled




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
Go to the top of the page
 
+Quote Post
   
AmIMeYet
post Mar 3 2009, 06:05 AM
Post #15


new av & (dynamic) sig!
Group Icon

Group: Revolutionary
Posts: 149
Type: Scripter
RM Skill: Undisclosed




QUOTE (Metamorphoze @ Mar 3 2009, 12:35 AM) *
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?


__________________________

>>Latest EventScripter news: Conditional Branches fully working! Currently working on a documentation site. Topic: EventScripter
>>Portals (yes, in RPG Maker VX!)
>>Working with Sojabird on his Scriptology; I also invented Scriptuzzle.. Try one; make one!
[Show/Hide] USEFULL script snippets:
[Show/Hide] Do require's in VX:
CODE
$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
[Show/Hide] Invert Dash enabling:
CODE
#=============================================================================#
# # #                            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)..
Go to the top of the page
 
+Quote Post
   
rural_monk
post Aug 6 2009, 03:30 PM
Post #16


Level 2
Group Icon

Group: Member
Posts: 20
Type: Musician
RM Skill: Advanced




this is pretty nice. i dont i would use it yet, my game full of different animations, but maybe in the future! happy.gif good work tho! it really is nice thumbsup.gif


__________________________
The Rural Monk - the fresh smell of rum in the morning
Go to the top of the page
 
+Quote Post
   
AmIMeYet
post Aug 7 2009, 06:11 AM
Post #17


new av & (dynamic) sig!
Group Icon

Group: Revolutionary
Posts: 149
Type: Scripter
RM Skill: Undisclosed




QUOTE (rural_monk @ Aug 7 2009, 01:30 AM) *
this is pretty nice. i dont i would use it yet, my game full of different animations, but maybe in the future! happy.gif good work tho! it really is nice thumbsup.gif
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]


__________________________

>>Latest EventScripter news: Conditional Branches fully working! Currently working on a documentation site. Topic: EventScripter
>>Portals (yes, in RPG Maker VX!)
>>Working with Sojabird on his Scriptology; I also invented Scriptuzzle.. Try one; make one!
[Show/Hide] USEFULL script snippets:
[Show/Hide] Do require's in VX:
CODE
$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
[Show/Hide] Invert Dash enabling:
CODE
#=============================================================================#
# # #                            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)..
Go to the top of the page
 
+Quote Post
   

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 19th May 2013 - 10:27 AM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker