Wastrel's Forum Posts

  • I suspect you will need to use lerp or some such fancy mathematical function.

    Check out this post for a great explanation: http://www.scirra.com/forum/lerp-opacity_topic55210_page1.html

    Based on that, I think you would need to use Sprite.Set angle -> lerp(Sprite.Angle, endAngle, speed), where speed would be some percentage which would define how fast the transition from the current angle to endAngle would proceed.

    If I have it wrong, someone will correct me.

    newt is the Master of Lerp.

  • Focksbot, I am not familiar with the current free version, but you would add this action under a condition, like System -> Every tick.

    Then Add action: System -> Set layer angle or Set layout angle.

    Increase the angle by some amount every tick.

  • Thanks for the summary, kyatric!

  • um... edit time.

    F12 does do anything as far as I can tell within C2 editor.

    Okay. I misunderstood what you were asking.

  • seac, press F12 for the Chrome debugger

  • What an informative discussion! And not a flame in sight!!

  • Ashley & rexrainbow, thanks for your help.

    I think I had a misunderstanding about our limitations on using built-in plugin code in our custom plugins.

    I will just include the code I need, and not try to call the expression.

    Thanks!

  • Nice post Kyatric!

  • newt, I could do (and have done) that, but the set cursor to sprite action was added to fix lag issues associate with the sprite method.

    Also, I've experienced some weird stuttering issues setting a sprite to the cursor using sprite actions, and the set cursor to sprite action seems to alleviate those issues.

  • Uh, I only could run "action" of plugin, not "expression", since the expression will put return value on it's first parameter (ret.set_int(3), for example), not really return a value (return 3).

    I'm not sure I understand the difference between the two, which may be part of my problem. :D Every time I learn something new in JS, 10 more things pop up that I don't understand.

    I also have the same issue before, I don't want to repeat mouse/touch in my behaviors because that I need more effort to maintain.

    So I made a touch wrap, just copy from official touch plugin then add some functions for passing some information outside. So other behaviors could just get events or information from this touch wrap...

    I assumed we were not supposed to use code from built-in plugins, based on what Ashley said before. If we can use this code in our custom plugins, then that makes it a lot easier.

    I guess I still don't understand why I'm unable to get a reference to the existing Mouse instance and use the expressions in the instance to get the information.

    Thanks for your reply!

  • Add a field to the Mouse -> Set cursor from sprite action to specify an animation frame in the sprite to use

    The work-around is to add a Sprite -> Set animation frame action before the set cursor call, but having the option in the set cursor action would be nice and save space.

  • It's me again!

    This time I'm attempting to access the Mouse object's X & Y expressions from a custom plugin.

    In my project, I have the Mouse plugin and my custom plugin loaded. From the custom plugin, I am attempting to access the expressions from a condition. I am using the following lines:

        var mouseX;

        cr.plugins_.Mouse.prototype.exps.X(mouseX, 0);

    I receive the following error when the condition is executed:

        Javascript error!

        TypeError: this.runtime is undefined

    localhost/Mouse_plugin.js, line 339

        This is either a bug in Construct 2 or a problem in a third party    

        plugin or behavior - please report it to the developer!

    Line 339 of the Mouse plugin is:

        layer = this.runtime.getLayerByNumber(layerparam);

    I only have 1 layer in the project (layer 0).

    Any assistance would be appreciated.

    Thanks!

    EDIT:

    So it became obvious that I am not working with an instance of the Mouse object, thus the errors. But I can't seem to figure out how to obtain a reference to the instance. I've followed rexrainbow's logic in this post: scirra.com/forum/behavior-accessing-a-plugin_topic50811.html, but it isn't working for me.

    Again, any assistance would be appreciated.

  • Gamer, check out this thread: http://www.scirra.com/FORUM/enemy-movement-and-ai_topic49926.html?KW=

    There is a link to an example that might help you.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I was able to open it without crashing using IE9 and Firefox 13. It did crash using Chrome 20.

    I am running R99 under Windows 7 64-bit.