How do I configure party characters

Get help using Construct 2

Post » Wed Sep 16, 2015 7:09 pm

Hello everybody!

I'm doing a character party selection screen, but I don't know how to do for configure the select player's about the Health, Power, Speed, Sprite, etc, each player have different values.

I try to find about it and I can use "IF" conditions, but if the party is 3 characters and I can select over 15 players, I should create 75 conditions for all configurations (15 for each player)!? if I create an update with other 15 characters I should do other 75 "IF" sentence!?

How is the best way for do things like that?

Thanks for help.
B
4
Posts: 5
Reputation: 210

Post » Thu Sep 17, 2015 11:22 pm

Do you have a sprite avatar for each character?
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,415
Reputation: 4,824

Post » Fri Sep 18, 2015 1:54 pm

gumshoe2029 wrote:Do you have a sprite avatar for each character?


I have a Family of Characters and each one have the configuracion about ATK, DEF, etc.
B
4
Posts: 5
Reputation: 210

Post » Mon Sep 21, 2015 5:43 pm

I would use JSON text for describing the state of your characters. Then you can use loops to iterate over a given state and do if statements on specific loops.
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,415
Reputation: 4,824

Post » Mon Sep 21, 2015 7:04 pm

JSON? yeah! that seems a good way!! thanks, sure it's what I need

But I was thinking about create a DataBase with all these characters, JSON let me get data from MySQL?

Thanks.
B
4
Posts: 5
Reputation: 210

Post » Mon Sep 21, 2015 8:50 pm

You have to use AJAX GET requests to retrieve JSON text from your server.

You can use PHP (or some other server-side language) to retrieve JSON from the database.

Do a Google search for "Construct2 mysql database" to find tutorials.

We use rex_hash to parse JSON state data, but I think the native Construct Dictionary object might work too.

Other valuable search terms:
php api tutorial -rest -soap
php prepared statement mysql
http get api parameters values
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,415
Reputation: 4,824

Post » Mon Sep 21, 2015 9:32 pm

Okay, I'll find about it.

Thanks for your help.
B
4
Posts: 5
Reputation: 210


Return to How do I....?

Who is online

Users browsing this forum: marcinkowski, Shenkai the ssj and 25 guests