darren-chung's Forum Posts

  • 10 posts
  • Thank you for the insight R0J0hound, what you suggested truly does work! However, after reading up on the web worker mode, it seems there are benefits to it.

    The workaround that i can think of now is to make a plugin that can communicate with the main thread solely for this single function..

  • Hi R0J0hound, thank you for the help!

    i had problem calling window and found this post that i can use globalThis instead.

    However, globalThis.location.href is different from window.parent.location.href which is the page url that i need to retrieve. When i try to insert parent to globalThis, i am getting undefined error. Any help on how to proceed will be appreciated 🙏

  • Hi, I came across this Browser.ExecJS expression in the forums

    construct.net/en/forum/construct-3/how-do-i-8/detect-page-game-134770

    and i'd like to achieve the same thing for detecting if game embedded in page.

    But it seems to be a Construct 2 thingy and i can't seem to find out how to access it in Construct 3.

    I see you have a screenshot of it in a post saying that it's saying that it's in Construct 3. Anyone knows that steps to achieve this? cjbruce?

  • Thank you Ashley for reply~ I have finally got it to work by cloning the domElementPlugin sample and starting from there. I think the key is that when the DOM Element is created, it has the elementId needed to point back to the Instance by calling PostToRuntimeElement().

    Also by referencing another project file drag-drop-files, I got a clearer picture on variable passing with PostToRuntimeElement() and how to access the variable in Instance.js.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hi, I am working on porting Rex's Youtube Player addon from C2 to C3.

    So I am able get the Youtube player playing, but I couldn't find out how to let the callback functions in domSide.js communicate with conditions.js or expressions.js. I am still relatively new to the addons coding scene, and by referencing the example addons available, I have only seen triggering of conditions / expressions from instance.js. Any help would be appreciated, Thanks!

    var self = this;
    var onPlayerStateChange = function (event)
    {
    	//if (event["data"] === self.youtube_state)
    	// return;
    		
    	self.youtube_state = event["data"];	 
    				
    	// do looping
    	if ((self.youtube_state === 0) && self.cur_isLooping)
    	{
    		self.youtube_player["playVideo"]();
    	} 
    
    	console.log("onPlayerStateChange: " + self.youtube_state);
    	// how to trigger C3.Plugins.YT_API.Cnds.OnPlaybackEvent ??
    };
    
    var onPlayerReady = function (event)
    {	 
    	// old code from C2 self.runtime._trigger(cr.plugins_.rex_youtube_player.prototype.cnds.OnPlayerReady);
    };
    
    var onPlayerError = function (event)
    {
    	self.exp_errorCode = event["data"];
    	// old code from C2 self.runtime._trigger(cr.plugins_.rex_youtube_player.prototype.cnds.OnPlayerError);
    };	 
    
    var playerVars = {};
    playerVars["autoplay"] = 1;
    this.youtube_player = new window["YT"]["Player"](
    	elemId, 
    	{ "videoId": videoId, 
    	"playerVars": playerVars, 
    	"events": {"onStateChange": onPlayerStateChange,
    				"onReady": onPlayerReady,
    				"onError": onPlayerError
    				}
    	}
    );
  • mantap100 Haha glad to be of help! :)

  • Hi all,

    just in case anyone is still using or interested in the Rex CSV plugin (which has been a crucial part of my projects), I have upgraded it to SDK V2.

    I have created 2 versions which can be found in this link:

    github.com/etd-darren/construct-plugins/tree/master/ported_plugins/plugins/rex_csv

    PS:

    credits to Eren for the work of porting it from C2 to C3!

    Tagged:

  • EMI INDO

    thanks for the hard work!

  • EMI INDO

    Thank you for the code update. However, sorry that i missed out mentioning that there is error even before the looping code

    	var table = globalThis.rexObjs.CSVToArray(csv_string, this.strDelimiter);
    

    CSVToArray function is undefined. I have done some edits on my side with reference to this doc:

    https://www.construct.net/en/make-games/manuals/addon-sdk/guide/runtime-scripts/sdk-v2

    And now the condition is working as intended 👍

  • Hi, thank you for the initiative in this porting project! I am interested in porting Rex CSV addon and i have tried the addon in your link https://github.com/EMIINDO/csv-array-c3-runtime-1.0.0.1-stable-c3addon

    However, the code for eventstack looping is no longer working as discussed in this thread: https://www.construct.net/en/forum/construct-3/plugin-sdk-10/plugin-sdk-loop-182878

    Not sure if your tool is able to automate this new looping condition sdk method. In the mean while I am trying to implement the code manually to the Rex CSV addon that I'm trying to port.

  • 10 posts