Dealing with lots of stats/rpg stuff

Discussion and feedback on Construct 2

Post » Sun May 01, 2016 6:21 am

I've had some success with importing a json into a dictionary object - declaring the variables in a text editor is then much easier than using events.... And, if you name your keys like "weapon0", "weapon1" etc then you can loop through them during the game using string functions.
A big fan of JavaScript.
B
74
S
20
G
71
Posts: 2,230
Reputation: 44,892

Post » Sun May 01, 2016 6:42 am

Would someone like to show an example of the text files you use for handling data? Im just curious in seeing how you keep the data organized there, and how the data is read in C2.
B
13
S
3
Posts: 13
Reputation: 808

Post » Sun May 01, 2016 7:53 am

Kossad wrote:Would someone like to show an example of the text files you use for handling data? Im just curious in seeing how you keep the data organized there, and how the data is read in C2.


Just open any excel sheet and you already figured it out how I managed all my data and their maintenance.

Any time I wish to import it to C2, I do eight important steps:
1. Toss all data that I wanted into a new excel sheet.
2. Do a Find and Replace for commas.
3. Save as MS-DOS CSV
4. Do a Find and Replace for CSV commas. (I use this | as replacement)
5. Do a Find and Replace back for data commas (revert them back to commas).
6. Create a new array for it if the data type is new.
7. Import the CSV and link it up to my function that parse through AJAX.
8. Create a new section in that function to toss all data from AJAX parsing to the array.


And there, it is done. the data is available for use through the game.
You can skip step 6,7 and 8 and just copy paste the new data straight into the imported file when you updated the data in your excel sheets.
B
36
S
18
G
11
Posts: 248
Reputation: 8,694

Post » Sun May 01, 2016 10:02 am

Sethmaster wrote:
Kossad wrote:Would someone like to show an example of the text files you use for handling data? Im just curious in seeing how you keep the data organized there, and how the data is read in C2.
Any time I wish to import it to C2, I do eight important steps:
1. Toss all data that I wanted into a new excel sheet.
2. Do a Find and Replace for commas.
3. Save as MS-DOS CSV
4. Do a Find and Replace for CSV commas. (I use this | as replacement)
5. Do a Find and Replace back for data commas (revert them back to commas).
6. Create a new array for it if the data type is new.
7. Import the CSV and link it up to my function that parse through AJAX.
8. Create a new section in that function to toss all data from AJAX parsing to the array.


Thanks for a detailed answer! I'll test this and check some related tutorials aswell.
B
13
S
3
Posts: 13
Reputation: 808

Post » Sun May 01, 2016 4:18 pm

@Colludium I had a friend who created an external program to unzip construct 2 save files and then parse out certain information. When making a game I could do things like put z_Z in text fields, variable names, etc, and then pass it off to my friend who would then automatically inject the desired info in. It was crazy because you could make a game have 70 different languages in about 2 seconds for example.

I thought I was a good programmer, but this friend made me feel woefully incompetent.
Image
B
33
S
11
G
2
Posts: 564
Reputation: 5,153

Post » Sun May 01, 2016 4:18 pm

I think what I am getting at is that automation is super helpful.
Image
B
33
S
11
G
2
Posts: 564
Reputation: 5,153

Post » Sun May 01, 2016 4:38 pm

@ruskul, I agree. This is one of those times where having scripts inside c2 could be really useful. The only negative side to loading variables from a csv or json is that you might have to contend with cheating by somehow checking the integrity of the contents...
A big fan of JavaScript.
B
74
S
20
G
71
Posts: 2,230
Reputation: 44,892

Post » Sun May 01, 2016 5:01 pm

@Colludium - I never thought about that but it is a good point.
Image
B
33
S
11
G
2
Posts: 564
Reputation: 5,153

Previous

Return to Construct 2 General

Who is online

Users browsing this forum: DjPoke and 15 guests