Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 how to check if a method has been aliased?
#2
It isn't just hidden classes. No - no - no . :cheery:

Place a condition to check an @instance value around your aliased method in question, and immediately set that @instance value to something other than 'nil'.

Code:
#--------------------------------------------------------------------------
  # * Fallen Pose
  #--------------------------------------------------------------------------
  if @derv_anim_bat_stack.nil?
    @derv_anim_bat_stack = true
    alias mnk_collapse collapse
    def collapse
      if @battler.is_a?(Game_Actor)
        mnk_collapse if DEFAULT_ACTOR
        mnk_collapse if DEFAULT_COLLAPSE_ACTOR
        if DEFAULT_ACTOR_ID != nil
          mnk_collapse if DEFAULT_ACTOR_ID.include?(@battler.id)
        end
      else
        mnk_collapse if DEFAULT_ENEMY
        mnk_collapse if DEFAULT_COLLAPSE_ENEMY
        if DEFAULT_ENEMY_ID != nil
          mnk_collapse if DEFAULT_ENEMY_ID.include?(@battler.id)
        end
      end
    end
  end

As you can see (and thanks to SephirothSpawn for showing me this), I wrap an entire method in an if...end block that has a condition....
Code:
if @derv_anim_bat_stack.nil?
    @derv_anim_bat_stack = true

    ---the whole aliased block--

  end
which right after it, I set the @derv_anim_bat_stack value to 'true'.

It will only perform this method if the @instance value is nil, whereupon I set the @instance to something else. And, yeah. This part of Animated Battlers did create the dreaded F12 crash years ago until this fixed it.
Reply }


Messages In This Thread
[Resolved] how to check if a method has been aliased? - by DerVVulfman - 01-20-2010, 01:54 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
   Array to arguments for a method? PK8 2 4,529 07-08-2011, 10:47 PM
Last Post: PK8
   Check player facing direction desbrina 5 6,811 06-20-2010, 09:58 PM
Last Post: deValdr
   New Encryption Method Test Legacy 2 4,304 05-22-2010, 07:17 PM
Last Post: Monster Buffer
   How to check if the value of a number is an even or odd number? PK8 5 6,762 01-04-2010, 10:45 PM
Last Post: PK8
   How to check if actor has certain stat(s) with RGSS? Twin Matrix 4 9,047 01-04-2009, 05:35 PM
Last Post: Twin Matrix



Users browsing this thread: