Login with parse, send to database and return to variables

Get help using Construct 2

Post » Fri Jan 08, 2016 2:24 am

Hi, i make login system in my game using this tutorial:
https://www.scirra.com/tutorials/1455/player-loginsign-in-tutorial-using-rexrainbow-parse-plugin

Its real way to add global variables from game to database in parse data?
in database i see username, email etc but i want see ammount of money, score, level of weapon ets and i want have posibility to edit this variables to see modified variables in game.

so game should send info to parse and parse should send to game

its possible to make?
Last edited by delgado on Sat Jan 09, 2016 2:10 pm, edited 1 time in total.
B
103
S
25
G
43
Posts: 1,879
Reputation: 33,403

Post » Fri Jan 08, 2016 4:20 pm

It is definitely possible.

I have never used Parse, so I don't know exactly how it works. But there are plenty of tutorials on Google:
http://www.raywenderlich.com/98831/pars ... b-backends
https://github.com/ParsePlatform/Anyyolk
https://parse.com/docs/js/guide
https://teamtreehouse.com/community/sig ... javascript

You may have to use the Browser > Execute JavaScript or a rex_plugin to make it all work together. If you keep at it you will figure it out with enough reading.
https://www.ravenheart.ca/home
Company name changed to avoid Facebook-type shenanigans

"Someone once told me I bite off more than I can chew...

I told them I would rather choke on greatness than nibble on mediocrity."
B
22
S
6
G
1
Posts: 1,365
Reputation: 4,724

Post » Sat Jan 09, 2016 2:00 am

It is possible to have another field in user table, you might try rex_parse_itemtable plugin.

But parse could not send data to user if user did not do requesting.
B
107
S
25
G
243
Posts: 4,387
Reputation: 137,466

Post » Sat Jan 09, 2016 2:31 am

@delgado
You can refer to my 2nd Parse tutorial:
https://www.scirra.com/tutorials/1465/l ... rse-plugin

You'll find how to add score value for different player.
Providence University, lecturer.

Tatung University, lecturer.



Consultant per question: USD$15 / time

Consultant by month: USD$300 / month

Customized project: USD$2500 / capx
B
72
S
16
G
4
Posts: 189
Reputation: 7,494

Post » Sat Jan 09, 2016 2:09 pm

@jomo thanks for reply, @rexrainbow if score can send to database and return to game its not possible to do this same with other variables?
B
103
S
25
G
43
Posts: 1,879
Reputation: 33,403

Post » Sat Jan 09, 2016 3:33 pm

@delgado

The score read back after user send a request to server. i.e. if user does not send this request, nothing will be received.
B
107
S
25
G
243
Posts: 4,387
Reputation: 137,466

Post » Sat Jan 09, 2016 3:40 pm

@rexrainbow but user send request from game right?
B
103
S
25
G
43
Posts: 1,879
Reputation: 33,403

Post » Sat Jan 09, 2016 3:52 pm

@delgado

I mean that user does not know the newest value or the field had been changed until user send a request.
On the other hand, if user want to update a field to the newest value, it needs send request every 1 min ( or 30 seconds ) for example, then it will cost a lot of requests = money.
B
107
S
25
G
243
Posts: 4,387
Reputation: 137,466

Post » Tue Jan 12, 2016 3:37 pm

@rexrainbow hi, i use your plugin but this plugin and other examples downloaded from your site add add new data to account look at this image
Image

i need something what add new values under User data
Image

is something i dont understand or i miss something?
B
103
S
25
G
43
Posts: 1,879
Reputation: 33,403

Post » Tue Jan 12, 2016 3:55 pm

@delgado

You might try to set the "Class name" to "User" to access this User (account) table, in properties table of rex_parse_itemtable plugin. After authenticated, you could read user ID by "Expression:UserID", it is equal to objectId in this table at the first field of each row.
Now you could
1. set the cash by "Action:Set value"
2. set the gunlevel by "Action:Set value"
3. set userID by "Action:Set itemID" ( userID = itemID = objectId )
4. call "Action:Save" to save this row into parse server, "Condition:On save complete" will be triggered while saving successful.
B
107
S
25
G
243
Posts: 4,387
Reputation: 137,466


Return to How do I....?

Who is online

Users browsing this forum: Yahoo [Bot] and 6 guests