Hey guys,
I'm a rank amateur when it comes to Javascript, but I'm slowly learning. I'm trying to create a Quest System. Basically its an array that will update as the player goes through the game.
this is what I have so far this is the JSON file.
this is the JS file
So I want to end up having these display in a Picture Menu as the details of the quest. I may have to add more Items to the array as I go, but for now I'm just concentrating on how to add more lines to this. I've learned about the .push function but I'm not sure how to use that to update the JSON. Can anyone help?
I'm a rank amateur when it comes to Javascript, but I'm slowly learning. I'm trying to create a Quest System. Basically its an array that will update as the player goes through the game.
this is what I have so far this is the JSON file.
Code:
[
null,
{"id":1,"name":"","description":"","iconIndex":0,"reward1":"","reward2":"","reward3":""}
]
this is the JS file
Code:
var $dataQuests = null;
DataManager._databaseFiles.push({
name: '$dataQuests',
src: 'Quest.json'
});
function QuestManager() {
throw new Error('this is a static class');
};
QuestManager.data = function(id) {
return $dataQuests[id];
};
So I want to end up having these display in a Picture Menu as the details of the quest. I may have to add more Items to the array as I go, but for now I'm just concentrating on how to add more lines to this. I've learned about the .push function but I'm not sure how to use that to update the JSON. Can anyone help?