StefanN's Forum Posts

  • Hi,

    For a couple days I have a 'problem' with converting one of my Construct 2 game in Construct 3. I have a small Javascript that is executed with the Browser function from where I pass a variable to the Construct 2 game.

    Example:

    Browser > Execute Javascript > "... c2_callFunction('find_id', [found]);"

    Function > on 'find_id" > set variable to Function.Param(0)

    So, this is how I made it in Construct 2. With the Javascript line I transfer a variable to Construct 2 game. I get that variable through 'set value' to 'Function.Param(0)', where I assign the first param to that variable from the game.

    Ok, the problem is that in Construct 3 we don't have anymore this type of functions.

    How do I transfer the 'found' variable form Javascript to the Construct 3 game?

    I saw that now the function is 'c3_callfunction...'. But I don't know how to transfer that value.

    Anybody know how to do that? :)

  • WackyToaster

    Yes, I'm using cloudsave. Thanks for the trick.

    Kyatric

    Yes, it worked. I modified the APP ID from ADMOB, and it worked. Thank you! :)

    Case closed. Thank you all! :)

  • Yes, you are correct, but I forgot. :)

    The problem is that I got the bug only when exporting to APK, and I updated the game just with 2 images.. so I'm not sure where is the problem.

    EDIT:

    It seems that I have a problem with exporting to APK. I tried exporting the game to HTML5 and worked well, the game had no bug. The problem appear just when exporting the APK.

    But I don't get any error.

  • Hi,

    I would like to know if it's possible to access older version of the game through Construct 3?

    Long story - short

    I developed a game for Android, all fine and good. I uploaded the APK to Play Store and the game was fine. Yesterday I made an update of the game (added a new character), export to APK and made an update of the game to Play Store.

    The problem is that now the game is dead. It will not start. I enter in the app (on Android), and is just closing.

    It is possible to access an older version of the game in Construct 3?

    If you need further information, please ask.

    Thank you, and have a great day! :)

    EDIT:

    I don't get any error message, just: "APP NAME has stopped.". The game is running well on Construct 3 preview.

    Tagged:

  • I understand. Thank you for clarification.

    If anybody had this type of error, please contact me.

  • Hi,

    I have the following error "Uncaught TypeError: Cannot read property 'indexOf' of undefined ima3.js:76" when I test the game for mobile in Chrome Developer Tools and on Sony Xperia Z5 Compact.

    What is more interesting is that the game works fine on iPhone 6 and on desktop.

    Here is the console error from Chrome Developer Tool:

    The game is hosted here: goo.gl/P98bCo

    Anybody got the same error for Android / Chrome Developer Tools?

    Thank you. :)

  • Hello rexrainbow,

    I tried your plugin, but for me, it didn't work. When I tried your sample, it returned just a blank screen, nothing else.

    I'm looking for this type of script with which I could read data (HTML) from a different website.

    Thank you! :)

  • Done.

    Here is the Javascript code:

    var found = -1;
    $.get(
     'http://domain-example.com',
     {paramOne : 1, paramX : 'abc'},
     function(data) {
     gasit = data.indexOf('the word are you looking for');
     if(found >= 0)
     { 
     c2_callFunction('cauta_pub_id', [found]);
     
     }
     }
    );
    

    In the C2 you have the function "cauta_pub_id" where you set the variable to the first parameter which is sent from Javascript code.

    This is how you can create a bridge between Javascrip and Construct2 variables.

    Hopes this help someone. :)

  • Ok, I found how to do that.

    The next question is: I can output the result in Construct 2? Like, if I have a variable "aux" in Construct 2 and the variable "found" from the Javascript code, it's there a way for me to transfer the information from the code to my variable, like ex: "aux = found".

    Javascript code:

    var found;
    $.get(
     'http://domain-example.com',
     {paramOne : 1, paramX : 'abc'},
     function(data) {
     found = data.indexOf('your-text');
     if(found >=0)
     {
     alert('Your text was found at position: '+found);
     }
     }
    );
    

    Anybody? :)

  • I make small games in Construct 2, and I need a little help with javascript, ajax, or something. I need to search for something in a specific internal web page.

    I need to search if my 'pub-id' is in the 'ads.txt' of each domain where my game is. The problem is that I can't figure out how to crawl to other internal pages, because using 'document' didn't help me out.

    What i've tried:

    var id='2314121'; //my id var found = document.documentElement.innerHTML.indexOf(id); //it's searching my id in the HTML code if(found >= 0) //it will return -1 if it's not there, and position if's there { alert('Found it at position: '+found); }

    The problem is that this will search just on the current page, and I need to search in a specific one. I need to search in 'www.domainexample.com/ads.txt'.

    I found how to tell on which site I am with 'window.location.host', but I'm stuck here. I can't crawl from the index to ads.txt.

    Anybody knows how to make this?

    Thank you! :)

  • BadMario

    Yep... that's pretty true. I tried to reload on different browsers, PCs, and nop... never worked. The update never comes.

  • Hello!

    I tried for days to do something, but I'm block for the moment, so, I will need a little help from you guys!

    What I want to make

    Let's say that we have this site, greatstuff.com. Ok, so, there I will place my game with a google ad mid-roller (an gaming ad for desktop, that is placed in the middle of the game, when player die, or he goes level up, or something like that). From some months, Google implemented "ads.txt", and if your google id publisher is not listed there, your AD will not show. So the game to work, at greatstuff.com/ads.txt you have to find your pub-id.

    So, I want to check if that site have my pub-id in the ads.txt, and if is there, the game will work, if not, it will appear a message informing the webmaster about adding my pub-id so that the game can work.

    Ok, so... how can I verify this? I have to trunc the domain to have "greatstuff.com" (because with Browser.domain you will have the full link, like greatstuff.com/mygame.html) and to concatenate with "/ads.txt", so, I will be on that page. Ok, now.. how I can crawl that page? How can I find if there is listed my pub-id?

    Anyone have done this? Anyone have an idea?

    Thanks!

  • Ashley

    Ok, I understand. Thank you!

    OddConfection

    Ok. I will add that event to my games. Thanks!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Let me explain.

    I create a game and upload it to my server. Now, the game is located at . Now, a bunch of webmasters take my game and publish it on their sites, creating an iframe code. All good by now.

    Let's say that I saw a bug, and I want to fix that. The game is played until now by 10000 players. I open my file projecs (cpax), make changes, export it, reupload in the same directory, so that the link is still live.

    Now, the problem appear. My chanes are not visible for those 10000 players who played the game before, becase the game is still function from cache. How can I force the browser to take my latest update of the game for those who played before?

    Thank Ashley!

  • Yep.. It worked. Before that, I tried with "Return is down"... but that didn't work.

    Now it solved. Thank you!

    I bought a coffee for you!