Ribis's Recent Forum Activity

  • >

    > I suggest to use AJAX and a database to store the variable, the best savegame system...hard to hack, and you can open the savegame with differente device

    >

    So, do I need to rent server space for this?

    Also, how would saving and retrieving that data look like on an event sheet?

    try to find some database free, I belive exsist some service who give to you a free database... but I'm not sure...

    you need to use AJAX plugin, and of course you have to use php to save/update value in your database...

    in event sheet looks like:

    in the action of the event, select AJAX > Post to URL

    "tag" = make some names for the tag, you can see if the AJAX finish to works, or has some error...

    "URL" = url of the php file, for example, if your "example.php" (if is in the same folder of the game, index.html)

    "Method" = POST.

    "data" = this is the data that you want to send to a php file, so for example, if the player register an account in your game (at the start of the game) you have to send user,mail,password like this:

    "username="&usernameinC2&"&"&"password"&passwordinC2&"&"&"email="&emailinC2

    with this, you will send the 3 variables to a php file... and now, when you have the variable, you can make a script who send the data on the database... and to read these variables in php, insert this:

    $username= $_POST['username'];

    $password= $_POST['password'];

    $email= $_POST['email'];

    now, you have to know some PHP.... for example, to make works this perfect, you have to:

    --make a function (in php) that check if an email or user exsist before the registration (and in the database select email/user unique)

    if exsist, echo an error like "user already registered", so, when the AJAX retrieve data in construct2, you can menage the situation.

    --make sure the send data in a database (like mysqli_real_escape_string)

    --when the php file register the user, if the user start with some coins or something else, just insert data in the database...etc

    --in the LOGIN.php, check if the password insert is correct with the e-mail/username, if isn't correct, just retrieve a data as before for the registration.

    if everything is working, load the data from the database from that user...

    now, if you don't know how made it, you can find some tutorial/a full example how to make a php registration/login... contruct2 just send and retrieve data...

    when you are sending data with the "Post to URL ", you can see what you retrive in the condition:

    AJAX > On completed , and now, you can set a text with the AJAX.lastData, and see, if the php works well.

    if you have more question just tell me

  • I just started making a Legend of Zelda clone. Here's the event sheet:

    The Zelda sprite is placeholder, ripped from a rom hack.

    I'm having trouble with object collision. When I walk into a wall, I start sliding sideways along it instead of just stopping. Is there a way I can make myself just stop when I hit a wall?

    h t t p s : //vine.co/v/OVF9PK7FHI0

    very easy to fix, I suggest you to read the manual and start to read some post from this forum:

    anyway, I suggest you to post a capx and use different events logic, same for hyenaman

  • I almost finish my app for facebook... why this post? well, I was trying different plugin of facebook (some works, some doesn't works...)

    So, I made my script to get perfect works my app with facebook with AJAX plugin... and sometime I see some people need help to integrate their app with facebook...

    When I publiush the app, I can start to make a manual with a project to learn how to integrate your game with the last PHP SDK of facebook.

    how works? when you have the files in php, you need to change just the ID and secret code of your app, after that, the script will work perfect just with a standard plugin AJAX of C2, so, you don't need a new plugin, and that system will works for different device...

    for now, I achieved this:

    LOGIN:

    1 - get the first pop up with a specific permission (aboutme, user friends, score....) etc, when you agree, at the second login, you don't need to login again (as the plugin) but the game already load everything without any extra login.

    GET:

    1 - your user info (name, ID, token...etc).

    2 - your score of that app.

    3 - array of the user use the same app (array for c2 ready to use)

    4 - hi-score of the app (you, and your friends, again, the php generate a correct c2array with: score, id, username, url of avatar), so, very easy to load into the game.

    5 - your unlocked achievement (get in correct array for c2, ready to load).

    POST:

    1- post your score (if the new score of the game is > of the old score, this is checked by a new request in php file).

    2 - unlock a new achievement.

    3 - post in the timeline of the user.

    for now, this is what I made, and everything works fine, in the near future, I will made:

    1- get a friendlist who doesn't use the app ( get url of avatar, name, and the token to send some request)

    2 - send request to a friend, or multiple friends.

    3 - send request like "life,coin...etc" and when the user who has the request accept it, when the game is loaded, add the amount/string in the game.

    who is interested to this?

  • the first string, you have to change in Webstorage.Localvalue("amount")

    you never make a C local value.... this is why you get NaN

    anyway, I will repeat everytime, that kind of savegame is not sure, is very easy to hack if you don't make encrypt or some secure string, and can be deleted by cleare the cache of the browser....

    I suggest to use AJAX and a database to store the variable, the best savegame system...hard to hack, and you can open the savegame with differente device

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • TiAm - agreed - that would be awesome! Thanks for the info everyone. Ribis - how would you go about encrypting the values?

    There are two plugin for that... you select a key, and from this, you can encrypt the value when you will save a string...when construct2 will try to open the new string, the plugin convert the string in a correct value (with a correct key),

    this is an example, I try to find the plugin, when I get home I will link the plugin

    anyway, you can try to save the data in different way, I mean, if you need to store some coins, like 50, you can save like this:

    "23y9812yu3982u" this is to get confused, just random string "50" real value "u23u2undu" a new random string"25" check if they hack the coin "u3342uy2382938" random string

    without encrypt, you can make your own secure script... can be difficult, but can get harder to hack a single value...

    50 is the real coin, construct count just the 50, if they hack it, a function check if a coin/2 is = to 25 o close to it... so, they need to hack 2 value, but the original string will be:

    23y9812yu3982u50u23u2undu25u3342uy2382938

    construct2 will count the "u" tokenat, you now where the 50 and 25 are, for example

    and if you store like 5 variable, you will get a long string... and you can mix it... but there is a plugin to encrypt, so, this is just for fun

  • If someone cleans their cookies will it delete saved data? And how easy are they to hack?

    the last time I tried, if you clean all of the cache of your browser, the savegame will be deleted...

    about the hack, I belive you can encrypt the value....

  • Hi for all!

    The question is about:

    I have a personal wiki-site. I have an application stored on that site. This app supplies 2 different languages (also like a site).

    How can I run my application with parameter (or any another way) that will have an information about page language? If I will run app from english page, it must be in english, if I'll run it from russian page, it must be in russian.

    For now I can make it just with WebStorage. But it saves data user must to input by himself when he will start this app for the first time (if an english-speaking user will run it first time he'll see default-russian text first, then he have to switch into english mode, just after that language option will be saved for the next time).

    I want user to avoid switching. If he will start app from english page - he must take an english version of program.

    How to make this? How to run application with some language parameter?

    You can do it with php... how the language is detected? just add one variable $language=

    I suggest you to use php, when you have your variable in php, just set:

    $_SESSION['language'] = $languageinwebsite;

    after this, just make a new page php who call the echo of the "echo $_SESSION['language'];"

    in construct2, make a call AJAX of the page where you put the echo SESSION

  • Ribis

    rojo 's canvas plugin + rex_canvas_ext behavior (Load image from URL)

    thank you, I will try it

  • The only way I found to do this was to use TiledBackground objects instead of Sprites, and resize the TiledBackground to the size of the loaded image.

    thanks for the reply, I solved this with a lot of frame... one sprite, with 200 frame (so, they are the same...so, doesn't change the memory of the sprite)

    with this is ok, because I can set a limit for the score of the player... 200 it's enough

    and the frame it's = to the IID of the obj

  • I'm trying to load more image from url with different instance, like this:

    for each avatar > load " FriendsScore.At(self.IID,3)"

    but with this, the all sprite will load just the last image (the last IID), another example is in the screenshot...

    I try a lot of combination, nothing, I can't get work

    Thank you

  • >

    >

    > I'm working on it, I had to make myself the login with facebook and the other stuff...

    >

    > I'm not making any plugin, I'm working with the php SDK, and for now I achieved this:

    >

    > when I finish to make everythings, I will add an option who want to make with a database, so, for example, if you want to store coin, diamond...etc, I will make a script who works with facebook...

    >

    > I'm making this for my game, but I will publish when I finish!

    >

    Sounds like an interesting idea. I'll keep an eye out for your future post!

    It's the best method, All of the plugin I tried for the login you have to click a button? or something like that...

    another things, for retrieve data, if you have to load some information with the plugin , you have to make a loop (wait a lot of time...if you have 300 friends for example...) or make a lot of call... in php, when you finish your script, you can do everything you want... just decide what do you need at the start...

    now I'm working to see what Achievements the app has (I made it) and now, edit the array in php where the player unlock the Achievement, so, in the final step, when you will use in your project, you have an array list with all achievements of the app (it's autoupdate) with the achievements unlocked, and when you are making your menu with the image of every achievements, just make a simple script who looks on the array if the self.(achievementSprite) is unlocked... I'm making this to adapt for every game... the idea it's to concentrate in your game, and when you need facebook, you have to call just 1 AJAX.LastData...and it's already loaded in the SESSION.

    but the important thing, this is loaded very fast before the game it's loaded, so, you don't have to make any loading to retrieve data... and works well!

  • wow this is so old and outdated. For anyone who finds this, there is a built in multiplayer plugin, and a facebook plugin as well.

    Currently, the Facebook plugin isn't working right out of the box, but there is a fix for it on the forums.

    I'm working on it, I had to make myself the login with facebook and the other stuff...

    some plugin doesn't support minify script, or don't have some function...or you have to make a loops to retrieve some data....

    I'm not making any plugin, I'm working with the php SDK, and for now I achieved this:

    1° at the first time the user access in your app, appear a fantastic pop up for the permission (just the first time) in some plugin, you have to click a buttun (in the app) to load the popup...when you agreed with the permission at the first time,and when you reopen the app, the login is automatic! you don't need to make any button!

    2° you will have all of your data (your score,username,id,mail...etc) (plugin already do this.., but sometime you have to make more action for retrieve more data, like your score)

    3° you will have a ready array for c2 to use it, you don't need to make any loop...just one click and you will have:

    -all friends who use the app (NAME,ID,PICTUREURL)

    -friends who use the app with the score (NAME,SCORE,ID,PICTUREURL)

    -friends who don't use the same app (NAME,ID,PICTUREURL) I have to made this one, but it's easy.

    the all data of these 3 points are loader in just a second, and they are ready to use before the app is loaded, so, when the app it's ready, you have just to call 2 ajax to retrieve everythings fine!

    You can also post the score in one click, and you can unlock an ACHIEVEMENT just with one click! easy to use and fast, you don't need any extra plugin! so, this means if mobile support AJAX, everything will works fine!

    and, for the score and the achievement, your friends will see everything in the activity!

    I'm still working in it, early, I will add:

    • invite the friends who don't use the app.

    -see what achievement you unlocked (so, when you are in the game, you can see what achievement you have to unclock and what is already unlocked, without use your database)

    -request! send a life or anything you want.... (this is good if the app use a external database)

    -post and other things....

    when I finish to make everythings, I will add an option who want to make with a database, so, for example, if you want to store coin, diamond...etc, I will make a script who works with facebook...

    I'm making this for my game, but I will publish when I finish!

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