Save-Point

Full Version: Save-Point
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Board Message
Sorry, you do not have permission to access this resource.
Save-Point - Looking for a sensing aura script

Save-Point

Full Version: Looking for a sensing aura script
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
(08-24-2016, 03:58 AM)DerVVulfman Wrote: [ -> ]The word is actually 'bump'  Winking
Oh... Yeah, right.
BUMP! :)
bump
I wrote this in about a half an hour. It is an early stage 'test' version, merely applying a battle animation over events with the 'Aura' comment in the event list. BUT... it's stage one.

Code:
#==============================================================================
# ** Djigital Aura
#------------------------------------------------------------------------------
#  by DerVVulfman
#
#  WORK IN PROGRESS ... no version number yet
#  Requires the SDK Add-On:  Event Comment Supplemental
#               (http://save-point.org/thread-3823.html)
#==============================================================================


module Aura
  
  AURA_KEY      = Input::A    # Key Pressed to perform aura test
  AURA_COMMENT  = 'Aura'      # Comment in Event ID for Aura  (Ex: 'Aura 6' )
  AURA_RANGE    = 5           # Range from event (in Tiles)
  
end


#==============================================================================
# ** Game_Map
#------------------------------------------------------------------------------
#  This class handles the map. It includes scrolling and passable determining
#  functions. Refer to "$game_map" for the instance of this class.
#==============================================================================

class Game_Map
  #--------------------------------------------------------------------------
  #  * Aura Script's In range? (Near Fantastica addendum Anti-Lag Edit)
  #     object : event object in map
  #--------------------------------------------------------------------------
  def aura_in_range?(object)
    screne_x        = $game_map.display_x
    screne_x        -= 256
    screne_y        = $game_map.display_y
    screne_y        -= 256
    screne_width    = $game_map.display_x
    screne_width    += 2816
    screne_height   = $game_map.display_y
    screne_height   += 2176
    return false    if object.real_x <= screne_x-32
    return false    if object.real_x >= screne_width+32
    return false    if object.real_y <= screne_y-32
    return false    if object.real_y >= screne_height+32
    return true
  end
end



#==============================================================================
# ** Scene_Map
#------------------------------------------------------------------------------
#  This class performs map screen processing.
#==============================================================================

class Scene_Map
  #--------------------------------------------------------------------------
  # * Alias Listings
  #--------------------------------------------------------------------------
  alias game_map_aura_update update
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    # Do test if key triggered
    aura_test if Input.trigger?(Aura::AURA_KEY)
    # Perform the original call
    game_map_aura_update
  end
  #--------------------------------------------------------------------------
  #  * Aura Script's In Circle Range? (Near Fantastica View Range Edit)
  #     element : element
  #     object  : object
  #     range   : range from the target in tiles
  #--------------------------------------------------------------------------
  def aura_in_range?(element, object, range)
    x   = (element.x - object.x) * (element.x - object.x)
    y   = (element.y - object.y) * (element.y - object.y)
    r   = x + y
    return true if r <= (range * range)
    return false
  end  
  #--------------------------------------------------------------------------
  # * Test objects within range of player within the map
  #     range : area range from target (default in config)
  #--------------------------------------------------------------------------
  def aura_test(range=Aura::AURA_RANGE)
    # Cycle through events
    for event in $game_map.events
      # Skip if not in screen range (limit the events tested)
      next unless $game_map.aura_in_range?(event[1])
      # Perform aura if in range of player
      aura_apply(event) if aura_in_range?($game_player, event[1],range)
    end
  end
  #--------------------------------------------------------------------------
  # * Apply Aura Effect on Event
  #     event : event
  #--------------------------------------------------------------------------
  def aura_apply(event)
    # Get list of comments
    mylist = SDK.event_comment_list(event[1])
    # Exit if no Aura ID
    return if mylist.nil?
    # Garner data from comment list
    returned = SDK.event_comment_data(mylist, Aura::AURA_COMMENT)
    # Exit if invalid data
    return if returned.nil?    
    # Perform animation
    event[1].animation_id = returned.to_i
  end
end
NOTE: It does require an additional script to work, but that script is right [/Highlight](>HERE<)[/Highlight]

How's that so far?

Getting it to draw the graphics for a time over the sprite will be the hard part.
Thanks for your work so far.
Im not sure whether a real picture or a battle animation is better in terms of performance to be honest.
The bigger problem is the sdk based addon, im not a user of SDK and I believe it would collide with my other Scripts, this is what I assume T_T.
Hehe. You didn't look at my SDK addon. Winking It is an SDK add-on, but can act independent of the SDK, and able to work without it. Happy You should have no problem with that little fellah.

Insofar as a battle animation.... Oh, you could make colored variations of the 'Dazzle' animation to match the hue you want for each NPC using the comment system. Like making battle animation 101: Aura Purple. animation 102: Aura Red, etc.

But that's a startoff point. I do intend to go for the charset overlay effect which will be more difficult. It's already giving me a headache trying to get it going. Out of curiosity, are you using any paperdoll system. By that, I mean something such as either Rataime's, Geso Chiku's or Me™'s Visual Equipment scripts?

Um... you didn't see the play on the word 'Digital' in the script name? Winking
Oh, if SDK is not needed, then its fine. Im sorry i get scared when I read "SDK" LOL.
Yes, charsets would be indeed better than battle animation since one can only have 999 limited and I have a lot of skills..
No, im not using a paperdoll system nor a visual equipment script.

LOL, now I see it.
Actually the word djigit means someone who is brave, strong and is used for people who know how to ride on horses, It comes from the turkic words.
It is widely used in the caucasus and in many turkic countries.
Okay... lessee if you notice a script now added into the Scripts Database. Winking

If not, check THIS out.

The aura effect is a character drawn BEHIND the related actor, the name of the aura characterset being defined in the the comment used. So you may have a generic 'Aura Standard' that uses the 'Standard.png' characterset, or 'Aura Kitty' if you're using a 'Kitty.png' charset.
Pages: 1 2