R0J0hound's Recent Forum Activity

  • From the sdk manual you can get the SOL:

    https://www.scirra.com/manual/29/object-type

    so you can get the current SOL with:

    var sol = obj_.getCurrentSol();

    The docs say to not modify other object's sol but I guess you could modify it, call that action, and then change the sol back to what it was.

    //save current
    var old_instances = sol.instances;
    var old_select_all = sol.select_all;
    
    // set new
    sol.instances = [this.pinObject];
    sol.select_all = false;
    
    // call action here
    
    //restore old
    sol.instances = old_instances;
    sol.select_all = old_select_all;[/code:3vdezqca]
  • I guess it's possible to put the html/css inside an svg file and draw that to the canvas. I found a library that does it but I was only able to use it in Chrome. Didn't test Firefox. Edge and Internet explorer can't do it.

    https://developer.mozilla.org/en-US/doc ... o_a_canvas

    http://cburgmer.github.io/rasterizeHTML.js/

    https://www.dropbox.com/s/s6i82scb1txn1 ... .capx?dl=0

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Odd. I'd recommend trying the browser's debugger. Open it and select the sources tab. Clicking on a line number will add a breakpoint. That will cause execution to stop so you can inspect the values of everything, and advance it a line at a time. It might help you see some logic errors?

  • Mubot

    I put an updated link in my post

  • You need to use the "call" method to set what "this" is.

    So change this line:

    this.inst.type.plugin.__proto__.acts.ZMoveToObject(1,this.pinObject.type);

    to:

    this.inst.type.plugin.__proto__.acts.ZMoveToObject.call(this.inst, 1,this.pinObject.type);

  • Fun list. I haven't spent a whole lot of time with C3 yet, but I like your ideas to push the limits. I especially like the conditionals idea, it makes me wonder how deluxe a game could be made with one event. Anyways in the spirit of the topic here are a few more ideas:

    8. Utilize behavior's as much as possible instead of events. A behavior won't always fit with what you want to do but it sure is nice when it does or even is just close enough.

    9. Make a simple scripting language to control your game. Admittedly it may be pretty tricky to cram that in 25 or 40 events but if successful you'd be able to have a lot more logic. Being able to type multi line text for text properties in c3 is useful for this.

    I'm drawing a blank for any other general ideas, no doubt there others.

  • One way to find it is to was console.log(this); somewhere in your plugin. Then you can open up the developer console and you should be able to click the arrow by "this" and browse the object tree.

    But off the top of my head since I was messing with this recently:

    this.inst.type.plugin.prototype.acts.zmovetoobject.call(this.inst, ...)

    Sorry I neglected the capitalzation, I'm on my phone.

  • You can have the javascript code call a C2 function.

    See javascript intergration section.

    https://www.scirra.com/manual/149/function

  • Custom Draw Plugin

    Download:

    https://www.dropbox.com/s/lm5b6l4mhr3vy ... 0.zip?dl=1

    Features:

    * This plugin allows you to use any sprite's texture to draw quads or points.

    * They can be transformed with translation, rotation, scale and shear.

    * It has a transformation stack to do nested transformations.

    * There's an expression to transform any x,y value with the current transformation.

    * The uv's of the texture can be specified. Some actions are included to make selecting a sub-texture easier.

    Use notes:

    * This is a webgl only plugin. A canvas fallback hasn't been implemented at this time.

    * The drawing is relative to the object's center and the object's size and angle aren't automatically used.

    * The drawing can be bigger than the object's bounding box, but the bounding box is used to determine if it should be drawn.

    * Stuff will be drawn only if this object is on screen. Typically this is solved by putting it on a non-scrolling layer.

    Example:

    https://www.dropbox.com/s/n78c9dywrulcz ... .capx?dl=1

    https://www.dropbox.com/s/0b08fcy5ienxb ... .capx?dl=1

    https://www.dropbox.com/s/w5hmjdohlyher ... .capx?dl=1

  • jogosgratispro

    Updated that chain of links.

  • This replicates the 8 direction behavior with events except solids won't affect it.

    https://www.dropbox.com/s/0jfbslxhy9ded ... .capx?dl=0

    The custom movement behavior would add little other than handling the actual motion and max speed clamping.

    • Post link icon

    Zebbi

    Pretty much constant 60fps vs about 45fps. I benchmarked my old system and new system with this:

    http://www.passmark.com/products/pt.htm

    and found that:

    95% of systems are faster than my old system and

    75% are faster than my new one.

    Jayjay

    Windows version is only relevant for the nwjs export since they're dropping support for xp and vista as I recall. Also I'm fairly certain only one core is utilized by Construct's runtime, with maybe the exception of webworkers used for pathfinding and perhaps some other things.

    Sorry I think I'm off topic from the rest of the topic.