is there any way to retrieve object X from a collection of objects through the correct object_id?
whatever the object, the object_id is always unique, right?
can I bring up whatever object corresponds to a specific object_id which I got from the very same object itself?
I made a hash unique by filling it up with object_ids as its keys..... now I want to print out the name of the actors instead of the ids.
can I change the keys on the fly?
this:
hash.each_pair{|k, v| k = $game_party.members.find {|a| a.object_id == k}.name}
still prints out the hash as initially filled: {object_id => result}
I know I can use the battler as the key, but if I print it out for debugging, it prints out the object battler, which takes a lot to debug!
and I can't use the battler's name as a key because there could be duplicate names that would mess up the rest of the code, hence why I went with object_ids
whatever the object, the object_id is always unique, right?
can I bring up whatever object corresponds to a specific object_id which I got from the very same object itself?
I made a hash unique by filling it up with object_ids as its keys..... now I want to print out the name of the actors instead of the ids.
can I change the keys on the fly?
this:
hash.each_pair{|k, v| k = $game_party.members.find {|a| a.object_id == k}.name}
still prints out the hash as initially filled: {object_id => result}
I know I can use the battler as the key, but if I print it out for debugging, it prints out the object battler, which takes a lot to debug!
and I can't use the battler's name as a key because there could be duplicate names that would mess up the rest of the code, hence why I went with object_ids