Loading arrays from spreadsheets, .xml or .csv

New releases and general discussions.

Post » Tue Jan 11, 2011 7:25 am

Hey everyone.
I'm been somewhat of a long term user of clickteam products, and I'm just about convinced to make the switch to construct. Using MMF2, there is a dynamic array extension that allows you to load an array from a .csv file, as well as a user that created a program to turn .xml files into a 3D array. I was just wondering if anything like that existed with construct?

Also, a bonus question, has the ability to change controls at runtime been implemented as of yet?

Other than that, I am very pleased by what I'm seeing so far, honestly it trumps MMF2 on most of the issues I've had with it so far.
B
2
S
1
G
1
Posts: 38
Reputation: 676

Post » Tue Jan 11, 2011 8:43 am

There's no plug made for that specifically, but if you can open it in notepad you can get the data with the Text Manipulator object.
The wiki has some info on expressions using text as well.
[url:3kzatsvy]http://sourceforge.net/apps/mediawiki/construct/index.php?title=System_Expressions[/url:3kzatsvy]

Also there are a couple of unfinished plugs for changing controls
sglors has one
[url:3kzatsvy]http://www.scirra.com/forum/viewtopic.php?f=33&t=7511[/url:3kzatsvy]
And lucid has one floating around somewhere.
Image Image
B
161
S
48
G
89
Posts: 7,347
Reputation: 66,249

Post » Tue Jan 11, 2011 6:13 pm

Thanks, that should get me a push in the right direction! It's a shame that neither clickteam or scirra has come up with a way to just 'edit' an array in the editor. But either way, I should be able to make due. Thanks again!
B
2
S
1
G
1
Posts: 38
Reputation: 676

Post » Tue Jan 14, 2014 2:34 pm

Hey @Horrendous Games @newt this might help:
This is a basic example of loading in CSV data into an array. capx

The Idea: The user types in a date from the 'DATE' column, eg.'1 Jan 1942'. The programm will then bring up a fact and load the associated image from a URL. Iv added a randomise button that uses the array to randomise a URL.



My Process: I made a spreadsheet via google docs, downlaoded it as a CSV file and then copied the CSV spreadsheet data and pasted it into the CSV plugin (you probably can load in the CSV doc instead of pasting data into C2)

Iv made a primitive search feature that works but it will mean I would have to do everything manually.

Would you guys happen to know how to look up one of the facts by searching a date in the text box?

Is the best way to load the 3 columns of data into the Array and write an expression in the Text Box with the logic of:
When a "DATE" is detected in the Array:
> Sprite loads image from "URL" index of array.
> Text loads "FACT" from index of array.
B
15
S
6
G
3
Posts: 87
Reputation: 4,304

Post » Tue Jan 14, 2014 2:44 pm

@NECROKRIEG

Why have you responded to a 3 year old thread in the Construct Classic section, with an answer for Construct 2?
If your vision so exceeds your ability, then look to something closer.
Moderator
B
120
S
28
G
68
Posts: 4,840
Reputation: 48,281

Post » Tue Jan 14, 2014 2:48 pm

@zenox98 woops. Didnt realise the age. The thread seemed relevant as it was among more recent posts in my search. I'll re-post in How Do I. Had no idea this is a CC post

Post Move HereNECROKRIEG2014-01-14 15:45:12
B
15
S
6
G
3
Posts: 87
Reputation: 4,304


Return to Construct Classic Discussion

Who is online

Users browsing this forum: No registered users and 0 guests