Flying minigame

Flying mini game
Version: 9.28.07

Introduction

Edit: This script adds controls for stopping left scrolling, preventing the player from moving off screen during auto right scroll and game over options for touching the left side of the screen.

Features

  • stops left scrolling
  • prevents player from moving off screen while map is scrolling right
  • Game over option if player touches the left side of the screen
Screenshots

Really not usefull as it doesn't have graphic effects

Demo

http://www.savefile.com/files/1086743

Instructions

Place this code above main and below the sdk if you use it
Content Hidden Spoiler
class Game_Temp
  #We have now made a reference point to store the data of our flying options
  #to access later
  attr_accessor :left_scroll_off
  attr_accessor :scroll_game_over
  attr_accessor :flying_scene_on
end
#-----------------------------------------
#class: Game_Map
#this class sets our boolean values to false by default and controls our left scroll option
#-----------------------------------------
class Game_Map
    #thi sets up an alias for the method initialize so that we're not replacing the default method. we do this for compatibility with
    #other scripts.
    alias_method :soul_flying_map_initialize, :initialize
      def initialize
        #sets starting values for the flying game when the map loads
        $game_temp.left_scroll_off = false
        $game_temp.scroll_game_over = false
        $game_temp.flying_scene_on = false
        #this calls the script to use the alias instead of the default from here out for this part of the script/
        soul_flying_map_initialize
      end
   
  def scroll_left(distance)
    #turns off left scroll if the flying game is loaded and lets left scroll resume if the option for it is off while the game is loaded
    if $game_temp.flying_scene_on == true
      if $game_temp.left_scroll_off == false
        @display_x = [@display_x - distance, 0].max
      end
    else
        #sets handling conditions for left scroll if the game isn't on at all
       @display_x = [@display_x - distance, 0].max
    end
  end
end
#---------------------------------------------------------------------
#class: Game_Player
#we use this class to set our handling events for hen the player hits the left side of the screen
#to have them move right a bit the flying_scene_on just has to be set to true
#to have hitting the left part of the screen cause a game over set $game_temp.scroll_game_over to true with a call script
#-----------------------------------------------------------------------------
class Game_Player < Game_Character
    alias_method :soul_flying_player_update, :update
      def update
        #moves the player right one space if they hit the left edge of the screen to force a "keep on screen effect"
        if $game_temp.flying_scene_on == true
          if @real_x < $game_map.display_x
            move_right
          end
          #calls a game over if the player touches the left side of the screen and the game over option is on
          if @real_x < $game_map.display_x && $game_temp.scroll_game_over == true
            $scene = Scene_Gameover.new
          end
          unless moving? or $game_system.map_interpreter.running? or
            @move_route_forcing or $game_temp.message_window_showing
            # Move player in the direction the directional button is being pressed
            case Input.dir4
              when 2
                move_down
              when 4
                #tells the game to only move left if they are still on screen when the left arrow is pressed
                if @real_x > $game_map.display_x
                  move_left
                end
              when 6
                move_right
              when 8
                move_up
            end
          end
        end
        soul_flying_player_update
      end
end

Expand to see the code.


FAQ

none yet

Compatibility

Without editing the sdk itself this code will not work with the sdk, no other known compatibility issues.

Credits and Thanks

Many thanks to Eilei for help getting this up and running and to trickster for help with aliasing and sdk compatibility.

Author's Notes

As stated before this is mostly an event based mini game that uses a regular map.
NOTE: the demo has an older version of the script

Terms and Conditions

Free to use for non commercial games, no credit needed.
[QUOTE=soulofwolf;286485]Without editing the sdk itself this code will not work with the sdk, no other known compatibility issues.[/QUOTE]

You are not supposed to edit the SDK itself. It would mess all the compatibility efforts.

EDIT: I was checking what you have changed into the SDK. All you have to do is to add this add-on in a new script:
Content Hidden Spoiler
class Game_Player
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  alias_method :soulofwolf_flying_gmplayer_updt, :update
  def update
    if @real_x < $game_map.display_x
      move_right
    end
    if @real_x < $game_map.display_x && $game_temp.scroll_game_over == 1
      $scene = Scene_Gameover.new
    end
    soulofwolf_flying_gmplayer_updt
  end
  #--------------------------------------------------------------------------
  # * Frame Update : Player Movement
  #--------------------------------------------------------------------------
  SDK.log_overwrite(:Game_Player, :update_player_movement)
  def update_player_movement
    # Move player in the direction the directional button is being pressed
    case Input.dir4
    when 2
      move_down
     when 4
        if @real_x > $game_map.display_x
          move_left
        end
    when 6
      move_right
    when 8
      move_up
    end
  end
end
Expand to see the code.
It's exactly as Tibuda said, the SDK are guidelines set out for scripters..if you change those guidelines you are no longer following them...and thats a bad idea. Plus trick and sephspawn will kill you.
@tibuda still getting used to the scripting thing as a whole an the sdk still gives me lots of problems so untill i learn it better i'm trying to avoid it as a whole, that was just a way to try and get around the sdk for people that use it but i see your point. Tried using the script that you gave me and came back with a cannot convert symbol into string on line 1433 of the sdk which is
'found in class ' + value[0]
Expand to see the code.
the whole statement that that is contained in is
p 'The following script will not work : ' + script, 'Reason : The (' + @last_script + ') overwrites the method ' +  value[1].to_s + ' aliased from ' + "#{con[1]} to #{con[2]}" + 'found in class ' + value[0]
Expand to see the code.
not sure exactly what's making that error happen but it seems almost like its not working cause of the over write?

@mac I don't mind if trick wants to kill me for it, he's too busy to have the time to :)
screen shots of this in action?
screen shots of the demo?????
Quote:
Screenshots

Really not usefull as it doesn't have graphic effects


as the description says screen shots aren't that usefull for it you can't really take a screen shot of the screen not letting you move off it to the left, just play the demo to nderstand what it does.
code updated to no longer change the default game_map and game_player scripts and to work with the sdk
lol.. i requested this a view weeks ago ^^

Is it compatible with the "new Mode7 Script" ???
to be honest i don't know for sure but it shouldn't have any compatibility issues, try it out and if it does let me know and i'll see what i can do to fix it :)
tried it.. My hero is invisible... doesn?t matter if i use a move route to change the opacity.. or if i use the transparency flag... he isn?t visible..

And:
I can?t download the Demo ( says that i have no permission to do ).
Yes, I can't seem to download the demo either. It sounds like a nice script, and I'd like to see it in action.
Quote:
tried it.. My hero is invisible... doesn?t matter if i use a move route to change the opacity.. or if i use the transparency flag... he isn?t visible..

And:
I can?t download the Demo ( says that i have no permission to do ).


As to your hero being invisible nothing about this script changes anything to do with that at all, so i'll take a look at mode 7 for ya and see if i can't figure anything out sometime later, probably after this weekend. as to the download unfortunately there's nothing i can do about that untill a admin approves it for download?

in the mean time i also uploaded it http://www.savefile.com/files/1086743 here
Nice. I love this system. Would it be possible to implement some kind of a shooting feature to it? Like in conjunction with an ABS? Maybe make an airplane RPG?

Just wondering >.>
that's actually something i've been considering doing, just not sure if i want it to shoot straight ahead or have asdw control the "aiming" mechanism, decide one of them and when i'm finished with my Tbs i'll make it, though that might not be for a couple months
I?ve a system like that here. Here?s a video of it:
http://www.youtube.com/watch?v=NcuY2Cg-Gh4

The only roblem is, that this is a Event based scroll type game. That means:
All the things you?ve done via scripting.. I?ve done via eventcodings.
Problem:
The hero is able to leave the screen left and right.
if you want to use events to force the player to stay on screen make a row of events on each edge of the screen that are event touch that move the player right if on left side and left if on right side, set their movement pattern to be the same as your scroll speed and don't give them a graphic, make sure the movement frequency is the most often and the speed matches the scroll speed and it works fine. there's other little eventing tricks that work too, that's just the easiest one.

also are you using a RTB for the firing or did you manage to do that with events?
tried it ^^ i?m not a idiot if i must code with events...

The Problem is, that the player stops short after moving right ( if he touches the left side )..
And teh second Problem is:
The Map has a size of 80x60
80 = Looped map. The size is for not always showing the same map. With a width of 80 fields, the map works greater.
60 = To let the map look like a 3D Map ( shown in the Video ).

So if i create a row of events in front and back of the screen, it?ll lag with 20-27 FPS ( tested ).

The fire is made via Event-Cloning
25 Shots at the same time on the screen are possible. The Shots are on a seperated map. They?ll be cloned from this map to the player?s map.
Set move right player
set speed 6
move right
move right
set move (whatever your default is?)
will move the player far enough over so that the event will continue to work aka the player won't move short, and for a map your size have you thought about just having the single event move up or down when the player does?
Quote:
and for a map your size have you thought about just having the single event move up or down when the player does?

Yes.. but that?s not as easy as you thought..

The player isn?t only able to move near and depp in the screen.. he is able to move up % down too..
To Setup the Block Event equal to the player costs 8 FPS ( tested ).

I tried everything... I think i?ll make a new Project with pictures instead of charas ^^
WOOT! This is awesome! It would be great for the motorcycle chase in the game I'm making! It could be set to the Doomsday Zone music from Sonic 3 for Genesis/Mega Drive! Good job, dude!
thanks glad you like it!!
Hilarious.
I love it.
How do you make it scroll up?

Original thread: https://www.hbgames.org/forums/viewtopic.php?t=29238