Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Velsarbor Jumping System

Uhm...
Anyone ever played Velsarbor(Rm2k3)?
If so, you will probably understand what I'm talking about.
By the tad I know of scripting(andit is VERY tad), I'd presume this isn't a extense command, that's why I'll ask. ^^

First, let I show you by a screenshot:
http://img115.imageshack.us/img115/6868 ... pleqt1.jpg[/img]

In that Screenshot, as you may see, there is an orange spot(It's a picture), right in front of the hero. It appears every time the hero is at least 2 tiles from the spot's tile. When you are there, you may jump by pressing Z.

There are to ways of making that.
1 -- what an moderate programmer would do -- is to make a lot of below-hero-events on the side of the spot. There, programming the indication picture to appear.
2 -- what an experter programmer would do -- is to make parallel process events using a relation between the spots' coodinates and the hero's coordinates to make the indication pictures appear.

The problem is:
-The 1 method uses lots of events on a Map. That lags RMXP.
-The second method is way boring to do, so that's why I'm asking a script.

What I want is:
A Script that defines on the Script Editor to appear a picture on an event everytime the hero is 2 tiles away of the same event. The event would be defined by using Call Script command.
I would just want the picture apearence, nothing more than that. I can program the jumping :D.
 

OS

Sponsor

Haha. Easy. May not be perfect, and requires a little work, but I'm sure you'll be fine, right?

Code:
#==========================#
# Game_Event Edit          #
# By OS                    #
#==========================#
# Use:                     #
#                          ######################################
# Call Script: $game_map.events[id].jump_event!                 #
# Conditional Branch: Script: $game_map.events[id].jump_event?  #
# <> (Inside ConBranch) Self Switch/Switch                      #
# Page 2 with Jump Event Image and Jump Code                    #
#===============================================================#
class Game_Event
  def jump_event!
    @jump = true
  end
  
  alias os_updt update
  def update
    os_updt
    if @jump != nil and @jump == true
      if (@x - $game_player.x <= 2) || ($game_player.x - @x <= 2) || (@y - $game_player.y <= 2) || ($game_player.y - @y <= 2)
        @jump_image = true
      end
    end
    return
  end
  
  def jump_event?
    if @jump != nil
      return @jump
    end
    return
  end
end

Peace.
 
My very thanks!
But I'll have to disturb you again... ._.

I didn't undestand excatly what to do.

-Where you put "~events[id]", you mean, for example, that EV033 ID's must be 33?

-I definitively didn't understand what you meant by "Self Switch/Switch"... ._.

-The Page 2 must be a parallel process right?


I don't know... What is actually happening is that the condition is not working. :|
Sorry for any laziness.
 

OS

Sponsor

haha. Give me a few mintues to make some screens to show you. And yes, id is the Event ID.

Okay. You need this script update;
Code:
#==========================#
# Game_Event Edit          #
# By OS                    #
# Version 1.2                               #
#==========================#
# Use:                     #
#                          ######################################
# Call Script: $game_map.events[id].jump_event!                 #
# Conditional Branch: Script: $game_map.events[id].jump_event?  #
# <> (Inside ConBranch) Self Switch/Switch                      #
# Page 2 with Jump Event Image and Jump Code                    #
#===============================================================#
class Game_Event
  def jump_event!
    @jump = true
  end
  
  alias os_updt update
  def update
    os_updt
    if jump_event?
      if (@x - $game_player.x <= 2) || ($game_player.x - @x <= 2) || (@y - $game_player.y <= 2) || ($game_player.y - @y <= 2)
        @jump_image = true
      else
        @jump_image = false
      end
    end
    return
  end
  
  def jump_event?
    if @jump != nil
      return @jump
    end
    return
  end
  
  def jump_image?
    return @jump_image if @jump_image != nil
  end
end
Then you need to make the Jump event with these two pages:
View attachment 2977
View attachment 2978

And then create a new event somewhere like this:
View attachment 2979

That should be easy 'nough, right?

Sorry if it takes too much work.
 
I'm with some strange failures, and as the system is working for you, I would not like to disturb you anymore with this thing... So, I'll make a last request. :|

Can you upload what you did as a demo? ^^
Sorry if it is asking too much, I know you have more systems to work on.
 

OS

Sponsor

Looking at the code, I realize an error I made that makes me feel stupid. First, there needs to be 'end' at the end of the code in the Event that only has a Call Script Command.

Secondly, in the script itself, it checks for 2 spaces away left, right, up, OR down, so if you are at the bottom of the map, and the Jump thingy is at the top, but your x values are 2 apart or less, you can still see it. I have fixed this, and now I am going to fix the first Event, which is automatically calling Page 2, for reasons currently unknown. I'll be back soon with a working demo.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top