New account registrations are disabed. This website is now an archive. Read more here.

RPG Maker MV    Posted January 29, 2016 by DoubleX

DoubleX RMMV Object Properties

Introduction

Traces all object properties meeting some conditions linked to the queried object
Designed as a bug diagnosis tool used by Javascript coders with debug experience

Features

*============================================================================
 *    ## Plugin Call Info                                                     
 *       A path in the object property trace will stop if it'd be cyclic      
 *----------------------------------------------------------------------------
 *    # Object manipulations                                                  
 *      1. trace_obj_prop(cond, label)                                        
 *         - Traces all object properties satisfying function cond linked to  
 *           this object                                                      
 *         - Labels all traced object properties with function label          
 *         - cond and label are functions written in                          
 *           Object Property Tracing Condition Function and                   
 *           Object Property Tracing Label Function respectively              
 *      2. _obj_prop_log[cond]                                                
 *         - Returns the log of all traced object properties satisfying       
 *           function cond linked to this object                              
 *============================================================================
/*------------------------------------------------------------------------
     *    Object Property Tracing Condition Function                          
     *    - Setups cond used by trace_obj_prop(cond, label)                   
     *------------------------------------------------------------------------*/
    /* cond must be a function taking the object property as the only argument
       The below examples are added to help you setup your own cond functions */

    // Checks if the currently traced object's indeed an object
    cond_obj: function(obj) {
        return typeof obj === "object";
    }, // substitute cond with "cond_obj" to use this function

    // Checks if the currently traced object's an array
    cond_array: function(obj) {
        return Array.isArray(obj);
    }, // substitute cond with "cond_array" to use this function

    // Add your own cond functions here
    

    /*------------------------------------------------------------------------
     *    Object Property Tracing Label Function                              
     *    - Setups label used by trace_obj_prop(cond, label)                  
     *------------------------------------------------------------------------*/
    /* label must be a function taking the object property as the only argument
       All label functions must return a string
       The below examples are added to help you setup your own label functions */

    // Always returns the entire object
    label_obj: function(obj) {
        return obj;
    }, // substitute label with "label_obj" to use this function

    // Always returns the type(including Array) of each traced object property
    label_array: function(obj) {
        if (Array.isArray(obj)) {
            return "array";
        }
        return typeof obj;
    } // substitute label with "label_array" to use this function

    // Add your own label functions here

The Code

License Terms

Attribution 3.0 Unported - You must attribute the work in the manner specified by the author or licensor. Commerical use allowed.

Version History

*      v1.00d(GMT 1500 27-1-2016):                                           
 *      1. Fixed enumerating this plugin's functions via for in loops bug     
 *      v1.00c(GMT 0100 13-11-2015):                                          
 *      1. Fixed tracing properties from null or non object object bug        
 *      v1.00b(GMT 1100 11-11-2015):                                          
 *      1. Added descriptions that will be shown in the plugin manager        
 *      v1.00a(GMT 1500 27-10-2015):                                          
 *      1. 1st version of this plugin finished

Credits & Thanks

DoubleX(Optional)

Terms & Conditions

//      You shall keep this plugin's Plugin Info part's contents intact       //
//      You shalln't claim that this plugin's written by anyone other than    //
//      DoubleX or his aliases                                                //
//      None of the above applies to DoubleX or his aliases                   //

Comments (3)

Leave a Reply

DoubleX

  • Posted about 9 years ago

  • Engine
    RPG Maker MV
  • Category
    System Enhancements
  • License
    Attribution 3.0 Unported
  • Version
    v1.00d

Stats

893 views

3 comments

Tags

n-a