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
> Amethyst Platforming System, Make platformers in VX now!
Avatar176
post May 18 2011, 12:44 PM
Post #1


Level 3
Group Icon

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




Amethyst Platform System

Introduction:
First of all...this script is not made by me. It was made by Khas.
I just translated it, is all. So, yeah, you can make platformers with this.

Features:
~Make platformers
~Alter gravity and jump setting
~Can be combined with Requiem SBABS to make "Metroidvania" games

Installation/Instructions:
1 - Paste this script above all the additional scripts
2 - Set the configuration

I should also mention that you're going to need a blank tile for all the
non-platform parts of the maps. Dunno if it'll work with the blank parallax tile.

Screenshot:
~Open~

(Please note that the HUD is not part of the script. This, along with enemies and powerups,
you will have to do on your own. SUCKS DOESN'T IT?)


Script:
~Open~
CODE
=begin
================================================================================
Amethyst Platform System - Version 1.2 RMVX - 25/03/2010
================================================================================

--------------------------------------------------------------------------------
Credits
--------------------------------------------------------------------------------
Created by Khas. Translation by Avatar176.
All Amethyst scripts are licensed under a Creative Commons
All Amethyst scripts can only be used in non-commercial projects,
If use in commercial project please send a PM with the request.
--------------------------------------------------------------------------------
Features
--------------------------------------------------------------------------------
The Amethyst System Platform Selected maps transforms the constant
Amp_System_Maps (see the "configuration) in platform-style maps.

--------------------------------------------------------------------------------
Instructions/Installation
--------------------------------------------------------------------------------
1 - Paste this script above all the additional scripts
2 - Set it in the configuration

--------------------------------------------------------------------------------
Instructions - Creating The Maps
--------------------------------------------------------------------------------
The tiles are not passable and the platform where the tiles are passable
the character can fall \ jump. The events also suffer map action
gravity of the system, ie, fall into holes too

--------------------------------------------------------------------------------
Configuration
--------------------------------------------------------------------------------
=end
module Amp_Config
  # Maps that will be platform style, place the ID within the [], separated by commas
  Amp_System_Maps = [1,2,8,9,10,12,13,14,15,17,18,19,20,22,23,24,25,26,27,28,32,30,33,34,35,36,37
,38,39,40,41,
  42,43,46]
  # Force of gravity, varies from 0 ~ 2
  GForce = 1
  # Key to Jump
  Jump_Key = Input::X
  # Force Leap, values from 0 ~ 5
  Jump_Force = 4
  # Sound to play when you jump
  Jump_Sound = "Jump1"
end
#-------------------------------------------------------------------------------
#       Do not change anything below unless you know what you're doing!
#-------------------------------------------------------------------------------

$Amethyst_Scripts = {} if $Amethyst_Scripts.nil?
$Amethyst_Scripts["Am Platform System"] = ["1.2","25/03/2010"]

class Game_Character
  alias amp_original_initialize initialize
  alias amp_original_update update
  alias amp_original_move_up move_up
  alias amp_original_move_down move_down
  alias amp_original_move_left move_left
  alias amp_original_move_right move_right
  alias amp_original_move_random move_random
  alias amp_original_turn_random turn_random
  alias amp_original_move_toward_player move_toward_player
  alias amp_original_move_away_from_player move_away_from_player
  def amp_map?
    $game_map.nil? ? i = false : i = Amp_Config::Amp_System_Maps.include?($game_map.map_id)
    return i
  end
  def initialize
    if amp_map?
      @gforce = false; @nforce = false; @sforce = nil
    end
    amp_original_initialize
  end
  def update
    amp_original_update
    return unless amp_map?
    force_gravity if @gforce
    stop_gravity_force if @nforce
  end
  def force_gravity
    return if moving?
    @move_speed = Amp_Config::GForce+4
    @y = $game_map.round_y(@y+1)
    @real_y = (@y-1)*256
    if passable?(@x, @y+1); @gforce = true
      else; @nforce = true; @gforce = false
    end
  end
  def check_gravity_force
    if passable?(@x, @y+1)
      @sforce = @move_speed
      @gforce = true
      @walk_anime = false
    else
      check_event_trigger_touch(@x, @y+1)
    end
  end
  def stop_gravity_force
    return if moving?
    @nforce = false
    @gforce = false
    @walk_anime = true
    @move_speed = @sforce
    @sforce = nil
  end
  def move_up(turn_ok = true)
    amp_map? ? amp_move_up(turn_ok) : amp_original_move_up(turn_ok)
  end
  def move_down(turn_ok = true)
    amp_map? ? amp_move_down(turn_ok) : amp_original_move_down(turn_ok)
  end
  def move_left(turn_ok = true)
    amp_map? ? amp_move_left(turn_ok) : amp_original_move_left(turn_ok)
  end
  def move_right(turn_ok = true)
    amp_map? ? amp_move_right(turn_ok) : amp_original_move_right(turn_ok)
  end
  def move_random
    amp_map? ? amp_move_random : amp_original_move_random
  end
  def move_toward_player
    amp_map? ? amp_move_toward_player : amp_original_move_toward_player
  end
  def move_away_from_player
    amp_map? ? amp_move_away_from_player : amp_original_move_away_from_player
  end
  def turn_random
    amp_map? ? amp_turn_random : amp_original_turn_random
  end
  def amp_move_up(turn_ok)
    if passable?(@x, @y-1)
      @y = $game_map.round_y(@y-1)
      @real_y = (@y+1)*256
      increase_steps
      @move_failed = false
    else
      check_event_trigger_touch(@x, @y-1)
      @move_failed = true
    end
  end
  def amp_move_down(turn_ok)
    if passable?(@x, @y+1)
      @y = $game_map.round_y(@y+1)
      @real_y = (@y-1)*256
      increase_steps
      @move_failed = false
    else
      check_event_trigger_touch(@x, @y+1)
      @move_failed = true
    end
  end
  def amp_move_left(turn_ok)
    if passable?(@x-1, @y)
      turn_left if turn_ok
      @x = $game_map.round_x(@x-1)
      @real_x = (@x+1)*256
      increase_steps
      check_gravity_force
      @move_failed = false
    else
      turn_left if turn_ok
      check_event_trigger_touch(@x-1, @y)
      @move_failed = true
    end
  end
  def amp_move_right(turn_ok)
    if passable?(@x+1, @y)
      turn_right if turn_ok
      @x = $game_map.round_x(@x+1)
      @real_x = (@x-1)*256
      increase_steps
      check_gravity_force
      @move_failed = false
    else
      turn_right if turn_ok
      check_event_trigger_touch(@x+1, @y)
      @move_failed = true
    end
  end
  def amp_move_random
    case rand(2)
    when 0;  move_left(false)
    when 1;  move_right(false)
    end
  end
  def amp_move_toward_player
    sx = distance_x_from_player
    return if sx == 0
    sx > 0 ? move_right : move_left
  end
  def amp_move_away_from_player
    sx = distance_x_from_player
    return if sx == 0
    sx > 0 ? move_right : move_left
  end
  def amp_turn_random
    case rand(2)
    when 0; turn_right
    when 1; turn_left
    end
  end
end


class Game_Player < Game_Character
  alias amp_2original_initialize initialize
  alias amp_2original_update update
  alias amp_2original_move_by_input move_by_input
  def initialize
    amp_2original_initialize
    @jforce = 0
  end
  def update
    amp_2original_update
    update_jump_force if amp_map? and !@gforce
  end
  def update_jump_force
    if @jforce > 0
      return if moving?
      if @jforce > 1
        if Input.press?(Input::RIGHT)
          turn_right
          jump_upper_right
        elsif Input.press?(Input::LEFT)
          turn_left
          jump_upper_left
        else
          jump_up
        end
      else
        @move_speed = 4
        @walk_anime = true
        check_gravity_force
      end
      @jforce -= 1
    else
      if Input.trigger?(Amp_Config::Jump_Key)
        RPG::SE.new(Amp_Config::Jump_Sound,80).play
        dash? ? @jforce = 4+Amp_Config::Jump_Force : @jforce = 3+Amp_Config::Jump_Force
        @move_speed = 5
        @walk_anime = false
        @pattern = 0
      end
    end
  end
  def force_gravity
    return if moving?
    @move_speed = Amp_Config::GForce+4
    if Input.press?(Input::RIGHT)
      turn_right
      gforce_lower_right
    elsif Input.press?(Input::LEFT)
      turn_left
      gforce_lower_left
    else
      @y = $game_map.round_y(@y+1)
      @real_y = (@y-1)*256
    end
    check_touch_event
    if passable?(@x, @y+1); @gforce = true
      else; @nforce = true; @gforce = false
    end
  end
  def gforce_lower_left
    if (passable?(@x, @y+1) and passable?(@x-1, @y+1)) or
       (passable?(@x-1, @y) and passable?(@x-1, @y+1))
      @x -= 1
      @y += 1
    else
      @y = $game_map.round_y(@y+1)
      @real_y = (@y-1)*256
    end
  end
  def gforce_lower_right
    if (passable?(@x, @y+1) and passable?(@x+1, @y+1)) or
       (passable?(@x+1, @y) and passable?(@x+1, @y+1))
      @x += 1
      @y += 1
    else
      @y = $game_map.round_y(@y+1)
      @real_y = (@y-1)*256
    end
  end
  def jump_up
    if passable?(@x, @y-1)
      @y = $game_map.round_y(@y-1)
      @real_y = (@y+1)*256
      @move_failed = false
    else
      check_event_trigger_touch(@x, @y-1)
      @move_failed = true
      @jforce = 0
      check_gravity_force
    end
  end
  def jump_upper_left
    unless @direction_fix
      @direction = (@direction == 6 ? 4 : @direction == 2 ? 8 : @direction)
    end
    if (passable?(@x, @y-1) and passable?(@x-1, @y-1)) or
       (passable?(@x-1, @y) and passable?(@x-1, @y-1))
      @x -= 1
      @y -= 1
    else
      jump_up
    end
  end
  def jump_upper_right
    unless @direction_fix
      @direction = (@direction == 4 ? 6 : @direction == 2 ? 8 : @direction)
    end
    if (passable?(@x, @y-1) and passable?(@x+1, @y-1)) or
       (passable?(@x+1, @y) and passable?(@x+1, @y-1))
      @x += 1
      @y -= 1
    else
      jump_up
    end
  end
  def move_by_input
    amp_map? ? amp_move_by_input : amp_2original_move_by_input
  end
  def amp_move_by_input
    return if @gforce
    return unless movable?
    return if $game_map.interpreter.running?
    case Input.dir4
    when 4; move_left
    when 6; move_right
    end
  end
end


Demo:
http://www.mediafire.com/?6ay4b7hxltdh542

Notes:
Do please note that this script will NOT give you a
pure, precise platforming experience. I recommend using it
only for minigames, or short games. For longer projects,
I'd suggest complex eventing, or another engine (I.E. Game Maker). wink.gif

Reported Bugs:
None yet.

The original post on ReinoRPG:
http://reinorpg.com/forum/index.php?topic=14457.msg139144

That's it. All credit goes to Khas. Let me know of any bugs or concerns.
Ciao~

This post has been edited by Avatar176: Jun 12 2011, 10:00 PM


__________________________
I'm mainly at rpgmakervx.net
So I won't be replying very much here. Just showing off posting my games. =P


Yes, I am a fan of Justin Bieber and Rebecca Black. Deal with it.
Ciao~
Go to the top of the page
 
+Quote Post
   
Paper PokéMaste...
post May 19 2011, 04:44 AM
Post #2


Gotta catch 'em all!
Group Icon

Group: Revolutionary
Posts: 633
Type: Event Designer
RM Skill: Skilled




Looks interesting. biggrin.gif


__________________________
CONGRATULATIONS!
You have been selected out of OVER 9000 for a -FREE- spamwich!!
Just click this link to claim your prize!
Go to the top of the page
 
+Quote Post
   
InfinateX
post May 22 2011, 10:58 AM
Post #3


Level 10
Group Icon

Group: Revolutionary
Posts: 151
Type: Developer
RM Skill: Advanced




Nice Script! I've always wanted to an SMW-esque game

This post has been edited by RPGMakerVX52: May 22 2011, 11:09 AM


__________________________
I Support:






Legal Stuff:

If you use any of my resouces please credit me. I put © on all of them so you pretty much have to anyways.


Click Here

Some of you may have seen what I had posted in this spot before but now it just says that the request was fufilled on March 28, 2011 :)


I bet nobody knows how I did this:

If you think you figured it out PM me and if your correct you will earn this valueble skill... or you can just brag about it :D


Current Projects:

At rmrk.net/index.php/topic,42236.new.html#new and omega-dev.net/forums/showthread.php?tid=1086&pid=21328
Go to the top of the page
 
+Quote Post
   
Avatar176
post Jun 12 2011, 10:00 PM
Post #4


Level 3
Group Icon

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




^Aren't you from rmvx.net?

Anyway, decided to add a demo.
http://www.mediafire.com/?6ay4b7hxltdh542

I actually made it a long time ago, but forgot to post it here.
It was already at rmvx.net. laugh.gif


__________________________
I'm mainly at rpgmakervx.net
So I won't be replying very much here. Just showing off posting my games. =P


Yes, I am a fan of Justin Bieber and Rebecca Black. Deal with it.
Ciao~
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: 23rd May 2013 - 10:39 PM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker