DB to Array View

Get help using Construct 2

Post » Wed Jun 19, 2013 10:45 pm

I am struggling bad to wrap my head around using arrays in C2. I am a database programmer and anything I build I put the data in a db and can eaily loop it to get data or hit a record direct. Can someone help me relate that in Array terms?

What I am looking to do I think is dead simple, but my brain is fighting. Store the below values so I can access them later:

Name   Type    Buff
Sword Weapon   1
Helm   Armor    0

Three values for an Item, two items total. How does this look in an array?

I was thinking Array Width-3, Height-2, but for the life of me no mater how I build/store and retrieve it, it dosent come out right.

Tahnks
B
21
S
7
G
1
Posts: 128
Reputation: 3,076

Post » Thu Jun 20, 2013 12:59 am

You have 3 columns and 3 rows, so you need a (3,3,1) sized array.

The default height is 1, it can't be 0 or the array would always be empty, so if you want to add two to the height, that makes 3.
B
27
S
8
G
8
Posts: 903
Reputation: 8,452


Return to How do I....?

Who is online

Users browsing this forum: BobOfAMillion, jhjconstruct and 8 guests