Mikal's Recent Forum Activity

  • Another option is to try out a JS QR library and use C3 JS integration to add it to your project.

    For example:

    github.com/nimiq/qr-scanner

    One caution on mobile. Last I checked, iOS (as of 13.2) does not support user-media (web camera) when using webkit (e.g. iOS app or PWA.) The Apple team claims to be 'working on it.'

    It should work with Desktop Chrome, Safari on iOS and Android.

  • Great post - well done TheRealDannyyy and Armaldio!

    A few comments on my Greenworks plugin (Greengrinds.) It's free, it's an extension of the official C3 plugin. It works with nw.js and Electron (using Armaldio's Electron For Construct.)

    I added ACEs for the following Greenworks APIs: Cloud File, more Achievements, Stats, and DLC. It's also C3 only.

  • For basics, see:

    partner.steamgames.com/doc/gettingstarted

    It does not need to be one binary. You can upload directories (such as an nw.js directory.)

  • I usually follow this tutorial series when I need a refresh:

    youtube.com/watch

    This is mainly how to get your content up to Steam and publish it (but not all the marketing, biz and partner details.)

    Also, you can use one of the C3 Greenworks plugins to do achievements, etc.

    construct.net/en/make-games/addons/84/greenworks

    (Construct Official)

    or

    construct.net/en/make-games/addons/244/greengrinds

    (I extended the above plugin to add more Greenworks commands and it is also compatible with Electron build.)

  • Check out this (it has many limitations, but if the fates allow, maybe it will work for you :) )

    construct.net/en/forum/construct-3/plugin-sdk-10/copy-effect-143743

    It depends on render order, so if you place it on a certain layer it will copy everything under that layer (rendered before it.)

  • Example of denorm and clamping.

    /////////////////////////////////////////////////////////
    // Barrel
    
    //The current foreground texture co-ordinate
    varying mediump vec2 vTex;
    //The foreground texture sampler, to be sampled at vTex
    uniform lowp sampler2D samplerFront;
    //The current foreground rectangle being rendered
    uniform mediump vec2 srcStart;
    uniform mediump vec2 srcEnd;
    //The current foreground source rectangle being rendered
    uniform mediump vec2 srcOriginStart;
    uniform mediump vec2 srcOriginEnd;
    //The current foreground source rectangle being rendered, in layout 
    uniform mediump vec2 layoutStart;
    uniform mediump vec2 layoutEnd;
    //The background texture sampler used for background - blending effects
    uniform lowp sampler2D samplerBack;
    //The current background rectangle being rendered to, in texture co-ordinates, for background-blending effects
    uniform mediump vec2 destStart;
    uniform mediump vec2 destEnd;
    //The time in seconds since the runtime started. This can be used for animated effects
    uniform mediump float seconds;
    //The size of a texel in the foreground texture in texture co-ordinates
    uniform mediump vec2 pixelSize;
    //The current layer scale as a factor (i.e. 1 is unscaled)
    uniform mediump float layerScale;
    //The current layer angle in radians.
    uniform mediump float layerAngle;
    
    //effect.fx
    precision mediump float;
    
    uniform mediump float scale;
    
    void main(void)
    {
     mediump vec2 n = (vTex - srcOriginStart) / (srcOriginEnd - srcOriginStart);
    
     vec2 st = n - 0.5;
     float theta = atan(st.x, st.y);
     float rad = sqrt(dot(st, st));
     rad *= 1.0 + scale * pow(rad, 2.0);
     
     n = clamp(vec2( 0.5 + sin(theta) * rad, n.y), vec2(0.), vec2(1.));
    
     gl_FragColor = texture2D(samplerFront, mix(srcOriginStart,srcOriginEnd,n));
    
    }
    
  • You are normalizing the u,v coords (n), you usually have to denormalize again before you sample the texture again (map it to the region of spritesheet your image resides in.)

    (e.g. sampler2D(sampleFront, mix(srcOriginStart, srcOriginEnd, nUpdated)) )

    If nUpdated.x or nUpdated.y is < 0 or > 1, you need decide how to deal with that, e.g. clamp or set color to a base color (transparent, white, etc.)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • If you want to update your nw.js, check out these later builds of the Greenworks node files so you can update your nw.js version.

    greenworks-prebuilds.armaldio.xyz

    Also A small plug, I added more ACES for Greenworks API in my free Greengrinds plugin.

  • Great tutorial for c3IDE.

    If you do additional c3IDE tutorials, I suggest:

    - Add interaction with C3 SDK: world info, instance info, change instance parameters (location, size, etc.)

    - Effect (I can supply some simple effect code, if you need and I can add some notes if you want.)

  • I was wondering about this too and tried it, I can get it to work with a plugin, but not with a behavior (it looks the the OnPropertyChanged function is not called when changing the property of the behaior on an instance.

    Here's the code from the top-level instance.js (using the SDK behavior example to test from here: construct.net/en/make-games/manuals/addon-sdk )

    "use strict";
    
    {
    	const BEHAVIOR_CLASS = SDK.Behaviors.MyCompany_MyBehavior;
    	
    	BEHAVIOR_CLASS.Instance = class MyCustomBehaviorInstance extends SDK.IBehaviorInstanceBase
    	{
    		constructor(sdkBehType, behInst)
    		{
    			super(sdkBehType, behInst);
    		}
    		
    		Release()
    		{
    		}
    		
    		OnCreate()
    		{
    		}
    		
    		OnPropertyChanged(id, value)
    		{
    			console.log("***INFO*** id:"+id+" value:"+value);
    			debugger
    		}
    		
    		LoadC2Property(name, valueString)
    		{
    			return false;		// not handled
    		}
    	};
    }
    
  • You are welcome.

    You also _may_ be able to get it to work in worker mode if you use some special global variables and don't need APIs not available in worker mode.

    Check out globalThis in the following manual page:

    construct.net/en/make-games/manuals/construct-3/scripting/using-scripting/javascript-construct

Mikal's avatar

Mikal

Early Adopter

Member since 22 Apr, 2016

Twitter
Mikal has 103 followers

Trophy Case

  • 8-Year Club
  • Entrepreneur Sold something in the asset store
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Forum Hero Made 1,000 posts in the forums
  • Popular Game One of your games has over 1,000 players
  • Regular Visitor Visited Construct.net 7 days in a row
  • Steady Visitor Visited Construct.net 30 days in a row
  • RTFM Read the fabulous manual
  • x10
    Great Comment One of your comments gets 3 upvotes
  • Delicious Comment One of your comments gets 10 upvotes
  • Email Verified

Progress

19/44
How to earn trophies