I need to define a value, add to it upon a successful attempt, and then save that value permanently, through a script. I do not want to use game variables, as that would take up most of the variable space.
It also needs to keep track of values for individualized nodes. There are going to be 100+ per map.
Generalized collections are best kept in hash collection objects, with designated tasks and specific calls you have allocated for them. You can create one of these said objects with the correct parameters, and then call it using your event editor conditional script eval.
I've written up a brief example of this, hopefully you can make use of it.
#Generic Example:class Switch_Manager # populate with ignored values @ignored_switches = [ 25 ] def initialize @internal_list = {} @map_id = 0 end def map_id=(new_map_id) @map_id = new_map_id end def map_id return @map_id end def []=(key_position, change) if(key_position >= 0 && @ignored_switches.include?(key_position) && @map_id != nil && @map_id > 0) @internal_list[@map_id] = {} if @internal_list[@map_id].nil? @internal_list[@map_id][key_position] = change end end def [](key_position) return false if(@internal_list[@map_id].nil? return false if(@internal_list[@map_id][key_position].nil? return @internal_list[@map_id][key_position] end end$switch_manager = Switch_Manager.new#$switch_manager.set_map_id = $game_map.map_id$switch_manager.get_map_id$switch_manager.set_map_id = 1#$switch_manager[switch_id] = value$switch_manager[23] = true$switch_manager[24] = 27$switch_manager[25] = false
The output should look something like this. @internal_list = { 1 => { 23 => false 24 => 17 25 => nil } }
Would that carry over the values even if one exited the game, after saving?
Might be easier to just find you something more beginner friendly.
Or you could explain it fully to me? =P
And would it be possible to use a variable to define the key_position? Instead of having switches for every node, or am I reading that wrong?
Well that thing works like, you add items into it using the $switch_manager[key] = value, its using the hash array model.
Basically if you understand the hash array model and how to use the hash array model, you can use this object fairly easily.
Step 1: Set your map id.
$switch_manager.set_map_id = $game_map.map_id
ONLY call this, if you're on a map that exists, otherwise the $game_map object does not exist and you'll receive a nil exception error. I suggest having your nodes as common events, and it just automatically sets the map id before you mine the node USING the common event. This would condense any sort of map clicky clicky event paste change grinding requirements, into the basic changes of I want this spot here. You just put the generic spots down, and the spots delegate themselves using common events.
Step 2: Mining completes, set switch to false.
$switch_manager[integer_value] = false
If false switch, mining is done, if mining is done, spot switches pages to another page with no bounding box or graphic.
Step 3: Profit.
I've modified the base object's code.
That's very descriptive and useful, but I want each node to be able to be gathered at least 20 times, and it needs to save the values of each node individually. Any way to accomplish this?
Sorry I have a big day today, I'll stop by later tonight to see how you're doing.
Okay. I'll keep trying and researching.