6 years ago
Need some help with python [solved]
Can someone tell me what's wrong with my code?
I am trying to get all the objects on the lot with the specific tuning id, but the get_objects_of_def_id_gen function doesn't seem to be returning anything, I don't get any last exceptions or anything, and I am 100% sure that I inputted the tuning id's correctly
this is how the original function looks
I am trying to get all the objects on the lot with the specific tuning id, but the get_objects_of_def_id_gen function doesn't seem to be returning anything, I don't get any last exceptions or anything, and I am 100% sure that I inputted the tuning id's correctly
import services
import sims4.commands
@sims4.commands.Command('GetObjects', command_type=sims4.commands.CommandType.Live)
def GetObjectsTesting(_connection=None):
output = sims4.commands.CheatOutput(_connection)
definition_ids =
object_manager = services.object_manager()
list_of_Objects = object_manager.get_objects_of_def_id_gen(*definition_ids)
output('\n'.join(map(str, list_of_Objects)))
this is how the original function looks
def get_objects_of_def_id_gen(self, *definition_ids):
for obj in self._objects.values():
if any(obj.definition.id == d_id for d_id in definition_ids):
yield obj