Relative Content

Tag Archive for pythonsetattrrenpy

setattr doesn’t seem to have an effect when setting multi-level attributes

I’m writing a mod for a Ren’Py game that includes possibility to edit game’s variables’ values (“cheating”). Variables in the game include different ones from simple booleans to pretty complex ones (e.g simple_variable, obj.attr, obj.attr_a(“some_id”).attr_b). Here’s a function I’m using to set new values to the variables/attributes (var_name is variable’s name as a string and new_val is a value I’m trying to set):