Arrays and Collision Woes

Get help using Construct 2

Post » Fri Feb 08, 2013 4:39 pm

So in my game I'm planning on having a bunch of different weapons that share different statistics, speed, inaccuracy, and so-forth. Because of collision slowdown problems I had I've been forced to make one weapon object for every team (kind of bad because I'd like to have an arbitrary number of teams but it works for now). But to set the proper bullet properties/behaviors for this object each time I create it I need some way to store stats in an array.

But there's no way to set an array's values easily! You can't do it in the layout and the only way to do it in the event editor is with a million set XY actions that aren't the most readable things! There are external data storage options from XML/webstorage/ajax or JSON (for development) but honestly they seem unnecessarily complicated for what I want to do: have a data set of reference values that never changes that I can easily access in the editor. It feels like it defeats the purposes of a .capx if I have to have another file somewhere on a server just so that I can make editing my array, something that's just a list of lists of numbers, easy.

Is there really no other solution?Phyvo2013-02-08 16:40:21
B
6
S
1
Posts: 40
Reputation: 917

Post » Fri Feb 08, 2013 8:01 pm

You might want to try your luck with a CSV and string tokenization. Edit your CSV with a spreadsheet app then paste the text in a global variable or what not. Although I'm not sure of what is the characters limit of a variable, it's probably more than enough for your needs ! (unless you were serious with your "million" )Magistross2013-02-08 20:03:01
B
46
S
17
G
18
Posts: 847
Reputation: 13,802

Post » Fri Feb 08, 2013 11:13 pm

Haha no that million was a bit of hyperbole. But what's a CSV? Are you talking about the plug-in by rex (http://www.scirra.com/forum/plugin-csv-csv2array_topic46096_page1.html)? I don't recall reading anything about csv in the manual.

edit:

After tootling around quite a bit, I'm going to use the CSV->array converter provided by Rex to set up my arrays by making CSVs with a spreadsheet, copying the string into Construct and then importing them (or copying the string to text and opening with my spreadsheet program to edit them. It's probably possible to do a similar thing sans-plug-in but with the plug-in there I'll use it for convenience as I haven't found any compatibility problems.Phyvo2013-02-09 04:01:49
B
6
S
1
Posts: 40
Reputation: 917


Return to How do I....?

Who is online

Users browsing this forum: Artpunk, currypuff, DemantDigitalArt, Magistross and 27 guests