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.

help with pixelmovement script?

tofuu

Member

this script below im having problems with...i want to turn the mini-map off but cant understand how...any help please?

Code:
#===============================================================================

# ** Pixelmovement Script

#-------------------------------------------------------------------------------

#

# f0tz!baerchen

# v1.5

# 01.11.07

#

#-------------------------------------------------------------------------------

#

# Credits: 

# arevulopapo (turn toward/away player methods, stay_in_range method, 

#              distance method, beta tester and lots of other small things.. (;)

# Caesar (fill_circle method)

# Fanha Giang (Autotile handling)

# Caldaron (move_toward_player method)

# Drag-On (beta tester)

# Monsta (beta tester)

# Wollnashorn (beta tester)

# Abt Plout�n (beta tester, helped with many difficult codings..)

# The RMXP.org Community (for the great amount of ideas :) )

#

# please tell me if I forgot you (; 

#

#-------------------------------------------------------------------------------

#

# Importance:

# This script has many more features than only Pixelmovement. Information for 

# the options can be found at the end of the script. There you can also change 

# the settings Sometimes you have to add a comment in an event to activate 

# special features for this event. The Script checks every line for such 

# comments until it finds a non comment line.

#

#-------------------------------------------------------------------------------

#

# Used Global Variables:

# $pixelmovement: Settings of the Pixelmovement Script

#

#-------------------------------------------------------------------------------

#

# What do I have to do if I would like to use this script in my game?

# If your game is not commercial its enough to credit me (f0tz!bearchen) in your

# game, if you'd like to sell you game please contact me and we can talk about 

# this (but normally I only would like to have some information about your 

# project and a free version of the finished game)

#

#-------------------------------------------------------------------------------

#

# New Things:

# - opacity of minimap sprites depends now on the opacity of the real sprites

# - no error because of an empty party

# - Direction fix works fine now

# - Caterpillar + Surface Maps work fine together now

# - jump not works fine now

# - char_sprite returns the real sprite now, no copy

# - if an object of the class RPG::MoveCommand is a move command 

#   (Move_Down, etc), @parameters[0] will contain the number of steps

# - new pathfinding:

#   it works much faster and better now, because it uses pre-saved waypoints, 

#   which are lying on the map and contain information about connections to 

#   other waypoints..

#   if the start/target does not lie on a waypoint the next waypoint is chosen

#   of course the creating of those waypoints takes some time, but it only needs

#   to be done once (if the map isnt changed anymore after this), because the 

#   information is stored in a file

#   I already implemented a method which will create waypoints for all (or only 

#   some) maps.. this method can be called by the game maker once after the game

#   has been finished, so the player wont have to wait too long at anytime when 

#   playing the game..

#   when no route to the target is found, the pathfinding tries to get as near

#   as possible to the target. if this is also not possible and the minimum

#   distance gets too big, simply nothing happens. of course this finding of the

#   way to the nearest accessible point is a bit more time consuming.

#   While searching a path the game does not freeze, it just continues running

#   (maybe a bit slower) until the path is found and of course the event which

#   will run the path can move the whole time. By the way it is also possible

#   now to run pathfinding for more than one event at the same time.

# - new methods for Game_Character: turn_toward_coords(x, y), 

#   direction_to(id) (returns the direction in which the event lies), 

#   jump_to(x, y); passable? improved; on_event? new

# - caterpillar: will stop immediately if the hero stops because of a message or

#   a running event process, etc.

# - zoom level of the player sprite on the minimap can be changed now

# - 4Dir Movement possible (only diagonal OR normal), 

#   Input Modul: method dir4diag added

# - all turn/move methods have been simplified

# - events dont walk anymore if they are activated

# - changing the player's sprite works fine now (also on the minimap)

# - loop maps work fine now with database passability

# - the changing of the frame/direction_number is instant now

# - if the event has more than one page always the comments of the current page 

#   are used

# - working together with the new SDK / MCLAB // with/without Anti-Lag

# - Bugfix: event editing works now in saved games too

# - Position(0, 0) is now in the upper left corner of the map

# - events with tile graphics work fine now

# - many things have been optimized

# - caterpillar: character graphics are changed instantly now

# - event graphics can be shifted via a comment

# - frame speed of the events can be changed

# - isometric has been rebuild (more elegant now, only the update_move is used)

# - no table for a bitmap anymore 

#   (the passability tables are stored in $game_map and in files now)

# - When creating Waypoints, a collision table is saved in a file, too

# - passability at events has been improved (stops now at an event and does not 

#   walk through it, if this is in its route, but the route goes further)

# - Game_Player: update-method has been rebuilt

# - Important: Don't forget to delete all files if you change a map.. (;

# - Game_Character: move_to_place(x, y) moves straight to coordinates x, y

# - Minimap Bugfix: Chars which are on the Minimap but not on the Screen are

#   moved properly now

#   Minimap Bugfix: is placed corretly now, if the map is smaller than the

#   general minimap settings and the position is not the upper left corner

# - Caterpillars don't move strange anymore when going across a "border" on a

#   looped map

# - Passability at very small obstacles (1-2Px) has been improved

# - Collision Maps are Black / Transparent now instead of Black / White

#   the bitmaps can still be Black / White but White has to be the transparent

#   colour of the bitmap

# - $pixelmovement is the only used global variable

# - Erase Event Command works fine now

# - Game_Character: turn_toward_coords is much faster now

# - Obstacle Passabilities work fine now, Square Autotiles, too

#

#===============================================================================

 

#===============================================================================

# Class which holds all Pixelmovement settings

#===============================================================================

class Pixelmovement_Settings

  attr_accessor :pixel_aliasing

  attr_accessor :collision_folder

  attr_accessor :height_folder

  attr_accessor :swamp_folder

  attr_reader :frame_number

  attr_accessor :frame_array

  attr_reader :stand_frame

  attr_accessor :stand_array

  attr_accessor :frame_speed

  attr_reader :direction_number

  attr_accessor :movement_type

  attr_accessor :direction_array

  attr_reader :isometric

  attr_reader :cater_activate

  attr_accessor :cater_distance

  attr_reader :cater_overlap

  attr_accessor :player_size

  attr_reader :player_frame_number

  attr_reader :player_direction_number

  attr_reader :player_stand_frame

  attr_accessor :player_frame_speed

  attr_reader :player_shift_x

  attr_reader :player_shift_y

  attr_accessor :event_size_add

  attr_accessor :sprint_speed

  attr_accessor :sprint_key

  attr_accessor :sprint_time

  attr_accessor :sprint_wait

  attr_reader :sprint_fix

  attr_reader :minimap

  attr_reader :minimap_sprites

  attr_accessor :minimap_pos

  attr_accessor :minimap_width

  attr_accessor :minimap_height

  attr_accessor :minimap_scale

  attr_accessor :minimap_player_scale

  attr_accessor :minimap_opacity

  attr_reader :minimap_collision

  attr_accessor :minimap_c_cursor

  attr_accessor :minimap_c_pass

  attr_accessor :minimap_c_n_pass

  attr_accessor :loop_maps

  attr_reader :sliding

  attr_accessor :jump_key

  attr_accessor :jump_height

  attr_accessor :jump_length

  attr_accessor :ice_tiles

  attr_reader :panorama_scrolling

  attr_accessor :waypoints_settings

  attr_accessor :events

  attr_accessor :minimaps

  

  #-----------------------------------------------------------------------------

  # initialising method

  #-----------------------------------------------------------------------------

  def initialize(aliasing = false)

    @pixel_aliasing = aliasing # aliased methods are only aliased once

    @collision_folder = 'Graphics/ZPassability/'

    @height_folder = 'Graphics/ZSurface/'

    @swamp_folder = 'Graphics/ZSwamps/'

    @frame_number = 4

    @frame_array = []

    @stand_frame = 0

    @stand_array = [] 

    @direction_number = 4

    @frame_speed = 1.0

    @movement_type = 'dir4'

    @direction_array = []

    @player_size = []

    @player_frame_speed = 1.0

    @event_size_add = 0

    @waypoints_settings = [true, []]

    @cater_distance = 8

    @cater_activate = true

    @cater_overlap = true

    @sprint_speed = 1

    @sprint_key = Input::A

    @sprint_time = 50

    @sprint_wait =  20

    @sprint_fix = false

    @minimap_pos = 1 

    @minimap_width = 160.0 

    @minimap_height = 120.0

    @minimap_scale = 4.0

    @minimap_player_scale = 3.0

    @minimap_opacity = 200 

    @minimap_c_cursor = Color.new(255, 0, 0) 

    @minimap_c_pass = Color.new (255, 255, 255)

    @minimap_c_n_pass = Color.new(0, 0, 0) 

    @minimap = true

    @minimap_sprites = true

    @minimap_collision = false

    @loop_maps = []

    @jump_key = Input::X 

    @jump_height = 2

    @jump_length = 64

    @ice_tiles = []

    @isometric = false

    @sliding = true

    @panorama_scrolling = false    

    

    @events = nil

    @minimaps = {}

  end

  

  #-----------------------------------------------------------------------------

  # switch to (de)activate caterpillars

  #-----------------------------------------------------------------------------

  def switch_caterpillar(value = nil)

    @cater_activate = value == nil ? !@cater_activate : value

        

    return if not $scene.is_a?(Scene_Map) or $scene.spriteset == nil or 

              not $game_map.is_a?(Game_Map)

    

    $scene.spriteset.game_party_actors_sprites.each {|actor| actor.dispose}

    $scene.spriteset.game_party_actors_sprites = []

    $game_map.game_party_actors = []

    

    return if not @cater_activate 

    

    for i in 1..$game_party.actors.length

      $game_map.game_party_actors.push(Game_Party_Actor.new(i))

    end     

    for i in 0..($game_map.game_party_actors.length  - 1)

      sprite = Sprite_Character.new($scene.spriteset.viewport1, 

                                    $game_map.game_party_actors[i])

      sprite.z -= 1

      $scene.spriteset.game_party_actors_sprites.push(sprite)

    end     

  end

  

  #-----------------------------------------------------------------------------

  # switch for isometric function

  #-----------------------------------------------------------------------------

  def switch_isometric(value = nil)

    @isometric = value == nil ? !@isometric : value

    

    return if not @cater_activate or $game_map == nil or 

              $game_map.game_party_actors == nil

              

    for actor in $game_map.game_party_actors

      actor.moveto($game_player.x, $game_player.y)

    end    

  end

  

  #-----------------------------------------------------------------------------

  # switch for caterpillar overlapping

  #-----------------------------------------------------------------------------

  def switch_cater_overlap(value = nil)

    @cater_overlap = value == nil ? !@cater_overlap : value

  end

  

  #-----------------------------------------------------------------------------

  # switch for direction fix while sprinting

  #-----------------------------------------------------------------------------

  def switch_sprint_fix(value = nil)

    @sprint_fix = value == nil ? !@sprint_fix : value

  end

   #-----------------------------------------------------------------------------

  # switch for the minimap

  #-----------------------------------------------------------------------------

  def switch_minimap(value = nil)

    @minimap = value == nil ? !@minimap : value

  end

  

  #-----------------------------------------------------------------------------

  # switch for the minimap character sprites

  #-----------------------------------------------------------------------------

  def switch_minimap_sprites(value = nil)

    @minimap_sprites = value == nil ? !@minimap_sprites : value

  end

  

  #-----------------------------------------------------------------------------

  # switch for the collision minimap

  #-----------------------------------------------------------------------------

  def switch_minimap_collision(value = nil)

    @minimap_collision = value == nil ? !@minimap_collision : value

  end

 

  

  #-----------------------------------------------------------------------------

  # switch for hero sliding

  #-----------------------------------------------------------------------------

  def switch_sliding(value = nil)

    @sliding = value == nil ? !@sliding : value

  end

  

  #-----------------------------------------------------------------------------

  # switch for special panorama scrolling

  #-----------------------------------------------------------------------------

  def switch_panorama_scrolling(value = nil)

    @panorama_scrolling = value == nil ? !@panorama_scrolling : value

  end

  

  #-----------------------------------------------------------------------------

  # changes the frame number of the player

  #-----------------------------------------------------------------------------

  def player_frame_number=(value)

    return if value == @player_frame_number

    @player_frame_number = value

    return if $game_player == nil or $game_map == nil

    

    ($game_map.game_party_actors + [$game_player]).each do |event|

      event.init_special_settings

    end

  end

  

  #-----------------------------------------------------------------------------

  # changes the direction number of the player

  #-----------------------------------------------------------------------------

  def player_direction_number=(value)

    return if value == @player_direction_number

    @player_direction_number = value

    return if $game_player == nil or $game_map == nil

    

    ($game_map.game_party_actors + [$game_player]).each do |event|

      event.init_special_settings

    end

  end

  

  #-----------------------------------------------------------------------------

  # changes the stand frame of the player

  #-----------------------------------------------------------------------------

  def player_stand_frame=(value)

    return if value == @player_stand_frame

    @player_stand_frame = value

    return if $game_player == nil or $game_map == nil

    

    ($game_map.game_party_actors + [$game_player]).each do |event|

      event.init_special_settings

    end

  end

  

  #-----------------------------------------------------------------------------

  # changes the shift in x direction of th player

  #-----------------------------------------------------------------------------

  def player_shift_x=(value)

    return if value == @player_shift_x

    @player_shift_x = value

    return if $game_player == nil or $game_map == nil

    

    ($game_map.game_party_actors + [$game_player]).each do |event|

      event.init_special_settings

    end

  end

  

  #-----------------------------------------------------------------------------

  # changes the shift in y direction of th player

  #-----------------------------------------------------------------------------

  def player_shift_y=(value)

    return if value == @player_shift_y

    @player_shift_y = value

    return if $game_player == nil or $game_map == nil

    

    ($game_map.game_party_actors + [$game_player]).each do |event|

      event.init_special_settings

    end

  end

  

  #-----------------------------------------------------------------------------

  # changes the frame number of the events

  #-----------------------------------------------------------------------------

  def frame_number=(value)

    return if value == @frame_number

    @frame_number = value

    return if $game_map == nil

    

    e = ($game_map.game_party_actors + $game_map.events.values + [$game_player])

    e.each {|event| event.init_special_settings}

  end

  

  #-----------------------------------------------------------------------------

  # changes the direction number of the events

  #-----------------------------------------------------------------------------

  def direction_number=(value)

    return if value == @direction_number

    @direction_number = value

    return if $game_map == nil

    

    e = ($game_map.game_party_actors + $game_map.events.values + [$game_player])

    e.each {|event| event.init_special_settings}

  end

  

  #-----------------------------------------------------------------------------

  # changes the stand frame of the events

  #-----------------------------------------------------------------------------

  def stand_frame=(value)

    return if value == @stand_frame

    @stand_frame = value

    return if $game_map == nil

    

    e = ($game_map.game_party_actors + $game_map.events.values + [$game_player])

    e.each {|event| event.init_special_settings}

  end

  

  #-----------------------------------------------------------------------------

  # creates waypoints for Pathfinding

  #-----------------------------------------------------------------------------

  def create_waypoints

    

    # loading bar is loaded

    $bg = Sprite.new

    $bg.bitmap = Bitmap.new(640, 480)

    $bg.bitmap.fill_rect(0, 0, 640, 480, Color.new(0, 0, 0))

    $bar = Sprite.new

    $bar.bitmap = Bitmap.new(640, 128)

    $bar.bitmap.fill_rect(0, 0, 640, 128, Color.new(255, 0, 0))

    $bar.y = 480 - 128

    

    # loads map ids

    if $pixelmovement.waypoints_settings[0]

      load = []

      for i in 1..999

        load.push(i)

      end

      load -= $pixelmovement.waypoints_settings[1]

    else

      load = $pixelmovement.waypoints_settings[1]

    end

    

    load.each do |map_id|

      name = sprintf("Map%03d.rxdata", map_id)

      load -= [map_id] if not Dir.entries('Data/').include?(name)

    end

    

    # loads waypoint

    load.each do |map_id|

      $bar.x = -640 + (load.index(map_id) + 1) * 640 / load.length

      Graphics.update

      $game_map.setup(map_id)

      path = Game_Pathfinding.new($game_player)

    end

    

    $scene = nil

    

  end

  

end

 

#-------------------------------------------------------------------------------

# creates the setting object (depending on if the game has just been 

# started or restarted)

#-------------------------------------------------------------------------------

$pixelmovement = Pixelmovement_Settings.new($pixelmovement != nil)

 
 
In an autorun event on the first map, in a script command
OR
at the top of the Main script, enter

$pixelmovement.switch_minimap(false)

I'm just guessing since I can't see the whole script

Try uploading the script to pastebin, and posting a link here. Or a link to where you got the script
 
How would I set up a map loop with this script? I plugged the pixel movement script into RMXP but non of it is working. The game test plays alright but no mini-map or map loop.
 

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