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 default RMXP + XAS = bullet Terrain tag
Loading

Hackel

avatar
ACTIVATED
ACTIVATED
ACTIVATED
profile
I made this script for my game and I think someone could need it.

This script switch a self switch "ON" if the bullet hit a title with a special terrain tag. You can let a rocket explode if it hit a wall or stick an arrow in the wall. Just add a extra event page with the self switch and do whatever you want.

You can change the Terrain tag in line 2 and the self switch in line 3

Paste the script under XAS System and above Main

Edit:
I made a new version with 3 terrain tags and short commands to turn or stop the event. You can also bounce the event on corners
See the demo to see what I mean.
[You must be registered and logged in to see this link.]


Spoiler:

Code:


module XAS_ACTION
  TERRAIN_TAG = 1
  SELF_SWITCH = "B"
  STOP        = []
  TURN180    =[3]
  BOUNCELEFT    =[]
  BOUNCERIGHT  =[]
  TERRAIN_TAG2 = 2
  SELF_SWITCH2 = "B"
  STOP2        = []
  TURN1802    =[]
  BOUNCELEFT2    =[]
  BOUNCERIGHT2  =[3]
  TERRAIN_TAG3 = 3
  SELF_SWITCH3 = "B"
  STOP3        = []
  TURN1803    =[]
  BOUNCELEFT3    =[3]
  BOUNCERIGHT3  =[]
def check_event_trigger_attack()
    if @action.nil? or @action.attack_id == 0
      return
    end
    if @ox == nil
    @ox = self.x
    @oy = self.y
  end
      if @d == nil
      @d = @direction
    else
      @direction = @d
      end
  unless @ox == self.x and @oy == self.y #or
        @ox = self.x
    @oy = self.y
    if $game_map.terrain_tag(@ox, @oy) == TERRAIN_TAG

    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.include?(@action.attack_id)
          @move_type = 0
        end
        if TURN180.include?(@action.attack_id)
          @direction = (@d-10).abs
          @d = @direction
      elsif BOUNCELEFT.include?(@action.attack_id)
          case @d
    when 2
      @direction = 6
    when 4
      @direction = 8
    when 6
      @direction = 2
    when 8
      @direction = 4
    end
    @d = @direction
    elsif BOUNCERIGHT.include?(@action.attack_id)
          case @d
    when 2
      @direction = 4
    when 4
      @direction = 2
    when 6
      @direction = 8
    when 8
      @direction = 6
    end
    @d = @direction
    else
    @direction = @d
    end
  elsif $game_map.terrain_tag(@ox, @oy) == TERRAIN_TAG2
      if @d == nil
      @d = @direction
    end
    unless SELF_SWITCH2 == 0
    key = [$game_map.map_id, self.id, SELF_SWITCH2]
    $game_self_switches[key] = true
    $game_map.need_refresh = true if $game_map.need_refresh == false
    end
    if STOP2.include?(@action.attack_id)
          @move_type = 0
        end
        if TURN1802.include?(@action.attack_id)
          @direction = (@d-10).abs
          @d = @direction
    elsif BOUNCELEFT2.include?(@action.attack_id)
          case @d
    when 2
      @direction = 6
    when 4
      @direction = 8
    when 6
      @direction = 2
    when 8
      @direction = 4
    end
    @d = @direction
    elsif BOUNCERIGHT2.include?(@action.attack_id)
          case @d
    when 2
      @direction = 4
    when 4
      @direction = 2
    when 6
      @direction = 8
    when 8
      @direction = 6
    end
    @d = @direction
    else
    @direction = @d
    end
    elsif $game_map.terrain_tag(@ox, @oy) == TERRAIN_TAG3
      if @d == nil
      @d = @direction
    end
    unless SELF_SWITCH3 == 0
    key = [$game_map.map_id, self.id, SELF_SWITCH3]
    $game_self_switches[key] = true
    $game_map.need_refresh = true if $game_map.need_refresh == false
    end
    if STOP3.include?(@action.attack_id)
          @move_type = 0
        end
        if TURN1803.include?(@action.attack_id)
          @direction = (@d-10).abs
          @d = @direction
    elsif BOUNCELEFT3.include?(@action.attack_id)
          case @d
    when 2
      @direction = 6
    when 4
      @direction = 8
    when 6
      @direction = 2
    when 8
      @direction = 4
    end
    @d = @direction
    elsif BOUNCERIGHT3.include?(@action.attack_id)
          case @d
    when 2
      @direction = 4
    when 4
      @direction = 2
    when 6
      @direction = 8
    when 8
      @direction = 6
    end
    @d = @direction
    else

    @direction = @d
    end
  end
  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
end
ACTIVATED
Show Signature
ACTIVATED
Administrator
Administrator
#2 default Re: RMXP + XAS = bullet Terrain tag
Loading

G@MeF@Ce

G@MeF@Ce
Administrator
Administrator
Administrator
profile
@Hackel - how do you say in German "simply awesome" >?
I started to play with the first version and I was going to reply
but then I saw that you updated the script AND included a
really cool ninja demo!

Thank you for sharing! You are the best!

@everyone - try the ninja demo to see how Hackel made XAS TOOLS
even better with the bullet Terrain Tag script.
it's "simply awesome" I tell you!

GO XAS!
there's only one action battle system for me... :face:
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
Tutorial Wizardmaster
Tutorial Wizardmaster
#3 default Re: RMXP + XAS = bullet Terrain tag
Loading

calvin624

calvin624
Tutorial Wizardmaster
Tutorial Wizardmaster
Tutorial Wizardmaster
profile
Amazing. Simply ... amazing. Implementing this into F:B now Very Happy
Tutorial Wizardmaster
Show Signature
Tutorial Wizardmaster
http://xasabs.com
EVENTALIST
EVENTALIST
#4 default Re: RMXP + XAS = bullet Terrain tag
Loading

mr_wiggles

mr_wiggles
EVENTALIST
 EVENTALIST
EVENTALIST
profile
Sweet script, i have a question tho, can you give some instructions in the script like a header block?

Sorta like this one: (if its Right)

Spoiler:

#===============================================================================
# Created by Hackel
# Bullet Terrain Tags
#===============================================================================
# Uses Tool ID's
#
# TERRAIN_TAG = 1 # Terrian tag number
# 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. |<--->|
# BOUNCELEFT = [A,A,A,A] # Bounce To the Left. "Turns Tool Left"
# BOUNCERIGHT = [A,A,A,A] # Bounce To the Right. "Turns Tool Right"
#
# A = Tool ID
#
#===============================================================================
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