LOGIN
SEARCH
PROFILE
keys: ↑ ↓
LOGOUT
INDEX
MEMBERS
keys: ↑ ↓
HOME
PORTAL
PLAY ALONG
PLAY with WORDS
PLAY with GRAPHICS
PLAY with SOUNDS
PLAY with CODES
PLAY with PROJECTS
keys: ← →
Guest Access
Register:
Members:



View previous topic View next topic Go down Message [Page 1 of 1]

ACTIVATED
ACTIVATED
#1 [solved]XAS and push events (NPC)??? Empty [solved]XAS and push events (NPC)???
Loading

DontSay

DontSay
ACTIVATED
ACTIVATED
ACTIVATED
profile
Hi there....
So that here are so many guys scripting for XAS, I've got a request:
A few years ago I found a script, to push events like you can do in Secret of Mana. When there's an NPC you can run into it and it will be pushed away, so it can't block you. But the Problem is, when you insert the script in a game with XAS in it, the XAS game won't attack other events. So my question is, is there any way you can change the script to remember the events you can:
1. Attack AND push
2. Only being attacked and
3. only being pushed

It would be very nice, if someone can do this, because I do hate it, when an NPC is in my way and I have to wait until it's gone.

Here is the script I mean: Aleworks Push Event

Greetings,
DontSay
ACTIVATED
Show Signature
ACTIVATED
http://www.lorae.de.vu
Administrator
Administrator
#2 [solved]XAS and push events (NPC)??? Empty Re: [solved]XAS and push events (NPC)???
Loading

G@MeF@Ce

G@MeF@Ce
Administrator
Administrator
Administrator
profile
ooh that would be nice ~ ^,^

*moving this to Requests
Administrator
Show Signature
Administrator
https://www.dropbox.com/sh/i47rig99qhrvn8s/4m5HvsM2fD http://g4m3f4c3.deviantart.com https://www.facebook.com//pages/Gameface101/332331300127008 https://twitter.com//mr_gameface101 https://soundcloud.com/schurr https://www.youtube.com/user/MrGameface101?feature=watch
ACTIVATED
ACTIVATED
#3 [solved]XAS and push events (NPC)??? Empty Re: [solved]XAS and push events (NPC)???
Loading

Hackel

avatar
ACTIVATED
ACTIVATED
ACTIVATED
profile
Code:
=begin =======================================================================
 ▓ Aleworks Push Events (APE)
==============================================================================
 Created by Aleworks
 Version: 1.00
 Last Update: 10/02/2007 (dd/mm/yyyy)
==============================================================================
                            *** Instructions ***
 For setup an event for being pushable, you need to add a comment with one or
 more of the commands in the comment commands list. The PUSH SPEED #,
 PUSH DISTANCE #, PUSH SOUND # and PUSH TRIGGER commands, need that the
 PUSHABLE command be added.
==============================================================================
                        *** Comment Commands List ***
 PUSHABLE
  If the player move in the direction of the event, it will move in the same
  direction the player moves, if the event can't move in that direction, it
  will try to move in other directions.
 PUSHABLE IN DIRECTION
  If the player move in the direction of the event, it will move in the same
  direction the player moves.
 PUSHABLE #
 PUSHABLE IN DIRECTION #
  Change the # with the posible directions that the event can be pushed.
 PUSH SPEED #
  Change the # with the speed that the event will move when pushed.
 PUSH DISTANCE #
  Change the # with the tiles that the event will be pushed.
 PUSH SOUND #
  Change the # with the file name of the sound effect that will be played when
  the event is pushed.
 PUSH TRIGGER
  The event will be pushed, only if the button C is pressed.
 TRASPASABLE
  Make that the player can pass through the event.
==============================================================================
                      *** APE RGSS Classes edits ***
 *** Game_Character ***
alias: update; alias name: aleworks_pushevents_gamecharacter_update
replace: passable?(x, y, d)
replace: screen_z
 *** Game_Event ***
alias: refresh; alias name: aleworks_pushevents_gameevent_refresh
 *** Game_Player ***
replace: update
==============================================================================
=end

#=============================================================================
# ▒ Game_Character
#=============================================================================
class Game_Character
  attr_accessor :move_speed
  alias aleworks_pushevents_gamecharacter_update update
  #===========================================================================
  # ░ update
  #===========================================================================
  def update
    if moving? == false and self.is_a?(Game_Event)
      if @left_push == 0
        @pushing = false
        @pushing_direction = 0
      else
        case @pushing_direction
        when 2
          move_down
          Audio.se_play("Audio/SE/" + @push_sound) if @push_sound != nil
        when 4
          move_left
          Audio.se_play("Audio/SE/" + @push_sound) if @push_sound != nil
        when 6
          move_right
          Audio.se_play("Audio/SE/" + @push_sound) if @push_sound != nil
        when 8
          move_up
          Audio.se_play("Audio/SE/" + @push_sound) if @push_sound != nil
        end
        @left_push -= 1
      end
    end
    if @old_speed != nil and @pushing == false
      @move_speed = @old_speed if @move_speed == @push_speed
      @old_speed = nil
    end
    aleworks_pushevents_gamecharacter_update
  end
  #===========================================================================
  # ░ passable?
  #===========================================================================
  def passable?(x, y, d)
    new_x = x + (d == 6 ? 1 : d == 4 ? -1 : 0)
    new_y = y + (d == 2 ? 1 : d == 8 ? -1 : 0)
    return false unless $game_map.valid?(new_x, new_y)
    return true if @through
    return false unless $game_map.passable?(x, y, d, self)
    return false unless $game_map.passable?(new_x, new_y, 10 - d)
    for event in $game_map.events.values
      if event.x == new_x and event.y == new_y
        next if self == $game_player and event.traspasable
        unless event.through
          return false if event.character_name != ""
        end
      end
    end
    if $game_player.x == new_x and $game_player.y == new_y
      unless $game_player.through
        return false if @character_name != ""
      end
    end
    return true
  end
  #===========================================================================
  # ░ screen_z
  #===========================================================================
  def screen_z(height = 0)
    return 999 if @always_on_top
    z = (@real_y - $game_map.display_y + 3) / 4 + 32
    if @tile_id > 0
      return z + $game_map.priorities[@tile_id] * 32
    else
      if self.is_a?(Game_Event)
        if @traspasable == true
          return z + ((height > 32) ? 31 : 0) + 16
        else
          return z + ((height > 32) ? 31 : 0)
        end
      else
        return z + ((height > 32) ? 31 : 0)
      end
    end
  end
end

#=============================================================================
# ▒ Game_Event
#=============================================================================
class Game_Event
  attr_reader :pushable
  attr_reader :push_speed
  attr_reader :push_distance
  attr_reader :traspasable
  attr_reader :push_in_diretion
  attr_reader :push_direction
  attr_reader :push_sound
  attr_reader :push_trigger
  attr_accessor :pushing
  attr_accessor :old_speed
  attr_accessor :left_push
  attr_accessor :pushing_direction
  alias aleworks_pushevents_gameevent_refresh refresh
  #===========================================================================
  # ░ refresh
  #===========================================================================
  def refresh
    @pushable = false
    @push_speed = nil
    @push_distance = 1
    @pushing = false
    @old_speed = nil
    @left_push = 0
    @push_direction = []
    @pushing_direction = 0
    @traspasable = false
    @push_in_diretion = false
    @push_sound = nil
    @push_trigger = false
    aleworks_pushevents_gameevent_refresh
    unless @page == nil
    for i in @page.list
      if i.code == 108 or i.code == 408
        if i.parameters[0].upcase[/PUSHABLE/] != nil
          @pushable = true
          @push_in_diretion = true if i.parameters[0].upcase[/IN DIRECTION/] != nil
          @push_direction.push(2) if i.parameters[0][/2/] != nil
          @push_direction.push(4) if i.parameters[0][/4/] != nil
          @push_direction.push(6) if i.parameters[0][/6/] != nil
          @push_direction.push(8) if i.parameters[0][/8/] != nil
        end
        if i.parameters[0].upcase[/PUSH SPEED/] != nil
          @push_speed = i.parameters[0].split[2].to_i
        end
        if i.parameters[0].upcase[/PUSH DISTANCE/] != nil
          @push_distance = i.parameters[0].split[2].to_i
        end
        if i.parameters[0].upcase[/PUSH SOUND/] != nil
          @push_sound = i.parameters[0].split[2]
        end
        if i.parameters[0].upcase[/PUSH TRIGGER/] != nil
          @push_trigger = true
        end
        if i.parameters[0].upcase[/TRASPASABLE/] != nil
          @traspasable = true
        end
      end
    end
  end
end
end
#=============================================================================
# ▒ Game_Player
#=============================================================================
class Game_Player
  #===========================================================================
  # ░ update
  #===========================================================================
  alias push_update update
  def update
    push_update

  #####################################
    last_moving = moving?
    unless moving? or $game_system.map_interpreter.running? or
          @move_route_forcing or $game_temp.message_window_showing
      case Input.dir4
      when 2
        dir = 2
        alt_dir = [4,6,8]
        push_x = 0
        push_y = 1
      when 4
        dir = 4
        alt_dir = [2,6,8]
        push_x = -1
        push_y = 0
      when 6
        dir = 6
        alt_dir = [2,4,8]
        push_x = 1
        push_y = 0
      when 8
        dir = 8
        alt_dir = [2,4,6]
        push_x = 0
        push_y = -1
      else
        dir = 0
        push_x = 0
        push_y = 0
      end
      if passable?(@x, @y, dir) and dir != 0
        case dir
        when 2
        # move_down
        when 4
        #  move_left
        when 6
        #  move_right
        when 8
      #    move_up
        end
      elsif dir != 0
        case dir
        when 2
          turn_down
        when 4
          turn_left
        when 6
          turn_right
        when 8
          turn_up
        end
        if $game_map.passable?(@x, @y, dir)
          for event in $game_map.events.values
            if event.x == @x + push_x and event.y == @y + push_y
              next if event.through == true
              next if event.pushable == false
              next if event.moving? == true
              next if event.push_trigger == true
              next if event.push_direction.size >= 1 and
                      !event.push_direction.include?(dir)
              if event.passable?(event.x, event.y, dir)
                event.pushing = true
              else
                if !event.push_in_diretion
                  if event.passable?(event.x, event.y, alt_dir[0])
                    dir = alt_dir[0]
                    event.pushing = true
                  elsif event.passable?(event.x, event.y, alt_dir[1])
                    dir = alt_dir[1]
                    event.pushing = true
                  elsif event.passable?(event.x, event.y, alt_dir[2])
                    dir = alt_dir[2]
                    event.pushing = true
                  end
                end
              end
              if event.pushing == true
                case dir
                when 2
                  event.move_down
                when 4
                  event.move_left
                when 6
                  event.move_right
                when 8
                  event.move_up
                end
                if event.push_speed != nil
                  event.old_speed = event.move_speed
                  event.move_speed = event.push_speed
                end
                if event.push_distance > 1
                  event.left_push = event.push_distance
                  event.pushing_direction = dir
                end
                if event.push_sound != nil
                  Audio.se_play("Audio/SE/" + event.push_sound)
                end
              end
            end
          end
        end
      end
    end

      if Input.trigger?(Input::C)
        check_event_trigger_here([0])
        check_event_trigger_there([0,1,2])
        case @direction
        when 2
          dir = 2
          alt_dir = [4,6,8]
          push_x = 0
          push_y = 1
        when 4
          dir = 4
          alt_dir = [2,6,8]
          push_x = -1
          push_y = 0
        when 6
          dir = 6
          alt_dir = [2,4,8]
          push_x = 1
          push_y = 0
        when 8
          dir = 8
          alt_dir = [2,4,6]
          push_x = 0
          push_y = -1
        else
          dir = 0
          push_x = 0
          push_y = 0
        end
        for event in $game_map.events.values
          if event.x == @x + push_x and event.y == @y + push_y
            next if event.through == true
            next if event.pushable == false
            next if event.push_trigger == false
            next if event.moving? == true
            next if event.push_direction.size >= 1 and
                    !event.push_direction.include?(dir)
            if event.passable?(event.x, event.y, dir)
              event.pushing = true
            else
              if !event.push_in_diretion
                if event.passable?(event.x, event.y, alt_dir[0])
                  dir = alt_dir[0]
                  event.pushing = true
                elsif event.passable?(event.x, event.y, alt_dir[1])
                  dir = alt_dir[1]
                  event.pushing = true
                elsif event.passable?(event.x, event.y, alt_dir[2])
                  dir = alt_dir[2]
                  event.pushing = true
                end
              end
            end
            if event.pushing == true
              case dir
              when 2
                event.move_down
              when 4
                event.move_left
              when 6
                event.move_right
              when 8
                event.move_up
              end
              if event.push_speed != nil
                event.old_speed = event.move_speed
                event.move_speed = event.push_speed
              end
              if event.push_distance > 1
                event.left_push = event.push_distance
                event.pushing_direction = dir
              end
              if event.push_sound != nil
                Audio.se_play("Audio/SE/" + event.push_sound)
              end
            end
          end
        end
      end
    end
  end


German:





Ich weis nicht ob es 100%tig funktioniert, da ich ein


Bisschen was im Script geändert hab. Aber als ich es


getestet hab hat es funktioniert. Melde dich wenn


du eine Fehlermeldung bekommst.










Please test the script I am not sure if it works 100%
ACTIVATED
Show Signature
ACTIVATED
ACTIVATED
ACTIVATED
#4 [solved]XAS and push events (NPC)??? Empty Re: [solved]XAS and push events (NPC)???
Loading

DontSay

DontSay
ACTIVATED
ACTIVATED
ACTIVATED
profile
Wow.... also bisher klappt es in meinem Projekt ohne Probleme... werde bei Zeiten die ganze Demo nochmal durchspielen... Super, danke ^^

Wow... it works in my project without any problems... I will play through my game later to see if it works all the time.... good work, thanks ^^
ACTIVATED
Show Signature
ACTIVATED
http://www.lorae.de.vu
Administrator
Administrator
#5 [solved]XAS and push events (NPC)??? Empty Re: [solved]XAS and push events (NPC)???
Loading

G@MeF@Ce

G@MeF@Ce
Administrator
Administrator
Administrator
profile
^,^ - ehrfürchtig! Dank wieder Hackel!
I've been using it...so far no bugs.

[solved]XAS and push events (NPC)??? Insect-exterminator_~TOCL0181

Spoiler:
Administrator
Show Signature
Administrator
https://www.dropbox.com/sh/i47rig99qhrvn8s/4m5HvsM2fD http://g4m3f4c3.deviantart.com https://www.facebook.com//pages/Gameface101/332331300127008 https://twitter.com//mr_gameface101 https://soundcloud.com/schurr https://www.youtube.com/user/MrGameface101?feature=watch
EVENTALIST
EVENTALIST
#6 [solved]XAS and push events (NPC)??? Empty Re: [solved]XAS and push events (NPC)???
Loading

mr_wiggles

mr_wiggles
EVENTALIST
 EVENTALIST
EVENTALIST
profile
yay google translator, this is a really cool script ill have to test it out sometime.
EVENTALIST
Show Signature
EVENTALIST

Sponsored content

profile

View previous topic View next topic Back to top Message [Page 1 of 1]

 

Chatbox system disabled
Personal messaging disabled