Hello
function UpdateQuestProgress(args) { var QuestDetails = { LevelID : args.LevelID, DifficultyCompleted : args.DifficultyCompleted }; var QuestData = { args.LevelName : QuestDetails }; var dataupdate = {}; dataupdate["QuestLevelProgress"] =JSON.stringify(QuestData); var updateDataRequest = { PlayFabId: currentPlayerId, Data: dataupdate, Permission: "Public" }; server.UpdateUserReadOnlyData(updateDataRequest); return true; }
just wondering how i would get the args.LevelName to properly take as LevelName actually outputs "LevelName" I want the actual level name
also it looks like it overwrites data that already exists ( i can get around this by pulling the data then taking this on or something but is there any api calls that will Add an array to the userreadonlydata value if its not unique and itll update values if they are the same or something? otherwise i am going to have to extract the data run through it compare and such which means i am probably going to switch to a different quest system if thats the case one which is most likely point based or something where i can just increment.
for instance im trying to
key = questlevelprogress
value = {
"the giant" { completeddifficulty : 1, levelid 0}
}
and tack on
{"the rat" { completeddifficulty : 1, levelid 1} }
so
value = {
"the giant" { completeddifficulty : 1, levelid 0}, "the rat" { completeddifficulty : 1, levelid 1}
}
thanks for the help!