Good day. I'm trying to make "Diaries" you can collect in a game. Just little Texts basically.
However, I've been running into some issues trying to "Collect" said Diaries.
This is actually my second attempt trying to do this, as the first had too many issues that I wasn't able to track down.
# for now testing with 4 Diaries
export(Array)var Diaries = [false, false, false, false]
This is the backbone of this, holding the "Diaries" Array to store which Diaries
you've collected. Later it will also be used to store and save other data.
# for testing
# gets correct Position in the Array
var Arraypos = Diary - 1
Saves.Diaries[Arraypos] = true
This contains the function DiaryCollect(Diary). Which will be called once the player collects a Diary. (Diary) is just the number of the Diary. Arraypos will be the actual position in the Array, as an Array starts with 0.
var DiaryBase = preload("res://src/Resources/DiaryBase.gd")
LevelBase is currently just an empty script, will be used later. I tried to preload DiaryBase and use the _ready() function in *DiaryBase.gd* to simulate collecting a Diary, however it didn't work.
I am very desperate to finally get some help on this. I've tried using a static function in DiaryBase.gd - but I need the Diaries variable in there.
I've tried Autoloading Saves.gd to access it easier - but it didn't work as I intented.
I've looked all around for already existing help - yet found nothing useful.
If any additional Info is required, I'm more than willing to provide it.
Thank you for reading, and also thanks in advance for potentially helping.
BTW, I am a beginner with Godot and much of Game Developing and Coding in general.