Mikal's Forum Posts

  • I was getting the same error with Phone Gap Build.

    What worked for me was moving to use the Cordova CLI 9.0.0 locally (on a Mac.)

    If you do not have a Mac, you could try this: macincloud.com (though I have not used it myself.)

  • You can try my rotate shader effect. It rotates the _image_ of the object within the object on C3 render (it does not the object itself.)

    It has a bunch of fun caveats :)

    - It requires 'spacing' in terms of making the DC or sprite large enough that when you rotate the images within the DC.

    - It requires the DC to be square (could probably fix this in the effect by taking pixelSize.x/pixelSize.y into account)

    - When pasting into DC, DC will be located in the original non-rotated position.

    Yes, this may make it too hard to use, but just in case you have a special case that can deal with the above caveats... I've tried it and I get the DC image to rotate.

    Of course, I support the idea to add the real function to rotate the DC also though!.

    construct.net/en/make-games/addons/313/rotate

  • Also, just so you know there is a paid plugin that includes Playfab functions:

    chadorirebornxd.itch.io/construct-master-collection

  • Try this (I will also test):

    Add this to an on startup script event:

    globalThis.myIruntime = runtime
    

    Then do this in your call back:

    myIruntime.callFunction("LoginWithCustomID_Results",sessionTicket)
    

    If you are on the unofficial Construct Community Discord we can discuss over there too in realtime...

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • One way to do this:

    - On your JS callback fcn have it call a c3 event based function with the result as a parameter. Then you can assign that result to whatever you want in c3 events (e.g. a C3 global or do something with it in events.)

    - in JS do the following to call C3 function defined in events (instead of doing 'return result'.)

  • For me for Globals, I create a JSON object and then add objects and values to that. You can create 'globals' on the fly using this. The main issue is that there is no centralized 'list' of all the globals (unless you load them via file and don't add more entries during runtime.)

  • I know we are getting off-topic here, but I would definitely be interested in an advanced JSON example. The JSON plugin been really useful for me. I've replaced using project globals with using JSON objects, which helps with organization. I also use JSON for levels, configuration, user data, etc. I would also appreciate a better JSON editor (e.g. w/ collapsing hierarchy, detect repeated keys in the same levels, etc. I do appreciate the existing color coding and error checking.)

  • Thanks for the comments, that all makes sense. Good to hear about the experience. In terms of the development environment, yes I hope that someday we can use an external editor at least for the JS files included in the project.

  • Thanks for the tip! How was the experience of doing all of the game in JS vs using events? Better perf? Faster dev? Other?

  • Thanks all!

  • Ported a new effect - Spark!

    construct.net/en/make-games/addons/340/spark

    Includes an example project.

    If you use it, it would be great to see it in action in your game, post a link or share a picture!

  • Some example code, set globalThis.globalRuntime = runtime in startup scripts.

    Also see: construct.net/en/make-games/manuals/addon-sdk/runtime-reference/object-classes/worldinfo

    var topLtX = localVars.topLtX
    var topLtY = localVars.topLtY
    var topRtX = localVars.topRtX
    var topRtY = localVars.topRtY
    var botLtX = localVars.botLtX
    var botLtY = localVars.botLtY
    var botRtX = localVars.botRtX
    var botRtY = localVars.botRtY
    var effectIndex = localVars.effectIndex
    // Get instance details
    var inst = globalThis.globalRuntime.GetInstanceByUID(localVars.uid)
    var wi = inst.GetWorldInfo()
    // Find bounding box
    var minX = Math.min(topLtX, topRtX, botLtX, botRtX)
    var minY = Math.min(topLtY, topRtY, botLtY, botRtY)
    var maxX = Math.max(topLtX, topRtX, botLtX, botRtX)
    var maxY = Math.max(topLtY, topRtY, botLtY, botRtY)
    // Calc bonding box
    var width = maxX - minX
    var height = maxY - minY
    // Set bounding box
    wi.SetX(minX)
    wi.SetY(minY)
    wi.SetWidth(width)
    wi.SetHeight(height)
    wi.SetBboxChanged()
    // Calc normalized relative range (0-1) for texture X,Y coords from pixel locations
    topLtX = (topLtX-minX)/width
    topLtY = (topLtY-minY)/height
    topRtX = (topRtX-minX)/width
    topRtY = (topRtY-minY)/height
    botLtX = (botLtX-minX)/width
    botLtY = (botLtY-minY)/height
    botRtX = (botRtX-minX)/width
    botRtY = (botRtY-minY)/height
    
    // Set effect parameters (takes 5%+ CPU @ 2000 objects)
    /*
    inst._sdkInst.CallAction(C3.Plugins.Sprite.Acts.SetEffectParam, effectName,0,topLtX)
    inst._sdkInst.CallAction(C3.Plugins.Sprite.Acts.SetEffectParam, effectName,1,topLtY)
    inst._sdkInst.CallAction(C3.Plugins.Sprite.Acts.SetEffectParam, effectName,2,topRtX)
    inst._sdkInst.CallAction(C3.Plugins.Sprite.Acts.SetEffectParam, effectName,3,topRtY)
    inst._sdkInst.CallAction(C3.Plugins.Sprite.Acts.SetEffectParam, effectName,4,botLtX)
    inst._sdkInst.CallAction(C3.Plugins.Sprite.Acts.SetEffectParam, effectName,5,botLtY)
    inst._sdkInst.CallAction(C3.Plugins.Sprite.Acts.SetEffectParam, effectName,6,botRtX)
    inst._sdkInst.CallAction(C3.Plugins.Sprite.Acts.SetEffectParam, effectName,7,botRtY
    */
    
    // (take 1%+ CPU @ 2000 objects to find index by effectName), instead pass in effectIndex to function
    // var effectIndex = inst.GetObjectClass().GetEffectList().GetEffectTypeByName(effectName).GetIndex()
    
    // Set effect parameters by ref (faster than CallAction)
    var effectParam = wi.GetInstanceEffectList().GetEffectParametersForIndex(effectIndex)
    effectParam[0]= topLtX
    effectParam[1]= topLtY
    effectParam[2]= topRtX
    effectParam[3]= topRtY
    effectParam[4]= botLtX
    effectParam[5]= botLtY
    effectParam[6]= botRtX
    effectParam[7]= botRtY
  • Playing with adding a procedural noise effect to the particles. Adjusting the procedural noise texture offset parameters based on location gives a sense of movement/rotation/animation. Also adjusting color based on x,y, and gravity. Looking for more ways to use this with particles going forward.

  • Ashley,

    Thanks for the link on the shader compositor, very interesting reading.

    For now, what I have done is remove the pixelSize uniform from my shader and instead pass in similar values for the text object custom effect via user uniforms. I pass it '1.0/Text.width' for my own pixelSizeUser.x and '1.0/Text.height' for pixelSizeUser.y. This seems to work ok so far for iPhone mobile, safari and chrome on MacOS, with both high and low quality fullscreen and multiple resolutions. If the text box size changes, I must update the uniforms. Also if I spawn a Text object with the effect, I also must update the uniforms for the Text object spawned.

    I understand your comment on the complexity, I see different behavior of the effect compositor on mobile and desktop with existing effects, so I see that adding more uniforms, etc. may be difficult.

  • Oh sorry, maybe I was not clear, I’m just going to do the work around in my game for that one object put two shaders). I am not asking for a change to C3. I may even make a dummy shader to try to lower the perf impact a little. I just wanted to see if you thought that was ok.