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]

EVENTALIST
EVENTALIST
#1 default XAS - Manual hit_check
Loading

mr_wiggles

mr_wiggles
EVENTALIST
 EVENTALIST
EVENTALIST
profile
I'm lazy at rewriting the description again so here is the script header.

#===============================================================================
# XAS - Manual hit_check
#===============================================================================
# Created by Mr Wiggles - Version 1.0
#-------------------------------------------------------------------------------
# Based off of and contains small parts Hackel's bullet terrian tags script,
# so be sure to credit him as well. Also the two scripts this one and his ARE
# NOT compatiable together.
#-------------------------------------------------------------------------------
# Manual Hit Checker Description:
#
# Ever notice how when you set the tool up to be an explosion, and it would
# hit its target from far away, the distance of the explosion size? Well
# Adding a new Constant to the DatabaseBullet module and a new def to the
# XAS_ACTION module, you can now turn off auto hit detection and manually
# Check if your tool has hit any events
#-------------------------------------------------------------------------------
# Instructions:
#
# Usage is simple, go into the the tool module of your choice, add,
# USE_HIT_CHECK[action_id] = Either true or false. Def is false so
# even if you don't add this your tools will function like they did before.
# after you did that, now just go in to the tool event and when ever you want
# to check use "hit_check" like you would use any other XAS command in the
# character movement.
#
# Example:
#
# You have a grenade, and you want to check for hits after it blows up, call
# hit_check after you display your animation for the explosion.
#
#===============================================================================

script:
Spoiler:

Code:

#===============================================================================
#                    XAS - Manual hit_check
#===============================================================================
# Created by Mr Wiggles    - Version 1.0
#-------------------------------------------------------------------------------
# Based off of and contains small parts Hackel's bullet terrian tags script,
# so be sure to credit him as well. Also the two scripts this one and his ARE
# NOT compatiable together.
#-------------------------------------------------------------------------------
# Manual Hit Checker Description:
#
#  Ever notice how when you set the tool up to be an explosion, and it would
#  hit its target from far away, the distance of the explosion size?  Well
#  Adding a new Constant to the DatabaseBullet module and a new def to the
#  XAS_ACTION module, you can now turn off auto hit detection and manually
#  Check if your tool has hit any events
#-------------------------------------------------------------------------------
# Instructions:
#
# Usage is simple, go into the the tool module of your choice, add,
# USE_HIT_CHECK[action_id] = <VALUE> Either true or false. Def is false so
# even if you don't add this your tools will function like they did before.
# after you did that, now just go in to the tool event and when ever you want
# to check use "hit_check" like you would use any other XAS command in the
# character movement.
#
# Example:

# You have a grenade, and you want to check for hits after it blows up, call
# hit_check after you display your animation for the explosion.
#
#===============================================================================
# Uses Tool ID's  * Some of Hackel's script *
#
#  EXCLUDE_TOOL  = [A,A,A,A]  # This allows tools to turn 
#  TERRAIN_TAG  = 1          # Terrian tag number (0-7)
#  SELF_SWITCH  = "B"        # Self switch to activate (A, B, C, D)
#  STOP          = [A,A,A,A]  # Stops Tool Dead
#  TURN180      = [A,A,A,A]  # Bounce back in oposite direction.
#
#                  A = Tool ID
#
# Note: Set event to through, on page that is not self switched.
#
#===============================================================================
module XAS_ACTION
#-------------------------------------------------------------------------------
  EXCLUDE_TOOL  = [9,13,14,15,16,17,18,19] 
  TERRAIN_TAG  = 1
  SELF_SWITCH  = "B"
  STOP          = []
  TURN180      = []
#===============================================================================
#                        * END EDIT *
#===============================================================================
def check_event_trigger_attack()
  # If no skill or weapon equiped
  return if @action.nil? or @action.attack_id == 0
  if @ox == nil
    @ox = self.x
    @oy = self.y
  end
  # if a Tool's id is in the EXCLUDE_TOOL list skip this part
  unless EXCLUDE_TOOL.include?(@action.attack_id) 
    @d = @direction if @d == nil
    @direction = @d
  end
  # If event is moveing update new x and y
  unless @ox == self.x and @oy == self.y
    @ox = self.x
    @oy = self.y
#-------------------------------------------------------------------------------   
# TERRAIN_TAG
#-------------------------------------------------------------------------------
    # if Tool touches terrain tag
    if $game_map.terrain_tag(@ox, @oy) == TERRAIN_TAG
      @d = @direction if @d == nil
      unless SELF_SWITCH == 0
        key = [$game_map.map_id, self.id, SELF_SWITCH]
        $game_self_switches[key] = true
        $game_map.need_refresh = true if $game_map.need_refresh == false
      end
    #-----------------------------
    # if STOP constant conatins Tool's ID
      if STOP.include?(@action.attack_id)
        @move_type = 0
      end
    #-----------------------------
    # if TURN180 constant conatins Tool's ID
      if TURN180.include?(@action.attack_id)
        @direction = (@d-10).abs
        @d = @direction
      else
        @direction = @d
      end
    end
  end
#-------------------------------------------------------------------------------   
# Collision Check
#-------------------------------------------------------------------------------
  if @action.nil? or @action.attack_id == 0
      return
    end
    if Database_Bullet::USE_HIT_CHECK[@action.attack_id] and @check_colision == nil
      return
    end
    hit_check = false
    range = @action.attack_range
    hit = []
    if @action.user.is_a?(Game_Event) and
      @action.player_damage == true
    targets = $game_map.events.values 
    else
    targets = [$game_player] + (@action.player_damage ? [] : $game_map.events.values)
    end 
    for event in targets
      next if event == self  or
              @action.hit_events.include?(event) or event.erased
      body_size      = event.body_size
      event_center_x = event.x
      event_center_y = event.y - body_size
      dx = event_center_x - self.x
      dy = event_center_y - self.y
      dx = (dx >= 0 ? [dx - body_size, 0].max : [dx + body_size, 0].min)
      dy = (dy >= 0 ? [dy - body_size, 0].max : [dy + body_size, 0].min)
      case @action.attack_range_type
      when Map::RHOMBUS
        hit_check = (dx.abs + dy.abs <= range)
      when Map::SQUARE
        hit_check = (dx.abs <= range and dy.abs <= range)
      when Map::LINE
        case self.direction
        when 2
          hit_check = (dx == 0 and dy >= 0 and dy <= range)
        when 8
          hit_check = (dx == 0 and dy <= 0 and dy >= -range)
        when 6
          hit_check = (dy == 0 and dx >= 0 and dx <= range)
        when 4
          hit_check = (dy == 0 and dx <= 0 and dx >= -range)
        end
      end
      hit.push(event) if hit_check
      hit_check = false
    end
    for event in hit
      if event.action_effect(self, self.action.attack_id)
        hit_check = true
      end
      if @action.multi_hit == false
        @action.hit_events.push(event)     
      end     
    end
    if hit_check
      $game_temp.active_token = self
    end
  end
 
  def hit_check
    @check_colision = true
  end
end # module

#-------------------------------------------------
# Adds new constant to database bullet
#-------------------------------------------------
module Database_Bullet
  USE_HIT_CHECK = []
end
EVENTALIST
Show Signature
EVENTALIST
Administrator
Administrator
#2 default Re: XAS - Manual hit_check
Loading

G@MeF@Ce

G@MeF@Ce
Administrator
Administrator
Administrator
profile
Oh goody! XAS,Hackel,Wiggles,script!? must = awesome!

will have to tinker with this, thanks for sharing ^,^
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
C.O.R.N.
C.O.R.N.
#3 default Re: XAS - Manual hit_check
Loading

BluE

BluE
C.O.R.N.
C.O.R.N.
C.O.R.N.
profile
WOAH. That's cooooool. Like complicated technotically hyper drive uber customization
C.O.R.N.
Show Signature


Want a real challenge? Try [You must be registered and logged in to see this link.]

If you read this message, please PM me. this is a test. And I'm serious, this isnt just some lousy time wasting paragraph that I wrote just to fill in my signature. It's here for a reason. PM ME.
C.O.R.N.
http://51s-seedy-masteroogway.blogspot.com
EVENTALIST
EVENTALIST
#4 default Re: XAS - Manual hit_check
Loading

mr_wiggles

mr_wiggles
EVENTALIST
 EVENTALIST
EVENTALIST
profile
yea, it was just annoying how when an explosion happened that it wouldn't show the animation for me or that it would show X the number of enemies it hit. or that it exploded from so far away. So i made this for Outbreak and decided to share, because every one likes to have complete control when it comes to events. (or is that just me?)
EVENTALIST
Show Signature
EVENTALIST
ACTIVATED
ACTIVATED
#5 default Re: XAS - Manual hit_check
Loading

Pozinhofan

avatar
ACTIVATED
ACTIVATED
ACTIVATED
profile
I didn't understand. How can i use this? Input the script, create a line on the script of the skill, and go to the event skill and put hit_check?
But, the line of the script, , true or false?! Confuse @.@
ACTIVATED
Show Signature
ACTIVATED
EVENTALIST
EVENTALIST
#6 default Re: XAS - Manual hit_check
Loading

mr_wiggles

mr_wiggles
EVENTALIST
 EVENTALIST
EVENTALIST
profile
Actually looking back at this script, XAS can already do this.

You just have to link two tools together.
look at "Bomb arrow" tool in the XAS defualt tools.
EVENTALIST
Show Signature
EVENTALIST
ACTIVATED
ACTIVATED
#7 default Re: XAS - Manual hit_check
Loading

Pozinhofan

avatar
ACTIVATED
ACTIVATED
ACTIVATED
profile
Oh yeah, i see xD
Well, thanks, i don't know this ;O
ACTIVATED
Show Signature
ACTIVATED
EVENTALIST
EVENTALIST
#8 default Re: XAS - Manual hit_check
Loading

mr_wiggles

mr_wiggles
EVENTALIST
 EVENTALIST
EVENTALIST
profile
Yea i didnt either till i tore 3.7 apart when i made my own version of XAS. :p
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