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.

XAS Action Rpg System (Secret Of Mana Styled)

@Rainbird - You're welcome :)

I'd like some feedback on one of my maps please peeps:
3322453383_06c6f8b21b_o.png
 

Davey

Member

calvin624":2q8djxft said:
I'd like some feedback on one of my maps please peeps:
3322453383_06c6f8b21b_o.png

The mountains are still kinda square-ish. However, the stuff on the bottom of the map (mud, or something like that) looks pretty nice. Isn't it a better idea to show this in the screenshot thread or the mapping improvement thread? :wink:
 
Point taken :biggrin:

I'm trying to avoid a squarish-look but at the same time I find that fights can be awkward if the scenery is too intricate so I'm adding detail (like the mud) where I can.
 
@calvin624 - your HUD looks great indeed and your map seems to have a nice ambiance (due to the fog etc.) which might be even more important than the "perfect" map design in my opinion.

Well, now that we have Hackel's great various frames script for the attack graphics, would it even be possible to animate the hit graphics, too?? :)
 
Zeriab recently linked to a stripped down version of his anti lag script that is suppose to work with XAS - let me know your findings.

Code:
 

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

# ** Anti Event Lag System

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

# Zeriab

# Version 1.2 - No spriteset modification

# 2008-08-10 (Year-Month-Day)

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

# * Requirements :

#   

#   If you have the SDK : Version 2.0+, Part I, II

#   Does not require the SDK

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

# * Version History :

#

#   Version 0.8 -------------------------------------------------- (2007-09-03)

#    - First release

#

#   Version 0.81 ------------------------------------------------- (2007-09-05)

#    - Overwrote Game_Map's passable? method for faster collision detection

#

#   Version 0.9 -------------------------------------------------- (2007-09-12)

#    - Support for the Non-SDK patch

#    - Support for defining whether an event will always be updated or never

#      be updated by defining name patterns.

#

#   Version 1.0 -------------------------------------------------- (2007-09-24)

#   - Fixed compatibility issue with Blizzard's Caterpillar script

#   - Overwrote more methods scanning for events on a specific tile

#   - Support for defining whether an event will always be updated or never

#      be updated by specifying the event's id and map_id

#   - Some structural changes.

#   - Integrated the Non-SDK patch into the main script

#

#   Version 1.05 ------------------------------------------------- (2007-11-18)

#   - Fixed bug where sprites might not be disposed when changing scene.

#

#   Version 1.1 -------------------------------------------------- (2008-04-10)

#   - Added declaration to which common events to update

#

#   Version 1.15 ------------------------------------------------- (2008-06-19)

#   - Added automatic detection of which common events to update (optional)

#

#   Version 1.2 -------------------------------------------------- (2008-07-04)

#   - Fixed a case where an event could be registered twice causing transparent

#      events to look less transparent.

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

# * Description :

#

#   This script was designed to reduce lag by changing the data structure of 

#   the events in the Game_Map class and update the functionality accordingly

#   A goal of this script is not to change the normal event behavior, so

#   implementing it into a project should not effect previous events. It might

#   effect custom scripts.

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

# * License :

#

#   Copyright (C) 2007, 2008  Zeriab

#

#   This program is free software: you can redistribute it and/or modify

#   it under the terms of the GNU Lesser Public License as published by

#   the Free Software Foundation, either version 3 of the License, or

#   (at your option) any later version.

#

#   This program is distributed in the hope that it will be useful,

#   but WITHOUT ANY WARRANTY; without even the implied warranty of

#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the

#   GNU Lesser Public License for more details.

#

#   For the full license see <http://www.gnu.org/licenses/> 

#   The GNU General Public License: [url=http://www.gnu.org/licenses/gpl.txt]http://www.gnu.org/licenses/gpl.txt[/url]

#   The GNU Lesser General Public License: [url=http://www.gnu.org/licenses/lgpl.txt]http://www.gnu.org/licenses/lgpl.txt[/url]

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

# * Compatibility :

#

#   This is SDK compliant. It is written for SDK version 2.3.

#   It requires SDK 2.0+ if you are using the SDK

#   The Non-SDK patch is integrated so you can run it without the SDK

#   

#   The following methods has been overwritten:

#    * Game_Character.passable?

#    * Game_Map.passable?

#    * Game_Map.update_events

#    * Game_Player.check_event_trigger_here

#    * Game_Player.check_event_trigger_there

#    * Game_Player.check_event_trigger_touch

#

#   The following methods have been aliased

#    * Game_Event.jump

#    * Game_Event.moveto

#    * Game_Event.move_down

#    * Game_Event.move_left

#    * Game_Event.move_right

#    * Game_Event.move_up

#    * Game_Event.move_lower_left

#    * Game_Event.move_lower_right

#    * Game_Event.move_upper_left

#    * Game_Event.move_upper_right

#    * Game_Map.setup

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

# * Instructions :

#

#   Place this script just below the SDK if you are using the SDK.

#   Place this script just below the default if using the Non-SDK Patch

#   

#   default scripts

#   (SDK)

#   Zeriab's Anti Event Lag System

#   (custom scripts)

#   main

#

#   ~ Game_Map ~

#   There are 4 constants you can change at will in the top of the

#   Game_Map class: (You don't have to ;))

#   

#   ALWAYS_UPDATE ~ The default is false

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

#   You can set this to true if you want all events to be update always

#   This a slower option, but events behave like they do without the script.

#   You will still benifit from the faster collision detection and fewer sprites

#   This has higher priority than the event specific features. I.e never_update

#

#   BUFFER_SIZE ~ The default is 2

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

#   You can increase or decrease the buffer size by altering this value.

#   The greater this value the greater area around the visible area is updated

#   at the price of potential more lag.

#   The lower this value the smaller area around the visible area is update

#   with the potential of less lag.

#   Too low a value may get the sprites to sort of 'freeze' in the outskirts

#   of the screen.

#   Bigger sprites requires bigger buffer to prevent this.

#   

#   TILES_VERTICAL ~ The default is 15

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

#   Specifies how many tiles there are vertical

#   I included the option to change this value if you want to alter

#   the size of the game window.

#   If you for example want 800x600 I suggest changing this value to 20

#

#   TILES_HORIZONTAL ~ The default is 20

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

#   Specifies how many tiles there are horizontal

#   I included the option to change this value if you want to alter

#   the size of the game window.

#   If you for example want 800x600 I suggest changing this value to 27

#   

#   LIMIT_COMMON_EVENTS - The default is true

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

#   You can see this to false if you want all common events updated.

#   This constant only has an effect during the upstart of the program. Changing

#   it during the game will have no effect.

#   If it is set to false you can safely ignore the following three constants

#

#   SPECIFY_COMMON_EVENTS_MANUALLY - The default is false

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

#   Specifies whether you want to enter which common events should be updated

#   manually. If this is set to false you can safely ignore 

#   COMMON_EVENTS_TO_UPDATE while COMMON_EVENT_FILEPATH is of importance.

#   Vice-versa is COMMON_EVENTS_TO_UPDATE important and COMMON_EVENT_FILEPATH

#   safe to ignore if SPECIFY_COMMON_EVENTS_MANUALLY is set to true.

#   If this is set to false which common events to update will be atomatically

#   detected.

#   As a general rule of thumb: Only change this to true if you have problems

#   with the automatic detection or you want to prevent certain common events

#   with autorun or parallel process as trigger.

#

#   COMMON_EVENTS_TO_UPDATE

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

#   This constant is an array of common event ids. Only the common events with

#   the ids specified in the array will be updated. The ids are the numbers

#   shown in the database with any leading 0s removed. In general only common

#   events which have autorun or parallel process needs to be updated.

#   It will have no effect if SPECIFY_COMMON_EVENTS_MANUALLY is false

#   Let's say we want the common events 005, 009 and 020 to be updated. First we

#   will remove the leading 0s and get 5, 9 and 20. Next we will put them in the

#   array and get as end result:

#

#     COMMON_EVENTS_TO_UPDATE = [5, 9, 20]

#

#   If we had put [005, 009, 020] as the array we would have gotten an error

#   when starting the game. 

#   If we now want to update common event 045 we would add 45 to the array:

#

#     COMMON_EVENTS_TO_UPDATE = [5, 9, 20, 45]

#

#

#   COMMON_EVENT_FILEPATH - The default is 'Data/CommonEvents.rxdata'

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

#   Specifies the relative file path (To the directory of where the Game.exe is)

#   to where the common events are stored.

#   Only change this if you have changed the name or place of the

#   CommonEvents.rxdata file.

#   It will have no effect if SPECIFY_COMMON_EVENTS_MANUALLY is true

#

#

#   ~ Game_Event ~

#   Next we come to the Constants in Game_Event. They are given above the

#   Game_Map code. They have been split from the other Game_Event code for

#   Easier access:

#

#   SPECIAL_UPDATE_IDS

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

#   This constant contains a hash where you can specify how specific events

#   should be updated. Special update ids has priority over name patterns.

#   The keys are all a 2-elements array. [Map_ID, Event_ID]

#   The value is either an 'A' for always update or 'N' for never update.

#   Here is an example:

#

#     SPECIAL_UPDATE_IDS = {[1,1]=>'A',

#                           [1,2]=>'N'}

#   

#   Notice the first line [1,1]=>'A'

#   It means that the event with id 1 on map 1 will always be updated.

#

#   Notice the first line [1,2]=>'N'

#   It means that the event with id 2 on map 1 will never be updated.

#   Let's say we wanted the event with id 5 on map 3 to always be updated.

#   This can be achieved by adding [5,3]=>'A' to the hash:

#

#     SPECIAL_UPDATE_IDS = {[1,1]=>'A',

#                           [1,2]=>'N',

#                           [5,3]=>'A'}

#

#

#   NEVER_UPDATE_NAME_PATTERNS

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

#   Here you can specify any number of patterns which will be checked when a

#   new map is loaded. Any events which matches at least one of the patterns

#   given here will never be updated.

#   A pattern is assumed to be either a String or a RegExp. In the case of a

#   String name.include?(string) is used. Otherwise the =~ operator is used

#   Note: The never_update feature has higher priority than the always_update.

#   If an event's name matches both a always update pattern and a never_update

#   pattern it will never update.

#

#   ALWAYS_UPDATE_NAME_PATTERNS

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

#   Here you can specify any number of patterns which will be checked when a

#   new map is loaded. Any events which matches at least one of the patterns

#   given here will always be updated.

#   Note: The always_update feature has lower priority than the never_update.

#   If an event's name matches both a always update pattern and a never_update

#   pattern it will never update.

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

 

if Module.constants.include?('SDK')

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

  # * SDK Log Script

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

  SDK.log('Anti Event Lag System', 'Zeriab', 1.2, '2008-06-25')

  SDK.check_requirements(2.0)

end

 

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

# * Begin SDK Enable Test

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

if !Module.constants.include?('SDK') || SDK.enabled?('Anti Event Lag System')

 

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

# ** Constants for the anti lag script

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

 

class Game_Map

  ALWAYS_UPDATE = false

  BUFFER_SIZE = 2

  TILES_VERTICAL = 15

  TILES_HORIZONTAL = 20

  LIMIT_COMMON_EVENTS = true

  SPECIFY_COMMON_EVENTS_MANUALLY = false

  # If you want to specify which common events to update

  COMMON_EVENTS_TO_UPDATE = []

  # If you want the script to automatically read the common events and find

  # out which to update. Must be the path to the CommonEvents.rxdata

  COMMON_EVENT_FILEPATH = 'Data/CommonEvents.rxdata'

end

 

class Game_Event

  SPECIAL_UPDATE_IDS = {}

  NEVER_UPDATE_NAME_PATTERNS = ['[N]'] # [N] in the event name => not updated

  #ALWAYS_UPDATE_NAME_PATTERNS = ['[A]'] # [A] in the event name => always updated 

  ALWAYS_UPDATE_NAME_PATTERNS = ['[A]', 'WorldMap Time', 'Vehicle Memory', 'Reflection']

end

 

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

# ** Automatic configuration generation

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

class Game_Map

  if LIMIT_COMMON_EVENTS && !SPECIFY_COMMON_EVENTS_MANUALLY

    # Find the common events which needs to be updated

    COMMON_EVENTS_TO_UPDATE = []

    # Load the common events

    common_events = load_data(COMMON_EVENT_FILEPATH)

    # Go through the common events

    for common_event in common_events.compact

      # Check if there is a need for the common event to update

      if common_event.trigger > 0

        # C

        COMMON_EVENTS_TO_UPDATE << common_event.id

      end

    end

  end

end

 

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

# ** Game_Map

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

 

class Game_Map

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

  # * Public Instance Variables

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

  attr_reader :event_map

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

  # * Alias Listings

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

  alias_method :zeriab_antilag_gmmap_setup,   :setup

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

  # * Setup

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

  def setup(*args)

    # Makes an event map as a hash

    @event_map = {}

    # Original Setup

    zeriab_antilag_gmmap_setup(*args)

    # Go through each event

    for event in @events.values

      # Check how the event should be updated

      event.check_update

    end

  end

  

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

  # * Update Events ~ Overwritten to only updating visible and special events

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

  def update_events

    # Runs through the events

    for event in @events.values

      # checks if the event is visible or needs to be updated

      if ALWAYS_UPDATE || event.need_update?

        event.update

      end

    end

  end

  

  # Only overwrite this method if common events should be limited

  if LIMIT_COMMON_EVENTS

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

    # * Update Common Events ~ Updates only the necessary common events

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

    def update_common_events

      for i in COMMON_EVENTS_TO_UPDATE

        @common_events[i].update

      end

    end

  end

    

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

  # * Called when an event has been moved with it's old x and y coordinate

  #   Used to update its position in the event_map

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

  def move_event(old_x,old_y,event)

    # Checks if the event has moved to a new position.

    return if old_x == event.x && old_y == event.y

    # Removes the event from its old position

    remove_event(old_x, old_y, event)

    # Adds the event to its new position

    add_event(event.x,event.y,event)

  end

  

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

  # * Adds an event to the event_map at the given x and y coordinate

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

  def add_event(x,y,event)

    # Checks if there are not any events on the specific tile

    if @event_map[[x,y]].nil?

      # Sets the position on the map to be an array containing the given

      # event. (In case there are placed additional events on this tile)

      @event_map[[x,y]] = [event]

    else

      # Adds the event to the array of events on the specific tile

      @event_map[[x,y]] << event

    end

  end

  

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

  # * Removes an event from the event_map with the given x and y coordinate

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

  def remove_event(x,y,event)

    # Checks if there actually are an event on the given coordinates

    return if @event_map[[x,y]].nil?

    # Checks whether or not there are more events than the given event on

    # with the given coordinates

    if @event_map[[x,y]].size > 1

      # Deletes the events from the array of events

      @event_map[[x,y]].delete(event)

    else

      # Deletes the key along with the corresponding value from the hashmap

      # since there are no other events on the tile.

      @event_map.delete([x,y])

    end

  end

  

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

  # * Gets min_x, max_x, min_y and max_y including the buffer-size

  # Returns min_x, max_x, min_y, max_y  (tile-coordinates)

  # Returns a Rect if 'true' is given as the argument

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

  def get_tile_area(rect = false)

    # Gets the upper left x and y tile-coordinate

    x = $game_map.display_x / 128

    y = $game_map.display_y / 128

    # Computes the min and max coordinates when considering the buffer-size

    min_x = x - BUFFER_SIZE

    min_y = y - BUFFER_SIZE

    max_x = x + TILES_HORIZONTAL + BUFFER_SIZE

    max_y = y + TILES_VERTICAL + BUFFER_SIZE

    # Makes sure the min and max coordinates are within the map

    if min_x < 0

      min_x = 0

    end

    if max_x >= $game_map.width

      max_x = $game_map.width - 1

    end

    if min_y < 0

      min_y = 0

    end

    if max_y >= $game_map.height

      max_y = $game_map.height - 1

    end

    # Checks if the return should be a Rect

    if rect

      # Returns the result as a Rect

      return Rect.new(min_x, min_y, max_x - min_x, max_y - min_y)

    else

      # Returns the result as the min and max coordinates

      return min_x, max_x, min_y, max_y

    end

  end

  

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

  # * Checks if the tile with the given x and y coordinate is visible.

  #   Takes the buffer size into account.

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

  def visible?(x,y)

    min_x = $game_map.display_x / 128

    min_y = $game_map.display_y / 128

    if x >= min_x - BUFFER_SIZE && x <= min_x + BUFFER_SIZE + TILES_HORIZONTAL &&

       y >= min_y - BUFFER_SIZE && y <= min_y + BUFFER_SIZE + TILES_VERTICAL

      return true

    end

    return false

  end

  

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

  # * Get Designated Position Event ID

  #     x          : x-coordinate

  #     y          : y-coordinate

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

  def check_event(x, y)

    # Retrives the events on the specified tile

    events = event_map[[x,y]]

    unless events.nil?

      # Loop through events on tile

      for event in events

        if event.x == x and event.y == y

          return event.id

        end

      end

    end

  end

  

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

  # * Determine if Passable

  #     x          : x-coordinate

  #     y          : y-coordinate

  #     d          : direction (0,2,4,6,8,10)

  #                  *  0,10 = determine if all directions are impassable

  #     self_event : Self (If event is determined passable)

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

  def passable?(x, y, d, self_event = nil)

    # If coordinates given are outside of the map

    unless valid?(x, y)

      # impassable

      return false

    end

    # Change direction (0,2,4,6,8,10) to obstacle bit (0,1,2,4,8,0)

    bit = (1 << (d / 2 - 1)) & 0x0f

    # Retrives the events on the specified tile

    events = event_map[[x,y]]

    unless events.nil?

      # Loop through events on tile

      for event in events

        # If tiles other than self are consistent with coordinates

        if event.tile_id >= 0 and event != self_event and not event.through

          # If obstacle bit is set

          if @passages[event.tile_id] & bit != 0

            # impassable

            return false

          # If obstacle bit is set in all directions

          elsif @passages[event.tile_id] & 0x0f == 0x0f

            # impassable

            return false

          # If priorities other than that are 0

          elsif @priorities[event.tile_id] == 0

            # passable

            return true

          end

        end

      end

    end

    # Loop searches in order from top of layer

    for i in [2, 1, 0]

      # Get tile ID

      tile_id = data[x, y, i]

      # Tile ID acquistion failure

      if tile_id == nil

        # impassable

        return false

      # If obstacle bit is set

      elsif @passages[tile_id] & bit != 0

        # impassable

        return false

      # If obstacle bit is set in all directions

      elsif @passages[tile_id] & 0x0f == 0x0f

        # impassable

        return false

      # If priorities other than that are 0

      elsif @priorities[tile_id] == 0

        # passable

        return true

      end

    end

    # passable

    return true

  end

end

 

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

# ** Game_Character

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

 

class Game_Character

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

  # * Determine if Passable (Overwrite)

  #     x : x-coordinate

  #     y : y-coordinate

  #     d : direction (0,2,4,6,8)

  #         * 0 = Determines if all directions are impassable (for jumping)

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

  def passable?(x, y, d)

    # Get new coordinates

    new_x = x + (d == 6 ? 1 : d == 4 ? -1 : 0)

    new_y = y + (d == 2 ? 1 : d == 8 ? -1 : 0)

    # If coordinates are outside of map

    unless $game_map.valid?(new_x, new_y)

      # impassable

      return false

    end

    # If through is ON

    if @through

      # passable

      return true

    end

    # If unable to leave first move tile in designated direction

    unless $game_map.passable?(x, y, d, self)

      # impassable

      return false

    end

    # If unable to enter move tile in designated direction

    unless $game_map.passable?(new_x, new_y, 10 - d)

      # impassable

      return false

    end

    # If player coordinates are consistent with move destination

    if $game_player.x == new_x and $game_player.y == new_y

      # If through is OFF

      unless $game_player.through

        # If your own graphic is the character

        if @character_name != ""

          # impassable

          return false

        end

      end

    end

    # Checks for events on the new position

    events = $game_map.event_map[[new_x,new_y]]

    if events.nil?

      # passable

      return true

    end

    # Loop all events on the tile

    for event in events

      # If event coordinates are consistent with move destination

      if event.x == new_x and event.y == new_y

        # If through is OFF

        unless event.through

          # If self is event

          if self != $game_player

            # impassable

            return false

          end

          # With self as the player and partner graphic as character

          if event.character_name != ""

            # impassable

            return false

          end

        end

      end

    end

    # passable

    return true

  end

end

 

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

# ** Game_Event

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

 

class Game_Event

  # The method to alias and overwrite

  AX = [:jump, :moveto, :move_down, :move_left, :move_right, :move_up,

    :move_lower_left, :move_lower_right, :move_upper_left, :move_upper_right]

  for method in AX

    # Aliases the old method

    new_method_as_string = 'zeriab_antilag_gmtev_' + method.to_s

    new_method = new_method_as_string

    alias_method(new_method, method)

    

    # Overwrites the old method

PROG = <<FIN

    def #{method}(*args)

      old_x = @x

      old_y = @y

      #{new_method}(*args)

      unless old_x == @x && old_y == @y

        $game_map.move_event(old_x, old_y, self)

      end

    end

FIN

    # Evaluates the method definition

    eval(PROG)

  end

  

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

  # * Always_update property (is false by default) priority under never_update

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

  attr_writer :always_update

  def always_update

    @always_update = false  if @always_update.nil?

    return @always_update

  end

  

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

  # * Never_update property (is false by default) priority over always_update

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

  attr_writer :never_update

  def never_update

    @never_update = false  if @never_update.nil?

    return @never_update

  end

  

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

  # * Need Update method. Fast checks here.

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

  def need_update?

    return false if never_update

    return true if always_update

    return true if $game_map.visible?(x, y)

    return true if @move_type == 3

    return @trigger == 3 || @trigger == 4

  end

  

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

  # * Checks how the event should be updated.

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

  def check_update

    name = @event.name

    # Checks if the event is never to be updated. (For decoration)

    for pattern in NEVER_UPDATE_NAME_PATTERNS

      if (pattern.is_a?(String) && name.include?(pattern)) ||

        !(pattern =~ name).nil? 

        self.never_update = true

      end

    end

    # Checks if the event is to be always updated.

    for pattern in ALWAYS_UPDATE_NAME_PATTERNS

      if (pattern.is_a?(String) && name.include?(pattern)) ||

        !(pattern =~ name).nil? 

        self.always_update = true

      end

    end

    # Checks for special update for the particular id (overrules the patterns)

    special_update = SPECIAL_UPDATE_IDS[[@map_id,@id]]

    unless special_update.nil?

      # Checks if it never should be updated

      if special_update.downcase == 'n'

        self.never_update = true

        self.always_update = false

      # Checks if it always should be updated

      elsif special_update.downcase == 'a'

        self.always_update = true

        self.never_update = false

      end

    end

  end

end

 

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

# ** Game_Event

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

 

class Game_Player

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

  # * Same Position Starting Determinant

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

  def check_event_trigger_here(triggers)

    result = false

    # If event is running

    if $game_system.map_interpreter.running?

      return result

    end

    # Retrives the events on the specified tile

    events = $game_map.event_map[[@x,@y]]

    unless events.nil?

      # Loop through events on tile

      for event in events

        # If event triggers are consistent

        if triggers.include?(event.trigger)

          # If starting determinant is same position event (other than jumping)

          if not event.jumping? and event.over_trigger?

            event.start

            result = true

          end

        end

      end

    end

    return result

  end

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

  # * Front Event Starting Determinant

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

  def check_event_trigger_there(triggers)

    result = false

    # If event is running

    if $game_system.map_interpreter.running?

      return result

    end

    # Calculate front event coordinates

    new_x = @x + (@direction == 6 ? 1 : @direction == 4 ? -1 : 0)

    new_y = @y + (@direction == 2 ? 1 : @direction == 8 ? -1 : 0)

    # Retrives the events on the specified tile

    events = $game_map.event_map[[new_x,new_y]]

    unless events.nil?

      # Loop through events on tile

      for event in events

        # If event triggers are consistent

        if triggers.include?(event.trigger)

          # If starting determinant is front event (other than jumping)

          if not event.jumping? and not event.over_trigger?

            event.start

            result = true

          end

        end

      end

    end

    # If fitting event is not found

    if result == false

      # If front tile is a counter

      if $game_map.counter?(new_x, new_y)

        # Calculate 1 tile inside coordinates

        new_x += (@direction == 6 ? 1 : @direction == 4 ? -1 : 0)

        new_y += (@direction == 2 ? 1 : @direction == 8 ? -1 : 0)

        # Retrives the events on the specified tile

        events = $game_map.event_map[[new_x,new_y]]

        unless events.nil?

          # Loop through events on tile

          for event in events

            # If event triggers are consistent

            if triggers.include?(event.trigger)

              # If starting determinant is front event (other than jumping)

              if not event.jumping? and not event.over_trigger?

                event.start

                result = true

              end

            end

          end

        end

      end

    end

    return result

  end

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

  # * Touch Event Starting Determinant

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

  def check_event_trigger_touch(x, y)

    result = false

    # If event is running

    if $game_system.map_interpreter.running?

      return result

    end

    # Retrives the events on the specified tile

    events = $game_map.event_map[[x,y]]

    unless events.nil?

      # Loop through events on tile

      for event in events

        # If event coordinates and triggers are consistent

        if [1,2].include?(event.trigger)

          # If starting determinant is front event (other than jumping)

          if not event.jumping? and not event.over_trigger?

            event.start

            result = true

          end

        end

      end

    end

    return result

  end

end

 

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

# * End SDK Enable Test

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

end

 

unless Module.constants.include?('SDK')

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

  # * Compatibility :

  #

  #   This will probably not be compatible with scripts extending or modifying

  #   the overwritten methods. 

  #   

  #   The following methods has been overwritten:

  #    * Game_Map.update

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

  

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

  # ** Game_Map

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

  class Game_Map

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

    # * Update Common Events

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

    def update_common_events

      for common_event in @common_events.values

        common_event.update

      end

    end

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

    # * Frame Update Overwrite

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

    def update

      # Refresh map if necessary

      if $game_map.need_refresh

        refresh

      end

      # If scrolling

      if @scroll_rest > 0

        # Change from scroll speed to distance in map coordinates

        distance = 2 ** @scroll_speed

        # Execute scrolling

        case @scroll_direction

        when 2  # Down

          scroll_down(distance)

        when 4  # Left

          scroll_left(distance)

        when 6  # Right

          scroll_right(distance)

        when 8  # Up

          scroll_up(distance)

        end

        # Subtract distance scrolled

        @scroll_rest -= distance

      end

      # Update map event

      update_events

      # Update common event

      update_common_events

      # Manage fog scrolling

      @fog_ox -= @fog_sx / 8.0

      @fog_oy -= @fog_sy / 8.0

      # Manage change in fog color tone

      if @fog_tone_duration >= 1

        d = @fog_tone_duration

        target = @fog_tone_target

        @fog_tone.red = (@fog_tone.red * (d - 1) + target.red) / d

        @fog_tone.green = (@fog_tone.green * (d - 1) + target.green) / d

        @fog_tone.blue = (@fog_tone.blue * (d - 1) + target.blue) / d

        @fog_tone.gray = (@fog_tone.gray * (d - 1) + target.gray) / d

        @fog_tone_duration -= 1

      end

      # Manage change in fog opacity level

      if @fog_opacity_duration >= 1

        d = @fog_opacity_duration

        @fog_opacity = (@fog_opacity * (d - 1) + @fog_opacity_target) / d

        @fog_opacity_duration -= 1

      end

    end

  end

end

 
 
i dont like anti lag scripts but with my KI (AI) skript is it a bit faster

paste it under XAS_SYSTEM

Code:
module XAS_BA_ENEMY  

#

#ENEMY_ATTACK_SKILL = the id of the skill for a normal attack

#

ENEMY_ATTACK_SKILL = 1

end

 

module XAS_ACTION

  attr_reader   :action

  attr_reader   :erased

 

 ##################################################################################

 # nah/fern kämper ki

 #

 ################################################################################

 

def allki(fskill,ffs,skill,fs,heal,freq,healper,skilltime,speed,se,fr) 

  if @firsttime == nil 

   @timer = 0

   @timers = 0

   @runbackt = 0

   @firsttime = 0

   @wait  = 0

 end

 if @wait  == 0

 attack_off  

 @timers += 1

 @timer += 1

 speed(speed)

 give_near_actor

 enemy = self.battler

 enemylowhp = enemy.maxhp * healper / 100

 abstand =  (self.x - $game_player.x).abs + (self.y - $game_player.y).abs

  if self.battler.hp <=  enemylowhp  and heal != 0 and @timers > skilltime

    shoot(heal)

    @timers = 0

  elsif @runbackt < 20 and self.battler.hp <=  enemylowhp 

    speed(speed+0.5)

    attack_off

    flee_from_actor

    @runbackt += 1

  elsif $game_map.events[@enemytaget] != nil or @enemytaget == -1

    if @enemytaget == -1 

      ziel = $game_player

    else

      ziel = $game_map.events[@enemytaget]

    end

    abstande =  (self.x - ziel.x).abs + (self.y - ziel.y).abs

    if abstande <= 2 

      if @timers > skilltime # wenn skilltimefacher tackt

        @timers = 0

        random = rand(100)

        if random > 30 and skill != 0

          spe_on(1,fs)

          shoot(skill)

          @wait = Database_Bullet::SUFLAGS[skill].to_i

        elsif @timer >  freq and freq != 0 # wenn einfacher tackt

          @timer = 0

          @wait = 14 * (6-speed)

          turn_to_actor

                  if se != 0

         $game_system.se_play(RPG::AudioFile.new(se,80,fr))

        end

          attack_on

        end

      end

    elsif self.x == ziel.x or self.y == ziel.y 

      if abstande <= 9 and @timers > skilltime and fskill != 0

        @timers = 0

        random = rand(100)

        if random > 30 

          spe_on(2,ffs)

          turn_to_actor

          shoot(fskill)

          @wait = Database_Bullet::SUFLAGS[fskill].to_i

         end   

        end

    else

      attack_off

      find_to_actor

    end

  end

else

  @wait -= 1

  end

end

 ##################################################################################

 # KI nah/fern kämpfer END

 #

 ################################################################################

    

  

  

 ##################################################################################

 # fernkämper ki

 #

 ################################################################################

 

def fkeki(askill,skill1,fs1,skill2,fs2,heal,freq,healper,skilltime,speed,se,fr)  

  if @firsttime == nil 

   @timer = 0

   @timers = 0

   @runbackt = 0

   @firsttime = 0

   @repeatrun = 0

   @getroffen = self.battler.maxhp

   @wait  = 0

 end

 if @wait  == 0

 attack_off

 @repeatrun += 1

 @timers += 1

 @timer += 1

 if @repeatrun > 400

   @runbackt = 0

 end

 speed(speed)

 give_near_actor

 enemy = self.battler

 enemylowhp = enemy.maxhp * healper / 100

 abstand =  (self.x - $game_player.x).abs + (self.y - $game_player.y).abs

 if abstand  <= 2 and @runbackt < 20 and enemy.hp <  @getroffen 

    speed(speed+0.5)

    attack_off

    flee_from_actor

    @runbackt += 1

    @getroffen = enemy.hp

 elsif self.battler.hp <=  enemylowhp  and heal != 0 and @timers > skilltime

    shoot(heal)

    @wait = Database_Bullet::SUFLAGS[heal].to_i

    @timers = 0

  elsif @runbackt < 20 and enemy.hp <=  enemylowhp 

    speed(speed+0.5)

    attack_off

    flee_from_actor

    @runbackt += 1

  elsif $game_map.events[@enemytaget] != nil or @enemytaget == -1

    if @enemytaget == -1 

      ziel = $game_player

    else

      ziel = $game_map.events[@enemytaget]

    end

    abstande =  (self.x - ziel.x).abs + (self.y - ziel.y).abs

     if self.x == ziel.x or self.y == ziel.y and abstande <= 7 

      if @timers > skilltime  # wenn skilltimefacher tackt

        @timers = 0

        random = rand(100)

        if random > 80 and skill2 != 0

          spe_on(2,fs2)

          turn_to_actor

          shoot(skill2)

          @wait = Database_Bullet::SUFLAGS[skill2].to_i

        elsif random >40 and skill1 != 0

       spe_on(1,fs1)

       turn_to_actor

          shoot(skill1)

        @wait = Database_Bullet::SUFLAGS[skill1].to_i

      elsif @timer >  freq # wenn einfacher tackt

        @timer = 0

        turn_to_actor

                if se != 0

          $game_system.se_play(RPG::AudioFile.new(se,80,fr))

        end

        stateattack_on(askill)

        @wait = Database_Bullet::SUFLAGS[askill].to_i

      end

      end

    else

      attack_off

      find_to_actor

    end

  end

else

  @wait -= 1

  end

  end

 

 ##################################################################################

 # KI fernkämpfer END

 #

 ################################################################################

  

  

 ##################################################################################

 # kämper ki

 #

 ################################################################################

 

def keki(skill1,fs1,skill2,fs2,heal,freq,healper,skilltime,speed,se,fr) 

  if @firsttime == nil 

   @timer = 0

   @timers = 0

   @runbackt = 0

   @firsttime = 0

   @wait  = 0

 end

 if @wait  == 0

 attack_off

 @timers += 1

 @timer += 1

 speed(speed)

 give_near_actor

 enemy = self.battler

 enemylowhp = enemy.maxhp * healper / 100

 abstand =  (self.x - $game_player.x).abs + (self.y - $game_player.y).abs

  if self.battler.hp <=  enemylowhp  and heal != 0 and @timers > skilltime

    shoot(heal)

    @timers = 0

  elsif @runbackt < 20 and self.battler.hp <=  enemylowhp 

    speed(speed+0.5)

    attack_off

    flee_from_actor

    @runbackt += 1

  elsif $game_map.events[@enemytaget] != nil or @enemytaget == -1

    if @enemytaget == -1 

      ziel = $game_player

    else

      ziel = $game_map.events[@enemytaget]

    end

    abstande =  (self.x - ziel.x).abs + (self.y - ziel.y).abs

    if abstande <= 2 

      if @timers > skilltime  # wenn skilltimefacher tackt

        @timers = 0

        random = rand(100)

        if random > 80 and skill2 != 0

          spe_on(2,fs2)

          shoot(skill2)

          @wait = Database_Bullet::SUFLAGS[skill2].to_i

        elsif random >40 and skill1 != 0

          spe_on(1,fs1)

          shoot(skill1)

        @wait = Database_Bullet::SUFLAGS[skill1].to_i

      elsif @timer >  freq and freq != 0 # wenn einfacher tackt

        @timer = 0

        turn_to_actor

        @wait = 14 * (6-speed)

        if se != 0

          $game_system.se_play(RPG::AudioFile.new(se,80,fr))

        end

          attack_on

      end

      end

    else

      attack_off

      find_to_actor

    end

  end

else

  @wait -= 1

  end

  end

 

 ##################################################################################

 # KI kämpfer END

 #

 ################################################################################

 

    

 def give_near_actor

     @abstand2 = 0

     for event in $game_map.events.values

       if event.battler != nil

         if event.battler.is_a?(Game_Actor)

           abstand =  (self.x - event.x).abs + (self.y - event.y).abs

           if @abstand2 == 0 or abstand < @abstand2    

             @abstand2 = abstand

             @actorid = event.id

           end

         end

       end

     end

     abstandp =  (self.x - $game_player.x).abs + (self.y - $game_player.y).abs

     if @abstand2 < abstandp and @abstand2 != 0 #and @actorid != 0

       @enemytaget = @actorid

     else

       @enemytaget = -1

     end

   end 

 

 

    

    

 def check_enemys

   #if $game_map.events[@taget] == nil

    # @taget = 0

      @abstand = 0

   #  end

     for event in $game_map.events.values

 if event.battler != nil

  if event.battler.is_a?(Game_Enemy)

    abstand =  (self.x - event.x).abs + (self.y - event.y).abs

     abstandp =  ($game_player.x - event.x).abs + ($game_player.y - event.y).abs    

    if @abstand == 0 or abstand < @abstand    

            if abstandp < $game_variables[XAS_BA::SENSOR_VAR]

           @abstand = abstand

           @taget = event.id

           end

          end 

         end

       end

      end

    end

    

 def turn_to_actor

 

   #if @abstand2 == nil

     @abstand2 = 0

   # end

     for event in $game_map.events.values

       if event.battler != nil

         if event.battler.is_a?(Game_Actor)

           abstand =  (self.x - event.x).abs + (self.y - event.y).abs

           if @abstand2 == 0 or abstand < @abstand2    

             if abstand < $game_variables[XAS_BA::SENSOR_VAR]

               @abstand2 = abstand

               @actorid = event.id

             end

           end

         end

       end

     end

     abstandp =  (self.x - $game_player.x).abs + (self.y - $game_player.y).abs

     if @abstand2 < abstandp and @abstand2 != 0 #and @actorid != 0

        turn_toward_event(@actorid)

     else

       turn_toward_player

     end

end 

 

 def turn_away_from_actor

 

   #if @abstand2 == nil

     @abstand2 = 0

   # end

     for event in $game_map.events.values

       if event.battler != nil

         if event.battler.is_a?(Game_Actor)

           abstand =  (self.x - event.x).abs + (self.y - event.y).abs

           if @abstand2 == 0 or abstand < @abstand2    

             if abstand < $game_variables[XAS_BA::SENSOR_VAR]

               @abstand2 = abstand

               @actorid = event.id

             end

           end

         end

       end

     end

     abstandp =  (self.x - $game_player.x).abs + (self.y - $game_player.y).abs

     if @abstand2 < abstandp and @abstand2 != 0 #and @actorid != 0

        turn_away_from_event(@actorid)

     else

       turn_away_from_player

     end

end 

 

 

 

def find_to_player

  if jumping? or moving?

    return  

  end

  x = self.x

  y = self.y

  

  turn_toward_player

  if passable?(x,y,@direction)

    move_toward_player

    move_forward

  else

    turn_right_or_left_90

    if passable?(x,y,@direction)

      move_forward

    else

      turn_180

      if passable?(x,y,@direction)

        move_forward

      else

        #move_away_from_player

      end

    end

  end

end

 

def find_to_actor

  if jumping? or moving?

    return  

  end

  x = self.x

  y = self.y

  

  turn_to_actor

  if passable?(x,y,@direction)

    move_to_actor

    move_forward

  else

    turn_right_or_left_90

    if passable?(x,y,@direction)

      move_forward

    else

      turn_180

      if passable?(x,y,@direction)

        move_forward

      else

        move_away_from_actor

      end

    end

  end

end

 

def find_to_enemy

  if jumping? or moving?

    return  

  end

  x = self.x

  y = self.y

  turn_toward_enemy

  if passable?(x,y,@direction)

    move_to_enemy

    move_forward

  else

    turn_right_or_left_90

    if passable?(x,y,@direction)

      move_forward

    else

      turn_180

      if passable?(x,y,@direction)

        move_forward

      else

        move_away_from_enemy

      end

    end

  end

end

 

def flee_from_player

  if jumping? or moving?

    return  

  end

  x = self.x

  y = self.y

  turn_away_from_player

  if passable?(x,y,@direction)

    move_away_from_player

    move_forward

  else

    turn_right_or_left_90

    if passable?(x,y,@direction)

      move_forward

    else

      turn_180

      if passable?(x,y,@direction)

        move_forward

      else

        move_toward_player

      end

    end

  end

end

 

def flee_from_actor

  if jumping? or moving?

    return  

  end

  x = self.x

  y = self.y

 

  turn_away_from_actor

  if passable?(x,y,@direction)

    move_away_from_actor

    move_forward

  else

    turn_right_or_left_90

    if passable?(x,y,@direction)

      move_forward

    else

      turn_180

      if passable?(x,y,@direction)

        move_forward

      else

        move_to_actor

      end

    end

  end

end

 

def flee_from_enemy

  if jumping? or moving?

    return  

  end

  x = self.x

  y = self.y

 

  turn_away_from_enemy

  if passable?(x,y,@direction)

    move_away_from_enemy

    move_forward

  else

    turn_right_or_left_90

    if passable?(x,y,@direction)

      move_forward

    else

      turn_180

      if passable?(x,y,@direction)

        move_forward

      else

        move_to_enemy

      end

    end

  end

end

 def move_to_actor

    if jumping? or moving?

      return

    end

   #if @abstand2 == nil

     @abstand2 = 0

   # end

     for event in $game_map.events.values

       if event.battler != nil

         if event.battler.is_a?(Game_Actor)

           abstand =  (self.x - event.x).abs + (self.y - event.y).abs

           if @abstand2 == 0 or abstand < @abstand2    

             if abstand < $game_variables[XAS_BA::SENSOR_VAR]

               @abstand2 = abstand

               @actorid = event.id

             end

           end

         end

       end

     end

     abstandp =  (self.x - $game_player.x).abs + (self.y - $game_player.y).abs

     if @abstand2 < abstandp and @abstand2 != 0 #and @actorid != 0

        move_toward_event(@actorid)

     else

       move_toward_player

     end

end 

   

 def move_away_from_actor

    if jumping? or moving?

      return

    end

   #if @abstand2 == nil

     @abstand2 = 0

   # end

     for event in $game_map.events.values

       if event.battler != nil

         if event.battler.is_a?(Game_Actor)

           abstand =  (self.x - event.x).abs + (self.y - event.y).abs

           if @abstand2 == 0 or abstand < @abstand2    

             if abstand < $game_variables[XAS_BA::SENSOR_VAR]

               @abstand2 = abstand

               @actorid = event.id

             end

           end

         end

       end

     end

     abstandp =  (self.x - $game_player.x).abs + (self.y - $game_player.y).abs

     if @abstand2 < abstandp and @abstand2 != 0 #and @actorid != 0

        move_away_from_event(@actorid)

     else

       move_away_from_player

     end

end 

def turn_toward_event(id)

    # Get difference in player coordinates

    if $game_map.events[id] != nil

    sx = @x - $game_map.events[id].x

    sy = @y - $game_map.events[id].y

    # If coordinates are equal

    if sx == 0 and sy == 0

      return

    end

    # If horizontal distance is longer

    if sx.abs > sy.abs

      # Turn to the right or left towards player

      sx > 0 ? turn_left : turn_right

    # If vertical distance is longer

    else

      # Turn up or down towards player

      sy > 0 ? turn_up : turn_down

    end

  end

  end

  

  

  

  

    def turn_away_from_event(id)

    # Get difference in player coordinates

    if $game_map.events[id] != nil

    sx = @x - $game_map.events[id].x

    sy = @y - $game_map.events[id].y

    # If coordinates are equal

    if sx == 0 and sy == 0

      return

    end

    # If horizontal distance is longer

    if sx.abs > sy.abs

      # Turn to the right or left away from player

      sx > 0 ? turn_right : turn_left

    # If vertical distance is longer

    else

      # Turn up or down away from player

      sy > 0 ? turn_down : turn_up

    end

  end

end

 

  def move_toward_event(id)

      if $game_map.events[id] != nil

    sx = @x - $game_map.events[id].x

    sy = @y - $game_map.events[id].y

    if sx == 0 and sy == 0

      return

    end

    abs_sx = sx.abs

    abs_sy = sy.abs

    if abs_sx == abs_sy

      rand(2) == 0 ? abs_sx += 1 : abs_sy += 1

    end

    if abs_sx > abs_sy

      sx > 0 ? move_left : move_right

      if not moving? and sy != 0

        sy > 0 ? move_up : move_down

      end

    else

      sy > 0 ? move_up : move_down

      if not moving? and sx != 0

        sx > 0 ? move_left : move_right

      end

    end

  end

  end

  def move_away_from_event(id)

   if $game_map.events[id] != nil

    sx = @x - $game_map.events[id].x

    sy = @y - $game_map.events[id].y

    if sx == 0 and sy == 0

      return

    end

    abs_sx = sx.abs

    abs_sy = sy.abs

    if abs_sx == abs_sy

      rand(2) == 0 ? abs_sx += 1 : abs_sy += 1

    end

    if abs_sx

      if sx < 0 and sy > 0

      move_lower_left

      elsif sx > 0 and sy > 0

      move_lower_right

      elsif sx > 0 and sy < 0

      move_upper_right

      elsif sx < 0 and sy < 0

      move_upper_left      

      elsif sx < 0 

      move_left      

      elsif sx > 0 

      move_right

      elsif sy > 0 

      move_down    

      elsif sy < 0 

      move_up

      end

    end

  end

end

 

end

class Game_Event < Game_Character

  attr_reader   :collision_attack

  def img_act_exist?

  begin

  RPG::Cache.character(@page.graphic.character_name + "_Act" , @page.graphic.character_hue)

  rescue

  return false

  end

  return true

end

 

def img_spe_exist?(e,g)

begin

  y = e.to_s

  x = g.to_s

  RPG::Cache.character(@page.graphic.character_name + "_[" + x + "]spe" + y  , @page.graphic.character_hue)

rescue

  return false

end

return true

end

 

def spe_on(e,g)

  y = e.to_s

  x = g.to_s

  if img_spe_exist?(e,g)

    @character_name = @page.graphic.character_name + "_[" + x + "]spe" + y 

  end

end

 

 

 

 

  def spe1_on

      @character_name = @page.graphic.character_name + "_spe1" 

    end

   def spe2_on

      @character_name = @page.graphic.character_name + "_spe2" 

    end

   def spe3_on

      @character_name = @page.graphic.character_name + "_spe3" 

    end

    def spe_off     

    @character_name = @page.graphic.character_name

  end

  

   

 def stateattack_on(x)

    if self.battler.is_a?(Game_Enemy) and

       (self.battler.states.include?(XAS::MUTE_ID) or

        self.battler.states.include?(XAS::SEALATTACK_ID))

        @collision_attack = false

        self.battler.damage = XAS::SEALED_TEXT

        self.battler.damage_pop = true

        return false     

      end    

       shoot(x)

   # @collision_attack = true

    if img_act_exist?    

    @character_name = @page.graphic.character_name + "_Act" 

    end

  end

 

 

  def attack_on

    if self.battler.is_a?(Game_Enemy) and

       (self.battler.states.include?(XAS::MUTE_ID) or

        self.battler.states.include?(XAS::SEALATTACK_ID))

        #@collision_attack = false

        self.battler.damage = XAS::SEALED_TEXT

        self.battler.damage_pop = true

        return false     

      end    

       shoot(XAS_BA_ENEMY::ENEMY_ATTACK_SKILL)

    @collision_attack = true

    if img_act_exist?    

    @character_name = @page.graphic.character_name + "_Act" 

    end

  end

end

1. i change the attack method. Now every time if a enemy attack it will "cast a skill" you can change the skill in this line "ENEMY_ATTACK_SKILL = 1"

2. the new methods are
allki(fskill,ffs,skill,fs,heal,freq,healper,skilltime,speed,se,fr) this is for close and range combat enemys
fkeki(askill,skill1,fs1,skill2,fs2,heal,freq,healper,skilltime,speed,se,fr) this is for range combat enemys
keki(skill1,fs1,skill2,fs2,heal,freq,healper,skilltime,speed,se,fr) this is for close combat enemys

keki(skill1,fs1,skill2,fs2,heal,freq,healper,skilltime,speed,se,fr)
skill1 = 1st skill the graphic name must be ENEMYNAME_[fs1]spe1 fs1 = number of frames
fs1 = frames of the skill1 graphic
skill2 = 2nd skill the graphic name must be ENEMYNAME_[fs1]spe2 fs2 = number of frames
fs2 = frames of the skill2 graphic
heal = a heal skill
freq = attack speed ( 20 = fast ,60 = slow)
healper = if 30 => he start to heal if he has 30% of his hp
skilltime = same as freq only for skills
speed = walk speed 5 = fast 3 = slow
se = attack se (sound)
fr = the pitch of the se

fkeki(askill,skill1,fs1,skill2,fs2,heal,freq,healper,skilltime,speed,se,fr)
askill = the attack skill
skill1 = 1st skill the graphic name must be ENEMYNAME_[fs1]spe1 fs1 = number of frames
fs1 = frames of the skill1 graphic
skill2 = 2nd skill the graphic name must be ENEMYNAME_[fs1]spe2 fs2 = number of frames
fs2 = frames of the skill2 graphic
heal = a heal skill
freq = attack speed ( 20 = fast ,60 = slow)
healper = if 30 => he start to heal if he has 30% of his hp
skilltime = same as freq only for skills
speed = walk speed 5 = fast 3 = slow
se = attack se (sound)
fr = the pitch of the se

allki(fskill,ffs,skill,fs,heal,freq,healper,skilltime,speed,se,fr)
fskill = range skill the graphic name must be ENEMYNAME_[ffs]spe2 ffs = number of frames
ffs = frames of the rage comabt skill graphic
skill = close combat skill the graphic name must be ENEMYNAME_[fs]spe1 fs = number of frames
fs = frames of the close comabt skill graphic
heal = a heal skill
freq = attack speed ( 20 = fast ,60 = slow)
healper = if 30 => he start to heal if he has 30% of his hp
skilltime = same as freq only for skills
speed = walk speed 5 = fast 3 = slow
se = attack se (sound)
fr = the pitch of the se


if you do not have a skill or SE put 0 in

and put only a command in the move rout

some example
keki(0,0,0,0,0,30,40,0,3,0,0)
allki(77,1,0,0,0,20,10,100,3,"Mana - Duran_Hit",50)
keki(76,4,0,0,0,0,40,70,2,0,0)
fkeki(72,0,0,0,0,0,40,40,0,3,0,0)

i hope you understand how it works
 
I think Hackel should just make XAS v.4 :D :D

Nice add-ons there. If you can ever use your awesome skills to get a pixelmovement script to work with XAS, you would be a god. :thumb:
 
How about a monster auto-spawn script o.o

A script that makes sure you always have x number of x monsters on the map so when you kill one monster the system will make another one pop up randomly in the map (avoiding unpassable tiles) kinda like what MMORPG have o.o. I can also have a timer for mini-boss monsters that only appear like 1 hour after you defeat them or something ^^;
 
I think we should sacrifice Xerowig for Hackel so that he can continue scripting inplace of Xerowig (from who noone ever hears a livesignal except new versiouns)
 
No we shouldn't, I think like this, Hackel makes very cool add-ons, thank you for that Hackel, but Xiderowg still is the owner of the XAS system, so we shouldn't rely on Hackel alone. Remember, Moghunter also scripts on it. He makes the Hero versions;)
 
hi everybody! I need a little help again cause there's one thing that is very important for my current project: I need a script to change the panorama graphics several times a second. Mog's Animated panorama script is perfect for doing this, but unfortunately it doesn't work with the resolution script I'm using (viewports are not fixed for some reason, so panoramas are only displayed in a 640x480 window). As I am not a scripter and only have some little knowlegde in C++, I nevertheless tried to get it work and experienced the two following cases:

1. viewports ARE FIXED when the resolution script I'm using is left unmodified.
Mog's Animated panorama script will not work then.
2. Mog's Animated panorama script WILL WORK when the part of the resolution script that handles
Spriteset_Map class is removed (lines 400-607). Viewport fix will not work then.

This is the resolution script:
Code:
 

#################################################################################

#################################################################################

############################### Resolution #####################################

#################################################################################

#################################################################################

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

# Script written by Renan Tsuneo Hangai Junior

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

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

 

class Game_Window

    

  WINDOW_WIDTH  = 1280  

  WINDOW_HEIGHT = 960  

  FULLSCREEN = false

  

   # Fixes viewports? 

   # Viewports wide 640 will be treated as width of the screen 

   # Viewports in height 480 will be treated as height of the screen 

   # Note to scripters ---------------- ---------------- 

   # By using this script and leave below true, use the method: 

   # Viewport.new (x, y, width, height, force_fix) 

   # Where if you do not define force_fix will always be true 

   # If you leave false, will not fix the standard

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

  

  VIEWPORT_FIX = true

  

  attr_reader :x

  attr_reader :y

  attr_reader :width

  attr_reader :height

  

  def initialize

    @gpps = Win32API.new('kernel32', 'GetPrivateProfileString','PPPPLP', 'L')

    @title = "\0" * 256

    @gpps.call("Game", "Title", "", @title, 256, ".\\Game.ini")

    @title.delete!("\0")

    @set_resolution   = Win32API.new('Display.dll', 'SetResolution', 'III', '')

    @set_window_long  = Win32API.new('user32', 'SetWindowLong', 'LIL', 'L')

    @set_window_pos   = Win32API.new('user32', 'SetWindowPos', 'LLIIIII', 'I')

    @gsm              = Win32API.new('user32', 'GetSystemMetrics', 'I', 'I')

    @gcr              = Win32API.new('user32', 'GetClientRect', 'LP', 'I')

    @window           = Win32API.new('user32', 'FindWindow', 'PP', 'I').call("RGSS Player", @title)

    @kbe              = Win32API.new('user32', 'keybd_event', 'LLLL', '')

    @gaks             = Win32API.new('user32', 'GetAsyncKeyState', 'L', 'I')

    @gks              = Win32API.new('user32', 'GetKeyState', 'L', 'I')

    @default_size = self.size

    @width = WINDOW_WIDTH

    @height = WINDOW_HEIGHT

    if @default_size[0] < @width or @default_size[1] < @height

      print("Necessário uma resolução de vídeo de no mínimo #{@width} x #{@height}")

      exit

    end

    @x = (self.size[0] / 2) - (@width / 2)

    @y = (self.size[1] / 2) - (@height / 2)

    @height_add = 26

    @width_add = 6

    @state = "normal"

    if FULLSCREEN

      self.fullscreen

    else

      self.center

    end

  end

  

  def x=(valor)

    @x = valor

    @set_window_long.call(@window, -16, 0x14CA0000)

    @set_window_pos.call(@window, 0, @x, @y, @width + @width_add, @height + @height_add, 0)

  end

  

  def y=(valor)

    @y = valor

    @set_window_long.call(@window, -16, 0x14CA0000)

    @set_window_pos.call(@window, 0, @x, @y, @width + @width_add, @height + @height_add, 0)

  end

  

  def fullscreen

    return if @state == "full"

    @window_size = self.asize

    @state = "full"

    @set_window_long.call(@window, -16, 0x14000000)

    @set_window_pos.call(@window, -1, -1, -1, @width + 2, @height + 2, 64)

    @set_resolution.call(@width, @height, 4)

  end

  

  def normal

    return if @state == "normal"

    @window_size = self.asize

    @state = "normal"

    @set_resolution.call(@default_size[0], @default_size[1], 4)

    @set_window_long.call(@window, -16, 0x14CA0000)

    @set_window_pos.call(@window, 0, @x, @y, @width + @width_add, @height + @height_add, 0)

  end

  

  def center

    @x = self.size[0] / 2 - (@width / 2)

    @y = self.size[1] / 2 - (@height / 2)

    @set_window_long.call(@window, -16, 0x14CA0000)

    @set_window_pos.call(@window, 0, @x, @y, @width + @width_add, @height + @height_add, 0)

  end

  

  def size

    width = @gsm.call(0)

    height = @gsm.call(1)

    return width, height

  end

  

  def asize

    rect = [0, 0, 0, 0].pack('l4')

    @gcr.call(@window, rect)

    width, height = rect.unpack('l4')[2..3]

    return width, height

  end

  

  def trigger?(key)

    return (@gaks.call(key) & 0x01 == 1)

  end

 

  def pressed?(key)

    return (not @gks.call(key).between?(0, 1))

  end

  

  def update

    @kbe.call(18, 0, 2, 0) 

    if self.trigger?(115) or self.pressed?(115)

      exit

    end

    if self.trigger?(122)

      self.change

      Graphics.update

      sleep(0.1)

      Graphics.update

    end

  end

  

  def change

    if @state == "normal"

      self.fullscreen

    else

      self.normal

    end

  end

 

end

 

if Game_Window::VIEWPORT_FIX

 

  class Viewport

    

    alias resolution_viewport_initialize initialize

    

    def initialize(x, y, w, h, fix=true)

      if fix

        if w == 640

          w = 1280

        end

        if h == 480

          h = 960

        end

      end

      resolution_viewport_initialize(x, y, w, h)

    end

    

  end

  

end

 

module Graphics

  

  class << self

    

    alias game_resolution_graphics_update update

    

    def update

      game_resolution_graphics_update

      $window.update

    end

 

  end

  

end

 

$window = Game_Window.new

 

class Game_Player < Game_Character

  

  CENTER_X = ($window.width / 2 - 16) * 4

  CENTER_Y = ($window.height / 2 - 16) * 4

    

  def center(x, y)

    @@center_x = ($window.width / 2 - 16) * 4

    @@center_y = ($window.height / 2 - 16) * 4

    maxsizex = ($window.width / 32.0) # .ceil

    maxsizey = ($window.height / 32.0) # .ceil

    max_x = (($game_map.width - maxsizex) * 128).to_i

    max_y = (($game_map.height - maxsizey) * 128).to_i

    $game_map.display_x = [0, [x * 128 - @@center_x, max_x].min].max

    $game_map.display_y = [0, [y * 128 - @@center_y, max_y].min].max

  end

  

end

 

class Game_Map

  

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

  # - Scroll para Baixo

  #

  #     distance : distância do scroll

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

  

  def scroll_down(distance)

    @display_y = [@display_y + distance, (self.height * 128) - ($window.height * 4)].min

  end

  

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

  # - Scroll para Direita

  #

  #     distance : distância do scroll

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

  

  def scroll_right(distance)

    @display_x = [@display_x + distance, (self.width * 128) - ($window.width * 4)].min

  end

  

end

 

class Tilemap

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

    attr_accessor :tileset

    attr_accessor :tileset

    attr_accessor :autotiles

    attr_accessor :map_data

    attr_accessor :flash_data

    attr_accessor :priorities

    attr_accessor :visible

    attr_accessor :ox

    attr_accessor :oy

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

  def initialize(viewport)

    @map = []

    width, height = $game_map.width * 32, $game_map.height * 32

    for p in 0...2

      @map[p] = Sprite.new(viewport)

      @map[p].bitmap = Bitmap.new(width, height )

    end

    @map[0].z = 0

    @map[1].z = 3000

    @tileset_tile_width = 32

    @tileset_tile_height = 32

    @tileset = nil

    @autotiles = []

    @autotiles2 = []

    @map_data = nil

    @data = nil

    @flash_data = nil

    @priorities = nil

    @visible = true

    @ox = 0

    @oy = 0

  end

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

  def update

    if @data != @map_data

      refresh

    end

  end

  def ox=(valor)

    return if @ox == valor

    @ox = valor

    for p in 0...2

      @map[p].ox = @ox

    end

  end

  def oy=(valor)

    return if @oy == valor

    @oy = valor

    for p in 0...2

      @map[p].oy = @oy

    end

  end

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

  def refresh

    @data = @map_data

    generate_autotiles2

    for p in 0..5

      for z in 0...@map_data.zsize

        for x in 0...@map_data.xsize

          for y in 0...@map_data.ysize

            id = @map_data[x,y,z]

            next if @priorities[id] != p

            refresh_autotiles(x,y,p,id) if id < 384

            refresh_tileset(x,y,p,id) if id >= 384

          end

        end

      end

    end

  end

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

  def refresh_autotiles(x,y,p,id)

    p = [p, 1].min

    if id >= 48 and id <= 95

      sy = id - 48

      sy /= 8

      sx = id - 48

      sx = sx - (8 * sy)

      src_rect = Rect.new(sx*32, sy*32, 32, 32)

      @map[p].bitmap.blt(x*32, y*32, @autotiles2[0], src_rect)

    end

  end

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

  def refresh_tileset(x,y,p,id)

    p = [p, 1].min

    sy = id - 384

    sy /= 8

    sx = id - 384

    sx = sx - (8 * sy)

    src_rect = Rect.new(sx*32, sy*32, 32, 32)

    @map[p].bitmap.blt(x*32, y*32, @tileset, src_rect)

  end

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

  def dispose

    for p in 0...2

      @map[p].bitmap.dispose

    end

  end

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

  #   ■ Generates Autotiles

  #   By: Fuso

  #   Generates the tiles used by the game (can be seen in the editor by

  #   doubleclicking an autotile field), from the images given as

  #   resources.

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

  def generate_autotiles2(ats = @autotiles, frame_id = 0)

    h = 32

    w = 32

    for at in 0..6

      @autotiles2[at] = Bitmap.new(@tileset_tile_width * 8, @tileset_tile_height * 6) if @autotiles2[at].nil?

      break if at >= @autotiles.size

      # Generate the 16 tiles containing water and a number of corners.

      # Each bit in i will represent whether or not a certain corner will be filled in.

      for i in 0...16

        @autotiles2[at].blt(i % 8 * w,             i / 8 * h,            ats[at], Rect.new(frame_id * 3 * w + w,           2 * h, w,      h)) if i < 15

        @autotiles2[at].blt(i % 8 * w,             i / 8 * h,            ats[at], Rect.new(frame_id * 3 * w + 2 * w,      0,      w / 2, h / 2)) if i & 0x1 == 0x1

        @autotiles2[at].blt(i % 8 * w + w / 2, i / 8 * h,            ats[at], Rect.new(frame_id * 3 * w + 5 * w / 2, 0,      w / 2, h / 2)) if i & 0x2 == 0x2

        @autotiles2[at].blt(i % 8 * w + w / 2, i / 8 * h + h / 2, ats[at], Rect.new(frame_id * 3 * w + 5 * w / 2, h / 2, w / 2, h / 2)) if i & 0x4 == 0x4

        @autotiles2[at].blt(i % 8 * w,             i / 8 * h + h / 2, ats[at], Rect.new(frame_id * 3 * w + 2 * w,      h / 2, w / 2, h / 2)) if i & 0x8 == 0x8

      end

      # Generate the 16 tiles containing a certain whole strip + up to 2 corners.

      # The two most signifant bits will hold the direction of the strip and the other

      # two bits whether or not the remaining 2 corners will be filled in.

      for i in 0...16

        d = i / 4

        # The strip.

        #@autotiles2[at].blt(i % 8 * w + (d==3 ? w / 2 : 0), 2 * h + i / 8 * h + (d==4 ? h / 2 : 0), ats[at],

        #  Rect.new(d == 0 ? 0 : d == 2 ? 5 * d / 4 : d, d == 1 ? h : d == 3 ? 7 * h / 4 : 2 * h,

        #               (d&3 + 1) * w / 2, (4 - d&3) * h / 2))

        @autotiles2[at].blt(i % 8 * w, (2 + i / 8) * h, ats[at], Rect.new(frame_id * 3 * w + d == 0 ? 0 : d == 2 ? 2 * w : w, d == 1 ? h : d == 3 ? 3 * h : 2 * h, w, h))

        l1 = (d + 1)%4

        l2 = (d + 2)%4

        x1 = (l1 == 1 or l1 == 2) ? w / 2 : 0

        x2 = (l2 == 1 or l2 == 2) ? w / 2 : 0

        y1 = l1/2 * h / 2

        y2 = l2/2 * h / 2

        @autotiles2[at].blt(i % 8 * w + x1, (2 + i / 8) * h + y1, ats[at], Rect.new(frame_id * 3 * w + 2 * w + x1, y1, w / 2,  h / 2)) if i & 0x1 == 0x1

        @autotiles2[at].blt(i % 8 * w + x2, (2 + i / 8) * h + y2, ats[at], Rect.new(frame_id * 3 * w + 2 * w + x2, y2, w / 2,  h / 2)) if i & 0x2 == 0x2

      end

      # The "double-strip" tiles.

      @autotiles2[at].blt(0,       4 * h,           ats[at], Rect.new(frame_id * 3 * w + 0,            2 * h,             w,      h))

      @autotiles2[at].blt(w / 2, 4 * h,           ats[at], Rect.new(frame_id * 3 * w + 5 * w / 2, 2 * h,             w / 2, h))

      @autotiles2[at].blt(w,      4 * h,           ats[at], Rect.new(frame_id * 3 * w + w,            h,                  w,      h))

      @autotiles2[at].blt(w,      4 * h + h /2, ats[at], Rect.new(frame_id * 3 * w + w,            3 * h + h / 2, w, h / 2))

      for i in 0...4

        @autotiles2[at].blt((2 + 2 * i)%8 * w, (4 + i/3) * h, ats[at], Rect.new(frame_id * 3 * w + ((i == 1 or i == 2) ? 2 * w : 0), ((i&2) + 1) * h, w, h))

        @autotiles2[at].blt((3 + 2 * i)%8 * w, (4 + i/3) * h, ats[at], Rect.new(frame_id * 3 * w + ((i == 1 or i == 2) ? 2 * w : 0), ((i&2) + 1) * h, w, h))

        l = (i + 2)%4

        x = (l == 1 or l == 2) ? w / 2 : 0

        y = l/2 * h / 2

        @autotiles2[at].blt((3 + 2 * i)%8 * w + x, (4 + i/3) * h + y, ats[at], Rect.new(frame_id * 3 * w + 2 * w + x, y, w / 2,  h / 2))

      end

      for i in 0...4

        @autotiles2[at].blt((i + 2) * w, 5 * h, ats[at], Rect.new(frame_id * 3 * w + i/2 * 2 * w, (i == 1 or i == 2) ? 3 * h : h, w, h))

        l = (i + 3) % 4

        dx = (l == 3 ? w / 2 : 0)

        dy = (l == 2 ? h / 2 : 0)

        tx = (l < 2 ? 0 : 2 * w)

        ty = (l == 0 ? 0 : l == 3 ? 0 : 2 * h)

        @autotiles2[at].blt((i + 2) * w + dx, 5 * h + dy, ats[at], Rect.new(frame_id * 3 * w + tx + dx, h + ty + dy, w - l%2 * w / 2, h / 2 + l%2 * h / 2))

      end

      # The final two squares which is simply the upper left one and possiby a merge of the

      # inner corners, we'll make them both the first tile for now.

      @autotiles2[at].blt(6 * w, 5 * h, ats[at], Rect.new(0, 0, w, h))

      @autotiles2[at].blt(7 * w, 5 * h, ats[at], Rect.new(0, 0, w, h))

    end

  end

end

 

class Spriteset_Map

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

  def initialize

    width, height  = $window.size

    @viewport1 = Viewport.new(0, 0, width, height)

    @viewport_panormas = []

    for i in 1..4

      x = ((i - 1) % 2) * 640

      y = ((i - 1) / 2) * 480

      v = Viewport.new(x, y, 640, 480)

      v.z = @viewport1.z - 1

      @viewport_panormas.push(v)

    end

    @viewport_fogs = []

    for i in 1..4

      x = ((i - 1) % 2) * 640

      y = ((i - 1) / 2) * 480

      v = Viewport.new(x, y, 640, 480)

      v.z = @viewport1.z + 1

      @viewport_fogs.push(v)

    end

    @viewport2 = Viewport.new(0, 0, width, height)

    @viewport3 = Viewport.new(0, 0, width, height)

    @viewport2.z = 200

    @viewport3.z = 5000

    @tilemap = Tilemap.new(@viewport1)

    @tilemap.tileset = RPG::Cache.tileset($game_map.tileset_name)

    for i in 0..6

      autotile_name = $game_map.autotile_names[i]

      @tilemap.autotiles[i] = RPG::Cache.autotile(autotile_name)

    end

    @tilemap.map_data = $game_map.data

    @tilemap.priorities = $game_map.priorities

    @panoramas = []

    panorama = Plane.new(@viewport_panormas[0])

    panorama.z = -1000

    @panoramas.push(panorama)

    panorama = Plane.new(@viewport_panormas[1])

    panorama.z = -1000

    @panoramas.push(panorama)

    panorama = Plane.new(@viewport_panormas[2])

    panorama.z = -1000

    @panoramas.push(panorama)

    panorama = Plane.new(@viewport_panormas[3])

    panorama.z = -1000

    @panoramas.push(panorama)

    @fogs = []

    fog = Plane.new(@viewport_fogs[0])

    fog.z = 3000

    @fogs.push(fog)

    fog = Plane.new(@viewport_fogs[1])

    fog.z = 3000

    @fogs.push(fog)

    fog = Plane.new(@viewport_fogs[2])

    fog.z = 3000

    @fogs.push(fog)

    fog = Plane.new(@viewport_fogs[3])

    fog.z = 3000

    @fogs.push(fog)

    @character_sprites = []

    for i in $game_map.events.keys.sort

      sprite = Sprite_Character.new(@viewport1, $game_map.events[i])

      @character_sprites.push(sprite)

    end

    @character_sprites.push(Sprite_Character.new(@viewport1, $game_player))

    @weather = RPG::Weather.new(@viewport1)

    @picture_sprites = []

    for i in 1..50

      @picture_sprites.push(Sprite_Picture.new(@viewport2,

        $game_screen.pictures[i]))

    end

    @timer_sprite = Sprite_Timer.new

    update

  end

  

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

  # - Display

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

  

  def dispose

    

    @tilemap.tileset.dispose

    for i in 0..6

      @tilemap.autotiles[i].dispose

    end

    @tilemap.dispose

    

    for panorama in @panoramas

      panorama.dispose

    end

    

    for fog in @fogs

      fog.dispose

    end

    

    for sprite in @character_sprites

      sprite.dispose

    end

    

    @weather.dispose

    

    for sprite in @picture_sprites

      sprite.dispose

    end

    

    @timer_sprite.dispose

    

    @viewport1.dispose

    for v in @viewport_panormas + @viewport_fogs

      v.dispose

    end

    @viewport2.dispose

    @viewport3.dispose

  end

  

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

  # - Frame Update

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

  

  def update

    

    if @panorama_name != $game_map.panorama_name or

      @panorama_hue != $game_map.panorama_hue

      @panorama_name = $game_map.panorama_name

      @panorama_hue = $game_map.panorama_hue

      if @panorama_bitmap != nil

        @panorama_bitmap.dispose

        @panorama_bitmap = nil

      end

      if @panorama_name != ""

        @panorama_bitmap = RPG::Cache.panorama(@panorama_name, @panorama_hue)

        for p in @panoramas

          p.bitmap = @panorama_bitmap

        end

      end

      Graphics.frame_reset

    end

    #

    if @fog_name != $game_map.fog_name or @fog_hue != $game_map.fog_hue

      @fog_name = $game_map.fog_name

      @fog_hue = $game_map.fog_hue

      if @fog_bitmap != nil

        @fog_bitmap.dispose

        @fog_bitmap = nil

      end

      if @fog_name != ""

        @fog_bitmap = RPG::Cache.fog(@fog_name, @fog_hue)

        for p in @fogs

          p.bitmap = @fog_bitmap

        end

      end

      Graphics.frame_reset

    end

    

    @tilemap.ox = $game_map.display_x / 4

    @tilemap.oy = $game_map.display_y / 4

    @tilemap.update

    

    for i in [email=0...@panoramas.size]0...@panoramas.size[/email]

      panorama = @panoramas[i]

      rwadd = (i % 2) * (@panorama_bitmap.nil? ? 0 : 640 - @panorama_bitmap.width)

      rhadd = (i / 2) * (@panorama_bitmap.nil? ? 0 : 480 - @panorama_bitmap.height)

      panorama.ox = $game_map.display_x / 8 + rwadd

      panorama.oy = $game_map.display_y / 8 + rhadd

    end

    for i in [email=0...@fogs.size]0...@fogs.size[/email]

      fog = @fogs[i]

      

      fog.zoom_x = $game_map.fog_zoom / 100.0

      fog.zoom_y = $game_map.fog_zoom / 100.0

      fog.opacity = $game_map.fog_opacity

      fog.blend_type = $game_map.fog_blend_type

      rwadd = (i % 2) * (@fog_bitmap.nil? ? 0 : (@fog_bitmap.width) / 2)

      rhadd = (i / 2) * 480

      fog.ox = $game_map.display_x / 4 + $game_map.fog_ox + rwadd

      fog.oy = $game_map.display_y / 4 + $game_map.fog_oy + rhadd

      fog.tone = $game_map.fog_tone

    end

    

    for sprite in @character_sprites

      sprite.update

    end

    

    @weather.type = $game_screen.weather_type

    @weather.max = $game_screen.weather_max

    @weather.ox = $game_map.display_x / 4

    @weather.oy = $game_map.display_y / 4

    @weather.update

    

    for sprite in @picture_sprites

      sprite.update

    end

    

    @timer_sprite.update

    

    @viewport1.tone = $game_screen.tone

    @viewport1.ox = $game_screen.shake

    for v in @viewport_panormas + @viewport_fogs

      v.tone = $game_screen.tone

      v.ox = $game_screen.shake

    end

    

    @viewport3.color = $game_screen.flash_color

    

    @viewport1.update

    @viewport3.update

  end

end

 

and this is MOG's Animated panorama script:
Code:
 

#_________________________________________________

# MOG_Animated Panorama V1.3            

#_________________________________________________

# By Moghunter     

# [url=http://www.atelier-rgss.com]http://www.atelier-rgss.com[/url]

#_________________________________________________

# Deixa o panorama animado, animando-o por frames.

# É necessário ter as imagens extras dos frames para que a 

#animação ocorra.

#EXP de nomeação

#

#Nuvem.png        (Frame 1)(Essa é a imagem do Database)     

#Nuvem0.png       (Frame 2) 

#Nuvem1.png       (Frame 3)

#Nuvem2.png       (Frame 4)

#Etc...

#_________________________________________________

module MOG

#Velocidade da animação  

PANOREFRESH = 5 

end

$mogscript = {} if $mogscript == nil

$mogscript["anime_panorama"] = true

class Spriteset_Map

alias mog14_initialize initialize

def initialize

@panospeed = 0 

@panoframes = 0

mog14_initialize

end 

alias mog14_update update 

def update

mog14_update

@panospeed += 1

if @panospeed > MOG::PANOREFRESH   

@panospeed = 0

@panoframes += 1

end

if @panorama.bitmap != nil

@panorama.bitmap = RPG::Cache.panorama(@panorama_name + @panoframes.to_s, @panorama_hue) rescue nil

end   

if @panorama.bitmap == nil

@panoframes = 0

@panorama.bitmap = RPG::Cache.panorama(@panorama_name + @panoframes.to_s, @panorama_hue) rescue nada

end

end 

def nada

@panorama.bitmap = RPG::Cache.panorama(@panorama_name, @panorama_hue)

end

end

 

I also tried to change the panorama by event based script call $game_map.panorama_name = 'filename'. Though it works it lags too much and therefore isn't fast enough.

For anyone who is interested to help I uploaded a little demo to show you what I mean:

http://www.2shared.com/file/5012153/b05 ... 0x960.html

Please check out the savegame!

Thank's a lot to everyone who is trying to help or at least takes a look at it - it would be an enormous step forward for me and my project. I'd also be very thankful for any ideas to find another way to change the panorama graphic several times a second!

Thank's a lot!
 
ok i am ready

Code:
 

 

module XAS_RESPAWN

#

#A=>B

#A = ENEMY ID

#B = RESPAWN DELAY

#Enemy will only respawn if you give them a delay time (it can be 0)

#

TIME = {

2 => 1

}

 

 

# The enemy will spawn at any passable point (normaly they spawn at the start point)

 

RANDOM_SPAWN = [

 

2

 

]

 

# The enemy will spawn at the dying point (normaly they spawn at the start point)

DYING_SPAWN = [

 

3

 

]

 

end

 

 

class Game_Event < Game_Character

  include XRXS_BattlerAttachment

  alias xrxs64c_update2 update

  def update

    if @collapse_wait_count.to_i > 0

      @collapse_wait_count -= 1

      if @collapse_wait_count == 0

        @collapse_wait_count = nil

        if @waittime == nil

        @waittime =  XAS_RESPAWN::TIME[self.battler.id]

        if @waittime == nil

          $game_map.remove_token(self) 

        end

          else

        @waittime -= 1

        if @waittime == 0

          if XAS_RESPAWN::RANDOM_SPAWN.include?(self.battler.id)

 

          until  @pass == true

          x = rand($game_map.width)

            y = rand($game_map.width)

            if passable?(x, y, 0)

              @pass = true

            end

          end

          moveto(x,y)

          @pass = false

        else

          unless XAS_RESPAWN::DYING_SPAWN.include?(self.battler.id)

        moveto(@event.x, @event.y)

      end

      end

        self.battler.recover_all

       self.collapse_done = false

       $scene.spriteset.refresh

       @waittime = nil

     end

     end

      end

      return

    end

    update_sensor

    xrxs64c_update2

    if self.battler != nil

      self.battler.remove_states_auto

    end

    if self.collapse_duration.to_i > 0

      @through = true

    end

    if self.collapse_done

      @opacity = 0

      @collapse_wait_count = 32

      return

    end

  end  

end

class Spriteset_Map

  def refresh

    $game_map.need_refresh = true

    unless @character_sprites == nil 

      for sprite in @character_sprites 

        sprite.dispose 

      end 

    end

    @character_sprites = [] 

    for i in $game_map.events.keys.sort 

      sprite = Sprite_Character.new(@viewport1, $game_map.events[i]) 

      @character_sprites.push(sprite) 

    end 

    @character_sprites.push(Sprite_Character.new(@viewport1, $game_player))

  end

end

class Scene_Map 

  attr_accessor :spriteset 

end

paste it under XAS_SYSTEM

you have to add the delay time in TIME
Enemy will only respawn if you give them a delay time (it can be 0)

A=>B
A = ENEMY ID
B = RESPAWN DELAY

z.B
TIME = {
2 => 5
}

if you add the enemy id in RANDOM_SPAWN
The enemy will spawn at any passable point (normaly they spawn at the start point)


if you add the enemy id in DYING_SPAWN
The enemy will spawn at the dying point (normaly they spawn at the start point)
 
Cool, nice work Hackel. Can I ask you a question, are you German?

Rainbird, I think you can try it better in RGSS Support, as we are here discussing the XAS system and not any other of Moghunters scripts.
 
@Hackel - very cool script, awesome work!!!
@Mr_Smith - in honesty I was hoping someone like Hackel might have a look at it when I post it here... :)
 

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