Hello,
I have been enjoying Construct on a dozen of small games and I wanted to get to the next level but find myself in front of a wall that no tutorial so far was able to remove.
I am working on an UI base management game where you can build production units (a farm for example) and then produce something (vegetables for example) using this production unit. It is possible in my game to have several instance of the same production unit available therefore same production (vegetable) from 2 or more similar unit can run at the same time. Since my game is 100% UI based I call the same layout for all similar production units.
Producing through a unit takes time and also yield a result (in that case vegetables). Not being too familiar with data management I looked around and dynamically populating an array seemed like the best solution. Sadly I was unable so far to populate it the way I want (Production name, time to completion, yield) a bit like that:
(note that since my game is time based, you have X in game days to complete it, the time to completion is a calculation of 2 var (remaining days - vegetable production time) that return a date compared to the current date)
Vegetables 350 15000
Vegetables 350 15000
Wheat 346 6000
Inserting data in the array with this format is where I am currently blocked. I will also need later to check the date, transfer the yield (with its type) into inventory and then destroy the finished line in the array.
If anyone could help me understand a bit better how to populate an array dynamically without a set size and using the At() expression (since it s dynamic) I ll be more than grateful.
Thanks!