Ribis's Forum Posts

  • Ok, the problem is simple but I don't know if there is some bug or some error?

    If you jump at the first platform, the Jump sustain works well, in the second one, the jump will be higher and you can jump 2 platform in one jump! I don't know why, I use a very easy example to show where the problem is...

    is a construct2 problem? there is any script, so.... that's strange...

    https://www.umbriadesign.it/jump_error.capx

  • That is not answering my questions... nevermind.

    I will just assume it is the way I am asking but this is not helping me even a bit.

    I do appreciate everyone for trying though.

    I have read everything about GET and POST in both php and Construct2 documentation. I understand that mysqli_real_escape_string bit but I think I can avoid using it by using 'prepare' instead. And mysqli_real_escape_string doesn't work on anything but strings anyways. But all of that is irrelevant.

    I am not getting errors except when i use POST in the php script I don't get any value returned. Console and network do not seem to make any mention of why btw but I won't linger on that because my main issue is not solved yet anyway.

    I am simply wondering why everything I do keeps showing up in the network view (shown below) as using GET even if both php and Construct2 are set to use POST.

    sorry but English isn't my first lenguage, so, I have to understand very well when we are talking about this stuff and I can't try the example, and If I miss something I misunderstood what do you would like to make....

    if you want to send a data with POST method to a php file, my example works, and the script that I posted works for insert a value inside the table user in the database...

    why you don't get any value returned? can you post here the php file with capx?

    in my projects, when the user is logged in, I save different value with SESSION like this:

    $_SESSION["username"] = "myname";

    $_SESSION["coin"] = "250";

    ...

    ...

    and I can recall the variable just with an AJAX and get the echo from the SESSION and destroy it when I used it... but you can do it in the same php file with the echo after the login in your php and get the lastData from construct2

    for the security there are a lot of method, for example, SESSION isn't to much sure if you don't use correctly, you can encrypt the password and other value/string...etc

    what version of PHP run in your server?

  • Okay i have tried out this tutorial. I have no errors all works nice but i get no friend requests... the number is 0.

    I created the self code what is on tutorial. The name is correct given but the list of friends i get 0 but i have 753 friends so there must be an error

    your app has the permission to read the list friend? it's 0 because you don't have the permission friendlist

  • Hello, i want try to get Facebook Friends profile pictures in a sprite?

    Anyone know how this works. How can i begin ?

    you can use PHP or java...

    with PHP, just use the SDK of facebook and use AJAX to retrieve data from the script...

    you can find everything here: https://developers.facebook.com/

    anyway, I will publish (maybe in the store) a project with php file and capx to make your app with facebook, like:

    make hi-score, make and post an achievement, get user friend list who use the same app with name, picture, get the hiscore in the array from of friendlist........etc

    in very simple way... I did it (just 5 event to do all of this), I have just to make a tutorial to explain how everything works (in php)

  • Well the big issue i have is that people can see the data send. In this case the Username and Password.

    I know there is

    $username = $_GET['fname'];

    $password = $_GET['fpass'];

    I have tried simply replacing the word GET with POST but that seems to stop the php script from working.

    But there is more that i don't understand.

    In construct2 there is the option to use AJAX to 'request url' and 'post to url'. I have tried both but both show in the console in the browser.

    So the two questions I have are..

    1- Do I need to use the 'post to url' in my eventsheet to make the data invisible?

    2- How do I convert the bit of php to use POST instead of GET and does that make it invisible?

    I just don't want everyone with a tiny bit of knowledge to see the username and password.

    Hard to understand the tutorial I am using is on this website and that uses GET in both php and AJAX. But then states it is not a very secure way.however that it can be made more secure. The tutorial is more than two years old but there are no relevant posts on the scirra forums to make it secure. There is not even a post regarding how to use the AJAX function 'post to url' properly on here except the manual entry which doesn't explain my question. Is there a better way to go about this or something? Does nobody have large data sets to load or compare to a database? Now somebody mentioned somewhere else on this forum I should use JSON instead and load all my database into an array from a JSON file. *sigh* Then why is this AJAX even an option? And why is that tutorial still up if it is not really advised to use that method? *Bllllarg

    I had to use POST in one of my project to send different array (and save in json file by php) for make the savegame for every user and that works perfect..

    if you use POST method, in construct2 would be:

    Post to url:

    Tag: "somename"

    URL: link of your php file

    data: "username="&usernameC2&"&"&"password="&passwordC2

    method: POST

    the php would be:

    [quote:mlsz2j52]$username= mysqli_real_escape_string($con,$_POST['username']);

    $password= mysqli_real_escape_string($con,$_POST['password']);

    and when you have the connection with your database, just start a query:

    $sql1="INSERT INTO user(username, password)

    VALUES

    ('$username','$password')";

    mysqli_query($con,$sql1);

    this works for me... if you have some error, in your server (where is the php file) the server will make a file with the name of the error, and you can check from the console of chrome when you try to send data to see some error

    for more information about POST and GET: http://www.w3schools.com/tags/ref_httpmethods.asp

  • It says the character set has to be set serverside.

    I am assuming that setting it in the mysql database would work then? Doesn't construct2 set it as well and woudn't that make it unsafe?

    I don't have my old project right now (I have it in another computer), if I remember, you have to set:

    $username = mysql_real_escape_string($_POST['username']);

    and when you call the query, should be the same (if I remember well), you can try with this method anyway, and see if there are some error in your ftp folder

    another think, you should use POST method...

    GET method can be show very easly from the browser (you can see what data you are sending) with a method POST, you can't see that data...so, just easy example, if you are making a game and you want to send 100 gold to an account, the user can see the variable where you are sending the gold like: mywebsite.com/file.php?user=myname&gold=100 and if someone want to hack the game, is very easy to do...

    and with GET method you have limit of 2083 characters to send... so, if you want to send an array can be a problem, with POST, you don't have any limit...

    a perfect example is this: http://www.w3schools.com/php/func_mysqli_real_escape_string.asp

    try to edit this example and see if works

    a lot of website have these problems... SQL injection is very easy to do

  • UberDark

    Is very easy to hack by sql injection if you don't use mysql_real_escape_string.

    look at this page for more information, ad une POST method : http://php.net/manual/en/function.mysql-real-escape-string.php

    let me know if you have some question

  • Yes Ribis it is for a website and meant to be used online. I just stuck to a text file because someone else that never uses Construct2 has to be able to add users and passwords.

    I don't have knowledge on how to make databases..

    Thank you both for responding.

    in this case, I really suggest you to use a database, put everything is a text file can be easily hacked and people can see all of the password in the array...

    how you check if the password is correct in construct2? you have to load all of the user/password in the project... if someone check what the website load (in the Console Javascript of Chrome for example) everybody can see the password of all of the users... same for the array...

    make a database is very easy, if you try to find "how to make login/registration in php" you can see how easy is to make a database with the php files... contruct2 have to send just data (with the POST method) the username and the password in a php file...

  • > I had to quit just one game because of the performance, but because I was using a lot of graphics in HD

    >

    Lots of HD graphics is a classic case of hitting the GPU fillrate limit, which is a hardware limitation. This is exactly what I was talking about: you seem to think it's HTML5's fault and that a native engine would be faster, but it would still have the same hardware limitations. It's entirely possible this type of game would perform exactly the same in a native engine - no faster at all. This adds to my skepticism when people ask that we develop a native engine. It is not a magic bullet that makes existing hardware any better than it is.

    well, I'm not so much expert about hardware and something like that... but about the logic of programming I'm good...

    the project was this:

    The problem of the html5 I think is the memory management and how the browser load all of the game... the browser have to load everythings... for example, I tried to make the same project in other software (not with all the logic, just graphics and platform gameplay) and works fine...

    when you have to load 600mb of picture, the browser start to have some problem...

    anyway, I know the html5 in the future will be better, a lot more, and the tecnology need to be better, and the most user who have the same problems, is because how they made the game...

    another project I made with cocoonJS, works very well, and I load a loot of sprite with a very good graphics, and In my iphone5s run in 60 fps...

  • this is for website? I means, the text is saved in a server and you need to be connect in internet?

    You can save a full array in a a .json file and just load when you need it...

    If your project is working online, I suggest you to make a database and don't use any text file

  • Well, but depends....I mean, so much people need more performance...sometime is true, but in the most case is because people made bad process and use a bad way to make their games... in the forum I see a lot of mistake in the examples, I see a lot of bad ways to reach something...

    Actually I never finish a game, I made different prototipe of some games, and they works great, my problem is how to make the gameplay/level....

    I had to quit just one game because of the performance, but because I was using a lot of graphics in HD,

    in the mobile, is crazy to think "I want a perfect performance..." if you want the perfect performance, you have to programm everything with the native code, that is the easiest way to make your game better, HTML5 isn't ready now the mobile game if you want to make a fancy game...

    anyway, in the future will be easier to make games in html5, and the hardware can be ready for that

  • Look at event 3 -- you're subtracting timescale from countdown. Since timescale doesn't change with the framerate, it will always take the same number of frames for it to reach zero, even if it takes more time. Thus, at lower framerates countdown will take longer to reach zero and the sprite will move farther.

    Try subtracting (60 * dt) instead -- this should give you the same result regardless of framerate.

    that is, 60*dt, thank you very much, I was trying 60/dt

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I have a easy question...

    this is the capx: https://www.umbriadesign.it/test_fps.capx

    result:

    I made an easy example, we have a blue square that is moving at angle 0 by 600*dt pixel every tick...(so, if you change the timescale, will be fine) with a countdown.

    in 60 fps, for example, the square reach 490px, but a 34 fps, will be 859.... I read somewhere how to fix this problem by some formula...but I don't remember...

    I would like to have the same result(o very close, like 20 different px it's fine) with different fps...

    thank you very much <img src="{SMILIES_PATH}/icon_e_biggrin.gif" alt=":D" title="Very Happy">

  • Hello to all

    in my game title, i have 3 sounds

    a rain sound, who is in loop and start when the layer start.

    a ambient music, in loop who start when the layer start

    and a lightning sound, who only run when a layer "lightning" appears

    But i have a problem, the sound lightning when he start, it has some kind of "echo" or "delay", but my original sound dont have that thing, where this problem come from??

    Do you use any effects in c2? look in the javascript console (of your browser) if there is some problem with the sounds...

  • Rest is easy with C2

    how you can make that game with C2?

    construct2 doesn't support 3D ENGINE, so, you can't make a game like that... there is a plugin called Q3D and you can make game in 3d, but I belive isn't possible to publish for smartphone... just for make a good game in 2D there are a lot of problems... how could be possible in 3d?

    if was possible, this game in c2 would run like 2FPS, or maybe less... to hard to use a plugin without a good software to menage the 3d.

    you have to use unity, this game isn't diffucult to make it, but you can't use construct2....

    you can use 200$ to buy some assets in the unity store, I belive you will find some good stuff, like "how to break glass"...etc