Ribis's Recent Forum Activity

  • yes, you can use xml file.

    https://www.scirra.com/manual/139/xml

    but you need to check if when you export the project the plugin work on some mobile...

    you can also use JSON

  • Thank you for the reply

    My achieve is to make just one layout for all of the level.

    tilemaps are loading from JSON like (level1.json,level2.json..) etc and it's working. this means I can load a specific level if a player click in level 4 for example.

    now the problem are the sprite.

    I try to use savegame (powerfull) if I set the player "noSave" every sprite will save right?

    where I can get the json file when I click savegame?

    when I finish to make the level, I can save all of the data to JSON file. but every levels have different number of sprite, this doesn't make a problem right? I tried to savegame all of the sprite, remove some sprite from construct2, restart and reload and the sprite will regenerate in the level.

    thank you very much again

  • Hi all, I start to make a platform in 2d for a mobile.

    I have a question about the layout and the performance... I make a tilemaps for all platform and solid, and for loading a level I will use the JSON file (easy way and best performance)

    but the problem is for the "static" objects, I mean, for example the object like the coins on the map, obstacle etc... they are a sprite.

    now my question is this, if I need to make 30 level, make 30 layout just for the position of the object and some variable of instance will be not very good for my opinion, so that, is possible to save the position in JSON in easy way?

    I can make a event to make spawn some object, and after load the position or the variable for every object... I can make a static event like (spawn object --> set position) and for every level I will insert a lot of event...

    another question, if I make 30 layout with different even sheets, (5 are load in every layout, and some event will load just in specific layout) how the phone will load everything?

    thank you very much

  • I solve this problem:

    AJAX, request project --> jsonfile

    load tilemap from ---> AJAX.LastData

    somebody know if this method will work with the iphone?

    thank you

  • Hi everybody,

    I start to use a Tilemap, I think is the best way to make a good performance on mobile.

    My idea it's like that, I have 3 tilemap with 700 width. These tilemaps are a collision of the player.

    I need, when the player.X is on a specific number layout.X, to load a new tile to one of my tilemap.

    now, i tried to make a file.json like that:

    {"c2tilemap":true,"width":24,"height":62,"data":"328x-1,12,3x0,11,19x-1,14,3x-1,13,19x-1,14,3x-1,13,16x-1,12,10x0,13x-1,14,17x-1,3,4,5x0,13x-1,3,2x1,4,2x3,15x-1,3x0,3,738x-1,65,66,19x-1,65,3x66,18x-1,65,3x66,18x-1,65,2x66,21x-1,2x65,66,22x-1,4x65,66,22x-1,5x65,120x-1"}

    I saved this file in "files" folder, but now I can't load my map...

    is possible to load the json file from the folder of the project? is work on the iphone/android? and how?

    Thank you

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hi everybody, I start to use a tilemap to make a maps...

    I have different tile with different collision (for the angle of the player) when the event need to set the angle to 0 is not working... and the tile number will be -1?

    this is the example

    I don't understand why is not working with the tile number 20... the other tile works!!

    thank you very much

  • Hi Ribis,

    thanks, I also think that the C2 facebook plugin does not work with Android, it need a lot of programming and I do not have the ability to program a script and unfortunately there are not any tutorial step by step.

    For this reason I suggest to study javascript and start with easy tutorial on the web... but maybe construct2 will support this in future...

    for me is very important to have a social connection with facebook or something

  • Thanks for the reply, but I am able to run the facebook login on my website (aspx page with ajax), my problem is to run the facebook login on mobile/phone, for example on Android after creating the app with crosswalk (https://www.scirra.com/tutorials/809/how-to-export-to-android-with-crosswalk).

    I also created a job to request the intervention of someone (http://www.scirra.com/forum/facebook-login_topic85195.html)

    Thanks a lot and best Regards.

    I never try to export for android or iOS with the plugin of facebook... but I think the plugin of facebook doesn't working with the mobile, but I'm not sure about that...

    The app need to communicate with the app of facebook maybe (different way from the computer)

    maybe, you can insert to the final app some script to intagrate facebook...

    when the XDK export the app, you can open the app and edit or insert a new script? and maybe you need to use GET remote data in construct2...

  • EDIT: for the canvas url insert the index.html with "?" like index.html?, mine works with /index.php?

    and someone will find it useful for this problem:

    when you open your index.html, you need the permission of the user to use some information of the user... in other way, facebook need to know what will do your app with the user information...

    when you make a facebook app, you need to edit your index.html with some code of php.

    Save your index.html in index.php, and add this code before the "<!DOCTYPE html>"

    -------------------------

    <?php

    session_start();

    require 'client/facebook.php'; ///API OF FACEBOOK

    $app_id = "***************"; ///INSERT YOUR...

    $secret = "****************"; ///INSERT YOUR...

    $app_url = "URL OF YOUR APP"; ///INSERT YOUR...

    // Create our Application instance

    $facebook = new Facebook(array(

    'appId' => $app_id,

    'secret' => $secret,

    ));

    // Get User ID

    $user = $facebook->getUser();

    //Do we have a user?

    if(!$user) {

    $loginUrl = $facebook->getLoginUrl(array('scope'=> 'offline_access', 'read_insights', 'publish_stream', 'user_about_me', 'user_likes', 'email','redirect_uri'=> $app_url));

         

         echo "<script type='text/javascript'>top.location.href = '$loginUrl';</script>";

        } else {

              try{

                  ?//Proced knowing you have a logged in user who's autenticated

                  ?$user_profile = $facebook->api('/me');

                  ?$name = $user_profile['name'];

                  ?$id = $user_profile['id'];

                  ?$first_name = $user_profile['first_name'];

                  ?$last_name = $user_profile['last_name'];

                  ?$link = $user_profile['link'];

                  ?$username = $user_profile['username'];

                  ?$gender = $user_profile['gender'];

                  ?$locale = $user_profile['locale'];

                  ?$email = $user_profile['email'];

                  ?

                  ?

              } catch (FacebookApiException $e) {

                  ?echo ($e);

                  ?$user = null;

              }

    }

    ?>

    -----------------------

    you don't need all of this code in your case, but if you insert this maybe will work... I achieved this when I need to save the information in my database with the php... with this, you don't need the plugin of facebook, because you can get some data from the AJAX.

    let me know if you resolve the problem, now I not have so much time to reply and I don't speak english very well

  • I think a lot of users would love to be able to integrate facebook smoothly in their Android and iOS (and 'insert other OS') games.

    The way it's done now, as far as I know, is trough cocoonJS with the help of ClayIO... so you have an extra login to do. A messy, difficult workflow which a big part of the Construct 2 users struggle to accomplish (myself included). And a negative impact on revenue.

    Would be so good to have a smooth way to do this from inside Construct 2.

    I never try to export CocoonJS, but I integrate my project with facebook with the plugin of facebook to get the UID, and use the php and mysql to save data use for everything...

    I don't know how works the export for iOS, but maybe users need to authorize your application to access on facebook in their iphone.

    and actually I don't know if with your app you can send information to a page on internet to save or send some data...

    if you can use AJAX in your CocoonJS project and access to external script with the iphone will be easier...

    someone know my doubts?

  • Hi all,

    I'm making a game online... and I make a method to save the data of user in my database, actually every user can save like 70 variables and load in the game.

    this working fine, but I think what happen if I would like to save the position and the variable of the object in the map.

    I'm thinking to save the important variables in the database (level, health...etc) and the position of the object in the JSON file (or in local?)

    but if someone clean the cache of the browser it's a problem, and I can't make 6000 records for each user in my database, will be crazy...

    so, another idea it's to save a JSON file in the server, like,

    if the user save the game, the string of JSON will send to a php, the php will make a file .JSON with the name of the user in a specific folder.

    if the user load the game, scirra will load the json from the same folder with the same username.

    this idea can work? 6000 records it's a lot for JSON file? I have another problem for save a items... every sprite has 5/6 variables and if i will save on database i need to make another 100 records (it's not a big problem...but if exsist something better is good to change this)

    thank you very much

  • I can't open the file (I need to register on the website...) but you can compare a "distance(sprite.X,sprite.Y, sprite2.X,sprite2.Y)"...

    for example, if you like to make some event if some sprite overlapping but more close, or in different position, you can compare the distance....

Ribis's avatar

Ribis

Member since 22 Oct, 2012

None one is following Ribis yet!

Trophy Case

  • 12-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

16/44
How to earn trophies