minitaba
Member
Hello guys
I am currently making some kind of Life sim / RPG game. It also involves growing different plants and harvesting them.
I followed a lot of tutorials before and now trying to make my own code for some mechanics because I cant manage to find any information about it, but now i need some help.
A tutorial i have seen showed me how to make growing plants, but the series stopped before making them harvestable. No problem, i needes some hours (way too many haha) to make it possible and now i can harvest my crops.
Now i developed a bug which occurs when leaving the Room.
Example:
---I have 3 plants, all full grown. i harvest all of them, leave the room, everything works fine
---I have 3 plants, harvest 1 and leave the room, i get this error:
Unable to find instance for object index 100246
at gml_Object_crops_Other_5 (line 22) - ds_crops_data[# 2, slot] = inst.cropType;
I am pretty sure I am missing an update-system for the datastructure before the "room end" event safes my plants data in the ds_crops_data.
I already tried to copy the saving code from the "room end" and fitting it after the harvest function, but i had no luck with that.
I am not very good with datastructure I have to admit. I understand the basics behind them but the whole accessing and overwriting is a little complicated and i cant find any good documentation tbh.
Is there any good way to manage this?
I am also not too sure which parts of the code i should post because its pretty much code haha.
Thanks in advance
Best regards
I am currently making some kind of Life sim / RPG game. It also involves growing different plants and harvesting them.
I followed a lot of tutorials before and now trying to make my own code for some mechanics because I cant manage to find any information about it, but now i need some help.
A tutorial i have seen showed me how to make growing plants, but the series stopped before making them harvestable. No problem, i needes some hours (way too many haha) to make it possible and now i can harvest my crops.
Now i developed a bug which occurs when leaving the Room.
Example:
---I have 3 plants, all full grown. i harvest all of them, leave the room, everything works fine
---I have 3 plants, harvest 1 and leave the room, i get this error:
Unable to find instance for object index 100246
at gml_Object_crops_Other_5 (line 22) - ds_crops_data[# 2, slot] = inst.cropType;
I am pretty sure I am missing an update-system for the datastructure before the "room end" event safes my plants data in the ds_crops_data.
I already tried to copy the saving code from the "room end" and fitting it after the harvest function, but i had no luck with that.
I am not very good with datastructure I have to admit. I understand the basics behind them but the whole accessing and overwriting is a little complicated and i cant find any good documentation tbh.
Is there any good way to manage this?
I am also not too sure which parts of the code i should post because its pretty much code haha.
Thanks in advance
Best regards