makarone's Recent Forum Activity

  • I can confirm this issue.

    Tested on Intel XDK and Cocoon also. App is crashing.

    Can we have a solution from the developer of this plugin ?

    When i bought this plugin i thought it supposed to be working, isn't it?

    cranberrygame

    Or maybe some of you guys on the forum knows how to fix that?

    Thanks!

  • Hi everybody.

    I've added Chartboost ad plugin to my C2 project. ( rewarded video plugin)

    When i'm trying to test it from intel xdk ( app preview) it works fine on the android phone,

    but when i'm building app, it doesn't work on a phone and the app quits instantly.

    On the other phone it shows server connection issue ( and shows a path to the android assets, index.html etc)

    Did anyone had this issue?

    Thanks

  • Thanks for the answer!

    I found an and easy way how to do that:

    To hear from the index.html file i put some code to it.

    i need index.html file to read from the linked js file in the game folder

    We have to know ads availability to make an action in construct .

    That code was pasted to the end of the index.html file.

    Inside the bottom <script></script> brackets

    function checkForAd()
    {
     //make sure webstorage is supported
     if (typeof (Storage) !== "undefined")
     {
      	//check if the key exists
      	if (//type your funtion from any of the js files you have in your project) {
      		console.log("Ad is available; localforage is " + localforage);
      	 	localforage.setItem("adAvailable", "yes", function(){
      	 		console.log("item has set to: yes");
      	 	});
      	}
      	else {
      		console.log("Ad is NOT available; localforage is " + localforage);
       		localforage.setItem("adAvailable", "no", function(){
       			console.log("item has set to: no");
       		});
    
     	}
    
     	console.log("localforage.adAvailable=" + localforage.getItem("adAvailable"));
     } else {
     	console.log("Storage is undefined");
     }
    
    }
    
    [/code:1udlmti1]
    
    In the construct i made some actions:
    
    Every level i need to call this script to not left it sleep ( just to be sure it works), by Executing javascript: "checkForAd();"
    Each time we loose the game we checks the availability of the local storage key : LocalStorage- check item exist: "adAvailable"
    On iten "adAvailable"  exist we are getting it: LocalStorage get item: "adAvailable"
    And then, on item Get, we can compare it's key  or just do our action we plan, for me it to create a button.
    
    So, i hope it can help you to hear from the html file or js file any function you need.
    
    Peace!
  • Hi Guys, i'm spending a lot of time in searching how to get js data from the external js file, but no luck.

    I have added *.js file to the project folder, and i need to pick a function from this file.

    So, if this function or value inside of it is true(or exist), i'm switching my value inside a Construct and executing new js

    Is anybody know how to do that? Or maybe you can point me to the existing tutorials that i missed.

    Many thanks!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Sometimes, we need to remove sound from the problem devices like galaxy s3, sharp, xperia Z , and hide audio button on them.

    I found a solution for that.

    First, we need to add an events and global variable to a project:

    [attachment=0:3a3k6fdi][/attachment:3a3k6fdi]

    Then, we need to export the game and add a code to the index.html

    // Create new runtime using the c2canvas
    			cr_createRuntime("c2canvas");
    
    //put a code right here in your index.html
    
    });
    
    //CODE
    var ua = navigator.userAgent.toLowerCase();
    		var isSthree = ((/gt-i9300|gt-i9305|gt-i9301|sgh-n064|sgh-n035|sch-j021|sgh-t999l/i).test(ua)); 
    		var isSharp = ((/SHL24|SHL23|SHL22|SHL25|SHL21/i).test(ua)) && !/(firefox|opera|chrome)/i.test(ua);
    		var isXperia = ((/D6603|D6616|D6633|D6643|D6653|L55t|L55u|D6708/i).test(ua)) && !/(firefox|opera|chrome)/i.test(ua);
    		var isXperiaZ = ((/C6602|C6603|C6606|C6616|SO-02E/i).test(ua)) && !/(firefox|opera|chrome)/i.test(ua);
    		var isIE10 = /MSIE 10/i.test(navigator.userAgent);
    		var isTest = false;
    		// var isTest = false;
    		 
    		delete sessionStorage.rm_disablesound;
    
    		if (typeof (Storage) !== "undefined")
    		{
    		  if(isSthree || isSharp || isIE10 || isTest || isXperia || isXperiaZ) 
    		  {
    		   sessionStorage.rm_disablesound = 1;  
    		  }
    		}
    
    		[/code:3a3k6fdi]
    
    That code was written not by me and i can't explain it  throughly.
  • SOLVED.

    Create blank sub event under your main evet ( for example "button was clicked")

    Select System- Compare values

    Compare:

    LayoutName

    = Equal to

    "enter layout's name" - with quotes

    And then add action to switch to the required layout.

    Works!

  • Thanks for the answers, but this is not what i need.

    For example, i have 3 layouts (A,B,C)

    I have a button BTN

    Each layout has this button

    And all 3 layouts controls by !one same Events sheet

    I need to write in this sheet- If i press the button BTN and if the current Layout name is Layout A i need to switch the game to the layout B. On the Layout B i need this button move me to the layout C and if i will put this button at the Layout C i need to go to Layout A.

    How to use these control in the single Events sheet?

    Thanks

  • Hey guys!

    I want to make a button which will work in one Events sheet.

    By pressing this button i need to switch layout

    If the current Layout is = (Layout 1) then go to Layout 2 and so.

    How can i get the layout name as an sub event or event.

    Thanks!

makarone's avatar

makarone

Member since 20 May, 2014

Twitter
makarone has 19 followers

Trophy Case

  • 10-Year Club
  • Popular Game One of your games has over 1,000 players
  • Famous Game One of your games has over 10,000 players
  • RTFM Read the fabulous manual
  • Email Verified

Progress

14/44
How to earn trophies