Preloaded arrays

Get help using Construct 2

Post » Tue Feb 14, 2017 12:55 am

Here's an example of doing parsing of a custom format:
https://dl.dropboxusercontent.com/u/542 ... ormat.capx

The advantage is you can customize it any way you'd like to make creating the data file easier. For example this one does without the xml tags or the need for all the comments and symbols of json. Also you can omit unused parameters.
Code: Select all
weapon
   id 0
   name sting
   perk glows when orcs are near
   damage 100
weapon
   id 2
   name rusty sword
   damage 10


To each his own though. Personally I love creating something like this and dislike using xml or json unless I have to. Another option could be to make your own editor to set the array data.
B
94
S
33
G
118
Posts: 5,394
Reputation: 75,849

Post » Tue Feb 14, 2017 2:01 am

nice one @R0J0hound I could definitely use something like that... easier to edit the .txt file

I;d rather use a TAB instead of 3 spaces, is there a way in C2 to reference the ascii char of a tab? x09 or something?
B
100
S
33
G
16
Posts: 1,204
Reputation: 16,865

Post » Tue Feb 14, 2017 2:36 am

@jobel
To use tab I usually copy paste it over from notepad. I guess you could also javascript with the browser object too.

The event 8 condition would be changed to:
left(curline, 1) = tab

And the 3's in it's actions would become 1's.
B
94
S
33
G
118
Posts: 5,394
Reputation: 75,849

Post » Tue Feb 14, 2017 12:58 pm

R0J0hound wrote:Here's an example of doing parsing of a custom format:
https://dl.dropboxusercontent.com/u/542 ... ormat.capx

The advantage is you can customize it any way you'd like to make creating the data file easier. For example this one does without the xml tags or the need for all the comments and symbols of json. Also you can omit unused parameters.
Code: Select all
weapon
   id 0
   name sting
   perk glows when orcs are near
   damage 100
weapon
   id 2
   name rusty sword
   damage 10


To each his own though. Personally I love creating something like this and dislike using xml or json unless I have to. Another option could be to make your own editor to set the array data.

This is THE BEST! I can't thank you enough for this Rojo...
B
9
S
3
Posts: 153
Reputation: 1,272

Post » Thu May 04, 2017 3:15 pm

R0J0hound wrote:Here's an example of doing parsing of a custom format:
https://dl.dropboxusercontent.com/u/542 ... ormat.capx


Hello,

Does anyone know where I can find this file? The link does not seem to work.

Thanks
B
5
S
1
Posts: 11
Reputation: 395

Post » Thu May 04, 2017 4:57 pm

B
94
S
33
G
118
Posts: 5,394
Reputation: 75,849

Previous

Return to How do I....?

Who is online

Users browsing this forum: dop2000 and 7 guests