StefanN's Recent Forum Activity

  • Nepeo

    It seems that I have an error at 'fetch', "Unexpected token".

  • Hmm.. yes, I understand what are you saying. So, the better way is like it is now. :D

  • Ashley

    Ok, I got that. So no jQuery anymore. I will try to use fetch, but I'm not familiar with it. I'm out of the city for the moment, but when I come back to my laptop, I will try to switch to 'fetch'.

    About the errors, I don't get any. Thanks for heads-up.

    Nepeo

    Thank you. After I will get home I will try your idea too.

    Have a great day! :)

  • Yes, that should work.

    But I don't think there will be many user who will do this. But, if we would have somewhere an option, check mark, something to mark as solved, maybe they will use it.

    In this way we can improve the usability of the forum.

  • Hi,

    I developed for Construct 2 a small 'script' that will tell if the site where the game is running (post with iframe) is or is not a partner (is partner if have our pub-id in thier ads.txt page).

    How?

    The game will send to a PHP page the domain where it's running. On that PHP page, we have a script that goes to domain.com/ads.txt page, and test if our pub-id is there, returning 0 if it is, or 1 if it's not there. In Construct 2, if it's 0 we will show Google ADS, and if it's 1 we will show banner ads.

    The Problem?

    I can't do the same in Construct 3. For a reason the script will not work properly and it get stuck "$.POST".

    CONSTRUCT 2

    In the Browser function, I have:

    "var url = document.referrer;
    var found;
    $.post('https://www.mydomain.com/upload/get_content.php', {posturl:url}, function(data){
    found = data.indexOf(0);
    c2_callFunction('pub_id', [found]);
    });"
    

    In the 'pub_id' function I have a simple event that assign a variable to the value of 'found'.

    PHP

    In the 'https://www.mydomain.com/upload/get_content.php' file I have:

    <?php
    $pubid1 ='mypubid';
    $url = $_POST['posturl']; //URL get from Construct 2
    
    -----
    Here I test if the domain get through Construct 2 is or is not a partner.
    If it is, I will have: $data['response'] = 0; 
    If it's not, I will have: $data['response'] = 1;
    -----
    
    echo $data['response'];
    ?>
    

    This script it's running perfectly on over 30 games. But, If I try to make it in Construct 3, I can't. It won't work. It will not enter here: "$.post('https://www.mydomain.com/upload/get_content.php', {posturl:url}, function(data){....".

    Construct 3

    The difference between C2 and C3 script is that in Construct 3 I use 'c3_callFunction' insted of 'c2_callFunction', and in the Construct 3 'pub_id' function I add parameters and after that I use them.

    Somebody had this type of issue?

    Cheers! :)

  • Magistross

    I tried in that way, but it won't work.

    piranha305

    Now I see the image. I will try it right away.

    EDIT:

    It worked. Thank you piranha305! :)

  • piranha305

    No.

  • this seems to be working

    piranha305

    It seems that your image is broke, or something. :)

    "Access to doc-0s-bc-docs.googleusercontent.com was denied"

  • Hi,

    I hope here it's ok to post a feedback.

    There days I wanted to try answering some questions in "How do I..." section, but many of them are already solved. So I lose some time till I found one that's not.

    It would't be nice to have a tag that says if the thread is solved or not? Maybe just the creator of that topic to be able to mark it, that will be nice.

    What do you think?

    Laura_D

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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.

StefanN's avatar

StefanN

Member since 6 Jul, 2017

Twitter
StefanN has 1 followers

Trophy Case

  • 7-Year Club
  • x2
    Popular Game One of your games has over 1,000 players
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

11/44
How to earn trophies