rexrainbow's Recent Forum Activity

  • jayderyu

    Here is an example (worksheet) of calling official function object at 3rd plugin. This worksheet plugin will call these official functions at specific delay time, so the input of this worksheet plugin is a string which defined the delay time, function name, parameters.

  • jayderyu

    Uh, do you mean that your plugin is used to communicate to each other client by passing "function object (function name and parameters)"?

    I had made a similar plugin before, and I call these functions through rex_function plugin (the official function had not ready at that time).

    It is a case of using general purpose function, imo. (not to get the user defined value)

    For example, in event sheet.

    // Myplugin: action of passing "function object structure", 
    // send this structure (JSON format) to server
    [ul]
    	[li]Myplugin: call "run" (1, 3)[/li]
    [/ul]
    // Myplugin receive this structure (JSON format) from server,
    // trigger the official function object
    + on function "run"
    + function.param(0) = 1
    ...

    Plugin users could define their own "function object structure", and the handler at event sheet.

  • jayderyu

    I would not use the official function plugin to be the callback for special purpose, except the callback is only a general purpose function call.

    A dedicate condition/action/expression is better, more read-able.

    For example, a callback to get a value from event sheet (a use defined value) triggered by plugin. It could be done by a (official) function call and (official) set return value. However, it is better to have a dedicate condition "on get value" and dedicate action "set value". More over, the parameters of this callback could be passed by dedicate expression:CurState (just an example).

    Edit:

    Event sheet.

    + Myplugin:on get value
        + Myplugin.CurState = 1 
            - Myplugin: set value to 3
        + else
            - Myplugin: set value to 0

    Plugin.

    // condition: on get value
    this.curState = 3;
    this.value = 0;
    this.runtime.trigger(cr.plugins_.Myplugin.prototype.cnds.OnGetValue, this);
    
    // action: set value
    Acts.prototype.SetValue = function (value)
    {
        this.value = value;
    };
    
    // expression:CurState
    Exps.prototype.CurState = function (ret)
    {
        ret.set_int(this.curState);
    };
  • labithiotis

    I had saw this in my pm. I need more time to understand this capx, sorry.

  • Ashley

    It has some trade-off about choosing a self-contained or a dependency plugin.

    • plugin designer might create a new plugin(or behavior) copied from official plugin because that he/she want to add only one action into this official plugin.
    • A self-contained is easy to use for beginner. But user might need to learn the same interface once again at other plugin (or behavior).

    For example, user had already known how to use official function object, then user need to learn the same interface in 3rd plugin once again.

    • the plugin will become very large if it duplicate all of dependency and hard to maintain, more bugs.

    <img src="http://i1081.photobucket.com/albums/j352/rexrainbow1/Tilebased_zps6bef913f.jpg" border="0" />

    Here is my board plugin system. I agree that it has a learning gap for beginner. Each plugin has it's own job, user might learn a new plugin member easily when he/she already understand how to use the core plugin(board plugin).

    Dedicate condition/action/expression is more easy to read at some cases. In these case, I will chose to have a dedicate ACE.

    Edit:

    I thought a well-organization architecture is the most important thing. Easy to maintain, more readable, and more extend-able.

    A self-contained plugin might not be the best choice sometimes, imo.

  • this._call_fn = cr.plugins_.Function.prototype.acts.CallFunction;
    this._official_fnobj = plugin.instances[0];
    this._call_fn.call(this._official_fnobj, name, params);
  • Update

    • support save/load system
    • user does not need to assign timeline object if there is only one timeline object in the environment. See the capx at first post.
  • labithiotis

    Oh, I understand. Your requirement is so special. I'm afraid that hash table could not support this. You could do this at event sheet, or functionext plugin if you like javascript.

  • labithiotis

    Reference

    How about 2. "Merge new keys from hash table B" ?

  • I have a gravity behavior which call set force at physical behavior.

  • Joannesalfa

    The record data could be got by "Expression:RecorderList". It's a JSON format string.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Update

    • support save/load system
    • user does not need to assign timeline object if there is only one timeline object in the environment.
rexrainbow's avatar

rexrainbow

Early Adopter

Member since 4 Apr, 2011

Twitter
rexrainbow has 87 followers

Connect with rexrainbow

Trophy Case

  • 15-Year Club
  • RTFM Read the fabulous manual
  • Email Verified

Progress

17/44
How to earn trophies