hughrock18
Member
Hello fellow devs!
I am building a complicated save system (will be so much fun when done), and part of my system relies on the use of ds_list_copy (ex. copy the "char_data_list" to "var _temp_list". Grab one of the many ds_maps held by the list. Change values of said map, and then save to "_temp_list" and replace "char_data_list" with "_temp_list" to "update" the saved information. This uses "ds_list_copy" and "ds_list_replace" functions to clarify. I don't know if there's a difference, but I tend to avoid using the shorthand "blahblah[? "key"] = value" stuff.
Now the questions (hoping I've made sense so far):
1. When i set up "char_data_list" and the inclusive ds_maps, i used "ds_list_mark_as_map" function on each of the list positions. Now that the list has been marked (fully) as having a bunch of ds_maps, do I ever need to use the "ds_list_mark_as" function when "ds_list_replace"-ing anything within said list?
2. I may have missed this one in the manual to be honest. If i were to define the 3rd position (ds_list[| 2]) how does gamemaker deal with the 1st and 2nd positions? I imagine they are also made, but filled with a default value. Since we're already talking about ds_lists, what is that default value, and (in that same example) if I were to grab the value of the 4th position (hasn't been previously defined) would I get an error, or would gms add the 4th position and fill it with a default value (like when opening a file that doesn't exist yet).
I really appreciate any information.
I am building a complicated save system (will be so much fun when done), and part of my system relies on the use of ds_list_copy (ex. copy the "char_data_list" to "var _temp_list". Grab one of the many ds_maps held by the list. Change values of said map, and then save to "_temp_list" and replace "char_data_list" with "_temp_list" to "update" the saved information. This uses "ds_list_copy" and "ds_list_replace" functions to clarify. I don't know if there's a difference, but I tend to avoid using the shorthand "blahblah[? "key"] = value" stuff.
Now the questions (hoping I've made sense so far):
1. When i set up "char_data_list" and the inclusive ds_maps, i used "ds_list_mark_as_map" function on each of the list positions. Now that the list has been marked (fully) as having a bunch of ds_maps, do I ever need to use the "ds_list_mark_as" function when "ds_list_replace"-ing anything within said list?
2.
I really appreciate any information.
Last edited: