schema.add_field('name', label='name', type=GsiFieldVisualizers.STRING, width=3) schema.add_field('x', label='x', type=GsiFieldVisualizers.FLOAT, width=2) schema.add_field('y', label='y', type=GsiFieldVisualizers.FLOAT, width=2) schema.add_field('z', label='z', type=GsiFieldVisualizers.FLOAT, width=2) schema.add_field('lot_id', label='lot_id', type=GsiFieldVisualizers.INT, width=3) schema.add_field('tags', label='tags', type=GsiFieldVisualizers.STRING, width=4) schema.add_view_cheat('debugvis.spawn_points.start', label='Start Visualization') schema.add_view_cheat('debugvis.spawn_points.stop', label='Stop Visualization') with schema.add_cheat('camera.focus_on_position', label='Focus', dbl_click=True) as cheat: cheat.add_token_param('x') cheat.add_token_param('y') cheat.add_token_param('z') @GsiHandler('spawn_point', schema) def generate_spawn_point_data(*args, zone_id: int = None, **kwargs): data = [] zone = services.current_zone() if zone is None: return data
type=GsiFieldVisualizers.FLOAT, width=1) sub_schema.add_field('status', label='Status', width=1) sub_schema.add_field('duration', label='Duration', type=GsiFieldVisualizers.FLOAT, width=2) sub_schema.add_field('event_cls', label='Event Class', width=3) sub_schema.add_field('event_type', label='Event Type', width=3) sub_schema.add_field('tag', label='Tag', type=GsiFieldVisualizers.INT, width=1) sub_schema.add_field('executed', label='Executed', width=1) route_event_archive_schema.add_view_cheat('route_events.toggle_gsi_update_log', label='Toggle Update Log', dbl_click=True, refresh_view=False) archiver = GameplayArchiver('RouteEvents', route_event_archive_schema, add_to_archive_enable_functions=True) def gsi_fill_route_event_data(route_event, path_log, additional_data=None): event_dict = { 'time': route_event.time, 'duration': route_event.duration, 'event_cls': str(type(route_event)), 'event_type': str(type(route_event.event_data)), 'tag': route_event.tag } if additional_data is not None:
sim_info_schema.add_field('simId', label='Sim ID', width=1, unique_field=True) sim_info_schema.add_field('householdId', label='Household ID', width=1) sim_info_schema.add_field('firstName', label='First Name', width=1) sim_info_schema.add_field('lastName', label='Last Name', width=1) sim_info_schema.add_field('fullName', label='Full Name', hidden=True) sim_info_schema.add_field('gender', label='Gender', width=1) sim_info_schema.add_field('age', label='Age', width=1) sim_info_schema.add_field('ageProgress', label='Age Progress', width=1) sim_info_schema.add_field('ageTimers', label='Age Timers', width=2) sim_info_schema.add_field('householdFunds', label='Household Funds', width=1) sim_info_schema.add_field('personalFunds', label='Personal Funds', width=1) sim_info_schema.add_field('active_mood', label='Active Mood', width=1) sim_info_schema.add_field('on_active_lot', label='On Active Lot', width=1) sim_info_schema.add_field('away_action', label='Away Action', width=1) sim_info_schema.add_field('creation_source', label='Creation Source', width=1) with sim_info_schema.add_view_cheat('sims.focus_camera_on_sim', label='Focus Camera', dbl_click=True) as cheat: cheat.add_token_param('simId') with sim_info_schema.add_has_many('walkstyles', GsiGridSchema, label='Walkstyles') as sub_schema: sub_schema.add_field('walkstyle_priority', label='Priority', type=GsiFieldVisualizers.INT, width=0.5) sub_schema.add_field('walkstyle_type', label='Style', width=1) sub_schema.add_field('walkstyle_is_current', label='Is Current', width=0.5) sub_schema.add_field('walkstyle_is_default', label='Is Default', width=0.5) with sim_info_schema.add_has_many('pregnancy', GsiGridSchema, label='Pregnancy') as sub_schema: sub_schema.add_field('pregnancy_field_name', label='Property') sub_schema.add_field('pregnancy_field_value', label='Value') @GsiHandler('sim_infos', sim_info_schema) def generate_sim_info_data(*args, zone_id:int=None, **kwargs): sim_info_data = [] sim_info_manager = services.sim_info_manager(zone_id=zone_id) if sim_info_manager is None:
portal_schema = GsiGridSchema(label='Portals') portal_schema.add_field('object_id', label='Object Id', width=1, unique_field=True) portal_schema.add_field('portal_provider', label='Portal Provider', width=3) portal_schema.add_field('definition', label='Definition', width=3) portal_schema.add_field('loc_x', label='X', width=1) portal_schema.add_field('loc_y', label='Y', width=1) portal_schema.add_field('loc_z', label='Z', width=1) portal_schema.add_field('on_active_lot', label='On Active Lot', width=1) portal_schema.add_field('num_sims_cost_override', label='Sim Cost Overrides', width=2) with portal_schema.add_view_cheat('objects.focus_camera_on_object', label='Focus On Object') as cheat: cheat.add_token_param('object_id') portal_schema.add_view_cheat('debugvis.portals.start', label='Draw All Portals') with portal_schema.add_view_cheat('debugvis.portals.start', label='Draw Object Portals') as cheat: cheat.add_token_param('object_id') with portal_schema.add_view_cheat('debugvis.portals.start', label='Draw Portal Pair') as cheat: cheat.add_token_param('object_id') cheat.add_token_param('there_id') cheat.add_token_param('back_id') with portal_schema.add_view_cheat('camera.focus_on_position', label='Focus On Portal Pair') as cheat: cheat.add_token_param('object_id') portal_schema.add_view_cheat('debugvis.portals.stop', label='Remove All Vis')
from sims4.gsi.dispatcher import GsiHandler from sims4.gsi.schema import GsiGridSchema, GsiFieldVisualizers import services import sims4.resources sim_whim_schema = GsiGridSchema(label='Whims/Whims Current', sim_specific=True) sim_whim_schema.add_field('sim_id', label='Sim ID', hidden=True) sim_whim_schema.add_field('whim', label='Whim', unique_field=True, width=3) sim_whim_schema.add_field('instance', label='Instance', width=3) sim_whim_schema.add_field('whimset', label='Whimset', width=3) sim_whim_schema.add_field('target', label='Target', width=2) sim_whim_schema.add_field('value', label='Value', width=1, type=GsiFieldVisualizers.INT) with sim_whim_schema.add_view_cheat('sims.whims_complete_whim', label='Complete Whim', dbl_click=True) as cheat: cheat.add_token_param('whim') cheat.add_token_param('sim_id') @GsiHandler('sim_whim_view', sim_whim_schema) def generate_sim_whim_view_data(sim_id: int = None): whim_view_data = [] sim_info_manager = services.sim_info_manager() if sim_info_manager is not None: for sim_info in sim_info_manager.objects: while sim_info.sim_id == sim_id: whim_tracker = sim_info._whim_tracker while True: for whim in whim_tracker.get_goal_info():
data['object_slots'].append(sub_data) slot_type_data.append(data) return slot_type_data buff_schema = GsiGridSchema(label='Tuning/Buffs') buff_schema.add_field('buff_name', label='Name', unique_field=True) buff_schema.add_field('guid', label='Guid') buff_schema.add_field('visible', label='Visible') buff_schema.add_field('sim_has_buff', label='Buff Exists on Current Sim') with buff_schema.add_has_many('sims_with_buff', GsiGridSchema, label='Sims with Buff') as sub_schema: sub_schema.add_field('id', label='Sim ID') sub_schema.add_field('name', label='Sim Name') with buff_schema.add_view_cheat( 'sims.add_buff', label='Add Selected Buff to Current Sim') as cheat: cheat.add_token_param('buff_name') with buff_schema.add_view_cheat( 'sims.remove_buff', label='Remove Selected Buff from Current Sim') as cheat: cheat.add_token_param('buff_name') with buff_schema.add_view_cheat( 'sims.remove_buff_from_all', label='Remove Selected Buff from All Sims') as cheat: cheat.add_token_param('buff_name') @GsiHandler('buff_handler', buff_schema) def generate_buff_data(*args, zone_id: int = None, sim_id: int = None,
label='Situation ID', type=GsiFieldVisualizers.INT) with sim_career_schema.add_has_many('career_levels', GsiGridSchema, label='Levels') as sub_schema: sub_schema.add_field('name', label='Name') sub_schema.add_field('simoleons', label='Simoleons/Hr') sub_schema.add_field('fired_lvl', label='Fire Lvl') sub_schema.add_field('demotion_lvl', label='Demotion Lvl') sub_schema.add_field('promote_lvl', label='Promote Lvl') with sim_career_schema.add_has_many('objectives', GsiGridSchema, label='Current Objectives') as sub_schema: sub_schema.add_field('objective', label='Objective') sub_schema.add_field('is_complete', label='Complete?') with sim_career_schema.add_view_cheat('careers.promote', label='Promote Sim') as cheat: cheat.add_token_param('career_uid') cheat.add_token_param('sim_id') with sim_career_schema.add_view_cheat('careers.demote', label='Demote Sim') as cheat: cheat.add_token_param('career_uid') cheat.add_token_param('sim_id') with sim_career_schema.add_view_cheat('careers.remove_career', label='Remove Career') as cheat: cheat.add_token_param('career_uid') cheat.add_token_param('sim_id') with sim_career_schema.add_view_cheat('careers.trigger_optional_situation', label='Trigger Situation') as cheat: cheat.add_token_param('career_uid') cheat.add_token_param('sim_id') with sim_career_schema.add_view_cheat('careers.add_performance',
width=1) decoratable_lots_schema.add_field('preset', label='Preset Used', width=3) decoratable_lots_schema.add_field('customized', label='Customized', width=1) decoratable_lots_schema.add_field('current_lot', label='Current Lot', width=1) def get_presets(): instance_manager = services.get_instance_manager( sims4.resources.Types.LOT_DECORATION_PRESET) if instance_manager.all_instances_loaded: return [cls.__name__ for cls in instance_manager.types.values()] return [] with decoratable_lots_schema.add_view_cheat( 'lot_decorations.apply_preset_to_neighbors', label='Apply Preset to Neighbors') as apply_neighborhood_decorations: apply_neighborhood_decorations.add_token_param( 'preset', dynamic_token_fn=get_presets) with decoratable_lots_schema.add_view_cheat( 'lot_decorations.apply_preset_to_zone', label='Apply Preset to Zone') as apply_zone_decorations: apply_zone_decorations.add_token_param('preset', dynamic_token_fn=get_presets) apply_zone_decorations.add_token_param('zone_id') with decoratable_lots_schema.add_has_many('Decorations', GsiGridSchema) as sub_schema: sub_schema.add_field('deco_location', label='Location') sub_schema.add_field('decoration', label='Decoration')
from aspirations.aspiration_tuning import Aspiration from sims4.gsi.dispatcher import GsiHandler from sims4.gsi.schema import GsiGridSchema import aspirations.aspirations import services import sims4.resources from gsi_handlers.gameplay_archiver import GameplayArchiver aspiration_schema = GsiGridSchema(label='Aspirations', sim_specific=True) aspiration_schema.add_field('aspiration_uid', label='UId', unique_field=True) aspiration_schema.add_field('aspiration', label='Aspiration', width=3) aspiration_schema.add_field('aspiration_complete', label='Done') aspiration_schema.add_field('display_name', label='DisplayStr', hidden=True) aspiration_schema.add_field('description', label='DescStr', hidden=True) aspiration_schema.add_field('auto_select', label='Auto Select', hidden=True) aspiration_schema.add_field('simId', label='SimId', hidden=True) with aspiration_schema.add_view_cheat('aspirations.complete_aspiration', label='Complete') as cheat: cheat.add_token_param('aspiration_uid') cheat.add_token_param('simId') with aspiration_schema.add_has_many('objectives', GsiGridSchema, label='Objectives') as sub_schema: sub_schema.add_field('objective', label='Objective') sub_schema.add_field('objective_complete', label='Done') @GsiHandler('aspiration_view', aspiration_schema) def generate_aspiration_view_data(sim_id:int=None): sim_info = services.sim_info_manager().get(sim_id) aspiration_manager = services.get_instance_manager(sims4.resources.Types.ASPIRATION) all_aspirations = [] for aspiration_id in aspiration_manager.types: aspiration = aspiration_manager.get(aspiration_id) aspiration_data = {} aspiration_data['aspiration'] = str(aspiration)
sim_career_schema.add_field('next_work_time', label='Next Work') sim_career_schema.add_field('is_work_time', label='Is Work Time') sim_career_schema.add_field('currently_at_work', label='Currently At Work') sim_career_schema.add_field('attended_work', label='Attended Work') sim_career_schema.add_field('work_performance', label='Performance', type=GsiFieldVisualizers.INT) sim_career_schema.add_field('active_situation_id', label='Situation ID', type=GsiFieldVisualizers.INT) with sim_career_schema.add_has_many('career_levels', GsiGridSchema, label='Levels') as sub_schema: sub_schema.add_field('name', label='Name') sub_schema.add_field('simoleons', label='Simoleons/Hr') sub_schema.add_field('fired_lvl', label='Fire Lvl') sub_schema.add_field('demotion_lvl', label='Demotion Lvl') sub_schema.add_field('promote_lvl', label='Promote Lvl') with sim_career_schema.add_has_many('objectives', GsiGridSchema, label='Current Objectives') as sub_schema: sub_schema.add_field('objective', label='Objective') sub_schema.add_field('is_complete', label='Complete?') with sim_career_schema.add_view_cheat('careers.promote', label='Promote Sim') as cheat: cheat.add_token_param('career_uid') cheat.add_token_param('sim_id') with sim_career_schema.add_view_cheat('careers.demote', label='Demote Sim') as cheat: cheat.add_token_param('career_uid') cheat.add_token_param('sim_id') with sim_career_schema.add_view_cheat('careers.remove_career', label='Remove Career') as cheat: cheat.add_token_param('career_uid') cheat.add_token_param('sim_id') with sim_career_schema.add_view_cheat('careers.trigger_optional_situation', label='Trigger Situation') as cheat: cheat.add_token_param('career_uid') cheat.add_token_param('sim_id') with sim_career_schema.add_view_cheat('careers.add_performance', label='+50 Performance') as cheat: cheat.add_token_param('sim_id') cheat.add_static_param('50') cheat.add_token_param('career_uid')
width=1) zone_modifier_view_schema.add_field('enter_loots', label='Enter Loot Count', type=GsiFieldVisualizers.INT, width=1) zone_modifier_view_schema.add_field('exit_loots', label='Exit Loot Count', type=GsiFieldVisualizers.INT, width=1) zone_modifier_view_schema.add_field('scheduled_entries', label='Scheduled Entry Count', type=GsiFieldVisualizers.INT, width=1) zone_modifier_view_schema.add_field('hidden', label='Hidden', width=1) zone_modifier_view_schema.add_filter(FILTER_SHOW_ACTIVE_ZONE_MODIFIERS) with zone_modifier_view_schema.add_view_cheat( 'zone_modifier.add_zone_modifier', label='Add Modifier') as cheat: cheat.add_token_param('id') with zone_modifier_view_schema.add_view_cheat( 'zone_modifier.remove_zone_modifier', label='Remove Modifier') as cheat: cheat.add_token_param('id') with zone_modifier_view_schema.add_has_many('Event Tests', GsiGridSchema) as sub_schema: sub_schema.add_field('event_name', label='Event Name') sub_schema.add_field('custom_key', label='Custom Key') with zone_modifier_view_schema.add_has_many('Schedule Event Time', GsiGridSchema) as sub_schema: sub_schema.add_field('start_time', label='Start Time') sub_schema.add_field('end_time', label='End Time') with zone_modifier_view_schema.add_has_many('Architectural Objects Effects', GsiGridSchema) as sub_schema:
sub_data['bone_name'] = info_list(0) sub_data['bone_name_hash'] = info_list(1) sub_data['bone_name_hashx'] = info_list(2) data['object_slots'].append(sub_data) slot_type_data.append(data) return slot_type_data buff_schema = GsiGridSchema(label='Tuning/Buffs') buff_schema.add_field('buff_name', label='Name', unique_field=True) buff_schema.add_field('guid', label='Guid') buff_schema.add_field('visible', label='Visible') buff_schema.add_field('sim_has_buff', label='Buff Exists on Current Sim') with buff_schema.add_has_many('sims_with_buff', GsiGridSchema, label='Sims with Buff') as sub_schema: sub_schema.add_field('id', label='Sim ID') sub_schema.add_field('name', label='Sim Name') with buff_schema.add_view_cheat('sims.add_buff', label='Add Selected Buff to Current Sim') as cheat: cheat.add_token_param('buff_name') with buff_schema.add_view_cheat('sims.remove_buff', label='Remove Selected Buff from Current Sim') as cheat: cheat.add_token_param('buff_name') with buff_schema.add_view_cheat('sims.remove_buff_from_all', label='Remove Selected Buff from All Sims') as cheat: cheat.add_token_param('buff_name') @GsiHandler('buff_handler', buff_schema) def generate_buff_data(*args, zone_id:int=None, sim_id:int=None, **kwargs): buff_data = [] buff_manager = services.get_instance_manager(sims4.resources.Types.BUFF) for buff_type in buff_manager.types.values(): data = {'buff_name': buff_type.__name__, 'guid': buff_type.guid64, 'visible': buff_type.visible} sim_list = [] buff_is_on_sim = False for sim_info in services.sim_info_manager(zone_id).values():
unique_field=True) situation_sim_schema.add_field('situation', label='Situation Name', width=3) situation_sim_schema.add_field('state', label='State', width=1.5) situation_sim_schema.add_field('time_left', label='Time Left') situation_sim_schema.add_field('sim_count', label='Number of Sims', type=GsiFieldVisualizers.INT, width=0.5) situation_sim_schema.add_field('score', label='Score', type=GsiFieldVisualizers.FLOAT, width=0.5) situation_sim_schema.add_field('level', label='Level', width=1, hidden=True) situation_sim_schema.add_field('exclusivity', label='Exclusivity', width=1) situation_sim_schema.add_field('creation_source', label='Source', width=1.5) with situation_sim_schema.add_view_cheat('situations.destroy', label='Destroy') as cheat: cheat.add_token_param('situation_id') with situation_sim_schema.add_view_cheat('sims.focus_camera_on_sim', label='Focus Camera', dbl_click=False) as cheat: cheat.add_token_param('sim_Id') with situation_sim_schema.add_has_many('Sims', GsiGridSchema) as sub_schema: sub_schema.add_field('sim_Id', label='Sim ID') sub_schema.add_field('sim_name', label='Sim') sub_schema.add_field('sim_score', label='Score', type=GsiFieldVisualizers.FLOAT) sub_schema.add_field('sim_job', label='Job') sub_schema.add_field('sim_role', label='Role') sub_schema.add_field('sim_emotion', label='Emotion') sub_schema.add_field('sim_on_active_lot', label='On Active Lot')
label='Members') as sub_schema: sub_schema.add_field('sim_id', label='Sim ID', width=0.35) sub_schema.add_field('sim_name', label='Sim Name', width=0.4) sub_schema.add_field('registered_si', label='Registered SIs') sub_schema.add_field('social_context', label='Social Context') with group_schema.add_has_many('states', GsiGridSchema, label='States') as sub_schema: sub_schema.add_field('state', label='State', width=1) sub_schema.add_field('value', label='Value', width=1) with group_schema.add_has_many('constraints', GsiGridSchema, label='Constraint Info') as sub_schema: sub_schema.add_field('constraint_description', label='Key', width=1) sub_schema.add_field('constraint_data', label='Value', width=1) with group_schema.add_view_cheat('debugvis.socials.start', label='DebugVisStart', refresh_view=False) as cheat: cheat.add_token_param('sim_id') with group_schema.add_view_cheat('debugvis.socials.stop', label='DebugVisStop', refresh_view=False) as cheat: cheat.add_token_param('sim_id') with group_schema.add_view_cheat('sims.focus_camera_on_sim', label='Focus On Selected Sim', refresh_view=False) as cheat: cheat.add_token_param('sim_id') @GsiHandler('social_groups', group_schema) def generate_group_data(): group_data = []
vet_clinic_flow_schema.add_field('message', label='message', width=4) host_archiver = GameplayArchiver('flowLog', vet_clinic_flow_schema, add_to_archive_enable_functions=True) def log_vet_flow_entry(sims, source, message): archive_data = {'sims': sims, 'source': source, 'message': message} host_archiver.archive(data=archive_data) vet_clinic_customer_schema = GsiGridSchema(label='Vet/Customers') vet_clinic_customer_schema.add_field('situation_id', label='Situation Id', width=1) vet_clinic_customer_schema.add_field('waiting_start_time', label='Wait Start Time', width=1) vet_clinic_customer_schema.add_field('waiting_queue_order', label='Order In Queue', width=1) vet_clinic_customer_schema.add_field('pet', label='Pet', width=1) vet_clinic_customer_schema.add_field('owner', label='Owner', width=1) vet_clinic_customer_schema.add_field('current_state', label='Current State', width=1) vet_clinic_customer_schema.add_field('vet', label='Vet', width=1) with vet_clinic_customer_schema.add_view_cheat('situations.destroy', label='Destroy Situation') as cheat: cheat.add_token_param('situation_id') @GsiHandler('vet_customers', vet_clinic_customer_schema) def generate_customer_data(zone_id:int=None): customer_situations_data = [] zone_director = get_vet_clinic_zone_director() if zone_director is None: return customer_situations_data waiting_situations_ids = list(zone_director._waiting_situations.keys()) waiting_situations_ids_list_fixed = tuple(waiting_situations_ids) def add_customer_situation_data(customer_situation): is_waiting_situation = customer_situation.id in waiting_situations_ids order_in_queue = waiting_situations_ids_list_fixed.index(customer_situation.id) if is_waiting_situation else 'Not In Queue' customer_situations_data.append({'waiting_start_time': str(customer_situation.wait_start_time), 'waiting_queue_order': str(order_in_queue), 'situation_id': str(customer_situation.id), 'pet': str(customer_situation.get_pet()), 'owner': str(customer_situation.get_pet_owner()), 'current_state': customer_situation.current_state_type.__name__, 'vet': str(customer_situation.get_vet())})
object_manager_schema.add_field('locZ', label='Z', width=1) object_manager_schema.add_field('on_active_lot', label='On Active Lot', width=1, hidden=True) object_manager_schema.add_field('current_value', label='Value', width=1) object_manager_schema.add_field('isSurface', label='Surface', width=1) object_manager_schema.add_field('parent', label='Parent', width=2) object_manager_schema.add_field('inUseBy', label='In Use By', width=2) object_manager_schema.add_field('lockouts', label='Lockouts', width=2) object_manager_schema.add_field('transient', label='Transient', width=1, hidden=True) object_manager_schema.add_field('is_interactable', label='Interactable', width=1, hidden=True) object_manager_schema.add_field('footprint', label='Footprint', width=1, hidden=True) object_manager_schema.add_field('inventory_owner_id', label='inventory owner id', width=2, hidden=True) object_manager_schema.add_filter('on_active_lot') object_manager_schema.add_filter('game_objects') object_manager_schema.add_filter('prototype_objects') object_manager_schema.add_filter('all_objects') with object_manager_schema.add_view_cheat('objects.destroy', label='Delete') as cheat: cheat.add_token_param('objId') with object_manager_schema.add_view_cheat('objects.reset', label='Reset') as cheat: cheat.add_token_param('objId') with object_manager_schema.add_view_cheat('objects.focus_camera_on_object', label='Focus On Selected Object') as cheat: cheat.add_token_param('objId') with object_manager_schema.add_has_many('commodities', GsiGridSchema) as sub_schema: sub_schema.add_field('commodity', label='Commodity') sub_schema.add_field('value', label='value') sub_schema.add_field('convergence_value', label='convergence value') sub_schema.add_field('decay_rate', label='decay') sub_schema.add_field('change_rate', label='change rate') with object_manager_schema.add_has_many('postures', GsiGridSchema) as sub_schema: sub_schema.add_field('interactionName', label='Interaction Name') sub_schema.add_field('providedPosture', label='Provided Posture') with object_manager_schema.add_has_many('states', GsiGridSchema) as sub_schema:
type=GsiFieldVisualizers.STRING) bucks_perks.add_field('bucks_type_value', label='bucksTypeValue', type=GsiFieldVisualizers.STRING, hidden=True) bucks_perks.add_field('bucks_tracker_name', label='Bucks Tracker Name', type=GsiFieldVisualizers.STRING) bucks_perks.add_field('is_unlocked', label='isUnlocked', type=GsiFieldVisualizers.STRING) for bucks_type in BucksType: bucks_perks.add_filter(str(bucks_type)) bucks_perks.add_filter('Unlocked Only') with bucks_perks.add_view_cheat('bucks.unlock_perk', label='Unlock Perk', dbl_click=True, refresh_view=False) as cheat: cheat.add_token_param('name') cheat.add_static_param(True) cheat.add_token_param('bucks_type_value') cheat.add_token_param('sim_id') @GsiHandler('bucks_perks', bucks_perks) def generate_bucks_perks_view(sim_id: int = None, filter=None): filter_list = parse_filter_to_list(filter) bucks_perks_data = [] perks_instance_manager = services.get_instance_manager( sims4.resources.Types.BUCKS_PERK) previous_bucks_type = None for perk in perks_instance_manager.types.values():
label='Interactable', width=1, hidden=True) object_manager_schema.add_field('footprint', label='Footprint', width=1, hidden=True) object_manager_schema.add_field('inventory_owner_id', label='inventory owner id', width=2, hidden=True) object_manager_schema.add_filter('on_active_lot') object_manager_schema.add_filter('game_objects') object_manager_schema.add_filter('prototype_objects') object_manager_schema.add_filter('all_objects') with object_manager_schema.add_view_cheat('objects.destroy', label='Delete') as cheat: cheat.add_token_param('objId') with object_manager_schema.add_view_cheat('objects.reset', label='Reset') as cheat: cheat.add_token_param('objId') with object_manager_schema.add_view_cheat( 'objects.focus_camera_on_object', label='Focus On Selected Object') as cheat: cheat.add_token_param('objId') with object_manager_schema.add_has_many('commodities', GsiGridSchema) as sub_schema: sub_schema.add_field('commodity', label='Commodity') sub_schema.add_field('value', label='value') sub_schema.add_field('convergence_value', label='convergence value') sub_schema.add_field('decay_rate', label='decay') sub_schema.add_field('change_rate', label='change rate')
label='ID', type=GsiFieldVisualizers.INT, width=0.25, unique_field=True) broadcaster_schema.add_field('broadcaster_type', label='Type', width=1) broadcaster_schema.add_field('broadcasting_object', label='Object', width=1) broadcaster_schema.add_field('broadcasting_object_id', label='Object ID', type=GsiFieldVisualizers.INT, hidden=True) broadcaster_schema.add_field('broadcaster_status', label='Status', width=1) broadcaster_schema.add_field('broadcaster_clock_type', label='Clock Type', width=2) broadcaster_schema.add_field('broadcaster_targets', label='Targets', width=1) broadcaster_schema.add_view_cheat('debugvis.broadcasters.start', label='Start Visualization') broadcaster_schema.add_view_cheat('debugvis.broadcasters.stop', label='Stop Visualization') with broadcaster_schema.add_cheat('objects.focus_camera_on_object', label='Focus', dbl_click=True) as cheat: cheat.add_token_param('broadcasting_object_id') with broadcaster_schema.add_has_many('affected_objects', GsiGridSchema, label='Affected Objects') as sub_schema: sub_schema.add_field('object_name', label='Object', width=1) sub_schema.add_field('last_reaction_time', label='Reaction Time', width=1) sub_schema.add_field('in_area', label='In Area', width=1) @GsiHandler('broadcasters', broadcaster_schema)
from event_testing.resolver import SingleSimResolver from gsi_handlers.gameplay_archiver import GameplayArchiver from sickness.sickness_utils import all_sickness_weights_gen from sims4.gsi.dispatcher import GsiHandler from sims4.gsi.schema import GsiGridSchema, GsiFieldVisualizers import services sick_sim_schema = GsiGridSchema(label='Sickness/Sick Sims') sick_sim_schema.add_field('sim_id', label='Sim Id') sick_sim_schema.add_field('sim', label='Sim') sick_sim_schema.add_field('sickness', label='Sickness') sick_sim_schema.add_field('last_recorded_progress', label='Last Progress Stat Value', visualizer=GsiFieldVisualizers.INT) sick_sim_schema.add_field('discovered', label='Is Discovered?') sick_sim_schema.add_view_cheat('sickness.distribute_sicknesses', label='Distribute Sicknesses') with sick_sim_schema.add_view_cheat( 'sickness.remove', label='Remove Sickness') as remove_sickness_cheat: remove_sickness_cheat.add_token_param('sim_id') with sick_sim_schema.add_view_cheat( 'sickness.update_diagnosis', label='Diagnostics/Update') as update_diagnosis_cheat: update_diagnosis_cheat.add_token_param('sim_id') with sick_sim_schema.add_view_cheat( 'sickness.clear_diagnosis', label='Diagnostics/Clear') as clear_diagnosis_cheat: clear_diagnosis_cheat.add_token_param('sim_id') with sick_sim_schema.add_has_many('Symptoms', GsiGridSchema) as sub_schema: sub_schema.add_field('symptom', label='Symptom') sub_schema.add_field('is_discovered', label='Discovered?') with sick_sim_schema.add_has_many('Examinations Performed',
from sims4.gsi.dispatcher import GsiHandler from sims4.gsi.schema import GsiGridSchema import services missing_pet_schema = GsiGridSchema(label='Missing Pets') missing_pet_schema.add_field('household_id', label='Household Id') missing_pet_schema.add_field('household', label='Household') missing_pet_schema.add_field('run_test_absolute', label='Run Tests - Absolute Time') missing_pet_schema.add_field('run_test_time_left', label='Run Tests - Time Left') missing_pet_schema.add_field('sim_id', label='Sim Id') missing_pet_schema.add_field('sim', label='Sim') missing_pet_schema.add_field('return_time_absolute', label='Return Time - Absolute Time') missing_pet_schema.add_field('return_time_left', label='Return Time - Time Left') missing_pet_schema.add_field('cooldown_absolute', label='Cooldown - Absolute Time') missing_pet_schema.add_field('cooldown_time_left', label='Cooldown - Time Left') with missing_pet_schema.add_view_cheat('pets.return_pet', label='Return Pet') as return_pet_cheat: return_pet_cheat.add_token_param('household_id') with missing_pet_schema.add_view_cheat('pets.post_alert', label='Post Alert') as post_alert_cheat: post_alert_cheat.add_token_param('household_id') @GsiHandler('missing_pets_schema_view', missing_pet_schema) def generate_missing_pet_view(): missing_pet_data = [] for household in services.household_manager().values(): gsi_data = household.missing_pet_tracker.get_missing_pet_data_for_gsi() missing_pet_data.append(gsi_data) return missing_pet_data
width=1, unique_field=True) gardening_schema.add_field('class', label='Class', width=3) gardening_schema.add_field('definition', label='Definition', width=3) gardening_schema.add_field('model', label='Model', width=3) gardening_schema.add_field('root_stock', label='Root Stock', width=5) with gardening_schema.add_has_many('fruit_spawners', GsiGridSchema) as spawn_data_schema: spawn_data_schema.add_field('spawn_definition', label='Spawner Definition', width=3) spawn_data_schema.add_field('spawn_weight', label='Spawner Weight', width=1) with gardening_schema.add_view_cheat( 'objects.focus_camera_on_object', label='Focus On Selected Object') as cheat: cheat.add_token_param('object_id') @GsiHandler('gardening_objects', gardening_schema) def generate_gardening_objects_data(*args, **kwargs): gardening_data = [] for gardening_object in services.object_manager( ).get_all_objects_with_component_gen(GARDENING_COMPONENT): spawn_data_entry = [] for spawn_data in gardening_object.gardening_component.fruit_spawners: spawn_data_entry.append({ 'spawn_definition': str(spawn_data.main_spawner), 'spawn_weight':
drama_tuning_data_schema = GsiGridSchema(label='Drama Nodes/Drama Tuning Data') drama_tuning_data_schema.add_field('drama_node_name', label='Node Name', width=2) drama_tuning_data_schema.add_field('sunday', label='Sunday') drama_tuning_data_schema.add_field('monday', label='Monday') drama_tuning_data_schema.add_field('tuesday', label='Tuesday') drama_tuning_data_schema.add_field('wednesday', label='Wednesday') drama_tuning_data_schema.add_field('thursday', label='Thursday') drama_tuning_data_schema.add_field('friday', label='Friday') drama_tuning_data_schema.add_field('saturday', label='Saturday') for filter_string in FILTER_STRINGS: drama_tuning_data_schema.add_filter(filter_string) with drama_tuning_data_schema.add_view_cheat('drama.schedule_node', label='Schedule') as cheat: cheat.add_token_param('drama_node_name') with drama_tuning_data_schema.add_view_cheat('drama.run_node', label='Run') as cheat: cheat.add_token_param('drama_node_name') @GsiHandler('drama_tuning', drama_tuning_data_schema) def generate_drama_tuning_data(zone_id: int = None, filter=None): all_nodes = [] filter_list = parse_filter_to_list(filter) dnm = services.get_instance_manager(sims4.resources.Types.DRAMA_NODE) for node_type in dnm.types.values(): node_data = {} node_name = node_type.__name__ if drama_node_string_matches_filters(node_name, filter_list):
from aspirations.aspiration_tuning import Aspiration from sims4.gsi.dispatcher import GsiHandler from sims4.gsi.schema import GsiGridSchema import aspirations.aspirations import services import sims4.resources from gsi_handlers.gameplay_archiver import GameplayArchiver aspiration_schema = GsiGridSchema(label='Aspirations', sim_specific=True) aspiration_schema.add_field('aspiration_uid', label='UId', unique_field=True) aspiration_schema.add_field('aspiration', label='Aspiration', width=3) aspiration_schema.add_field('aspiration_complete', label='Done') aspiration_schema.add_field('display_name', label='DisplayStr', hidden=True) aspiration_schema.add_field('description', label='DescStr', hidden=True) aspiration_schema.add_field('auto_select', label='Auto Select', hidden=True) aspiration_schema.add_field('simId', label='SimId', hidden=True) with aspiration_schema.add_view_cheat('aspirations.complete_aspiration', label='Complete') as cheat: cheat.add_token_param('aspiration_uid') cheat.add_token_param('simId') with aspiration_schema.add_has_many('objectives', GsiGridSchema, label='Objectives') as sub_schema: sub_schema.add_field('objective', label='Objective') sub_schema.add_field('objective_iterations_complete', label='Iterations Complete') sub_schema.add_field('objective_iterations_required', label='Iterations Required') sub_schema.add_field('objective_complete', label='Completed') @GsiHandler('aspiration_view', aspiration_schema) def generate_aspiration_view_data(sim_id: int = None):
from performance.object_leak_tracker import NodeStatus from sims4.gsi.dispatcher import GsiHandler from sims4.gsi.schema import GsiGridSchema import services schema = GsiGridSchema(label='Object Leaks') schema.add_field('status', label='Status') schema.add_field('pid', label='Python Id', unique_field=True) schema.add_field('pid_hex', label='Python Id (hex)') schema.add_field('type', label='Type') schema.add_field('old_manager', label='Old Manager') schema.add_field('old_obj_id', label='Old Object Id') with schema.add_has_many('history', GsiGridSchema) as sub_schema: sub_schema.add_field('status', label='Status') sub_schema.add_field('gc_pass', label='GC Pass') sub_schema.add_field('time', label='Time') schema.add_view_cheat('mem.gc.collect', label='|mem.gc.collect') with schema.add_view_cheat( 'object_leak_tracker.dump_pid', label='|object_leak_tracker.dump_pid <python id>') as cheat: cheat.add_token_param('pid') @GsiHandler('leaked_objects', schema) def generate_data(*args, **kwargs): data = [] tracker = services.get_object_leak_tracker() if tracker is None: return data for status in NodeStatus: for node in tracker.buckets[status]: node_data = {}
sub_schema.add_field('field_value', label='Field Value') with sim_career_schema.add_has_many('objectives', GsiGridSchema, label='Current Objectives') as sub_schema: sub_schema.add_field('objective', label='Objective') sub_schema.add_field('is_complete', label='Complete?') with sim_career_schema.add_has_many('assignments', GsiGridSchema, label='Active Assignments') as sub_schema: sub_schema.add_field('assignment', label='Assignment') with sim_career_schema.add_has_many('offered_assignments', GsiGridSchema, label='Offered Assignments') as sub_schema: sub_schema.add_field('assignment', label='Assignment') sub_schema.add_field('test_result', label='Test Result') with sim_career_schema.add_view_cheat('careers.promote', label='Promote') as cheat: cheat.add_token_param('career_uid') cheat.add_token_param('sim_id') with sim_career_schema.add_view_cheat('careers.demote', label='Demote') as cheat: cheat.add_token_param('career_uid') cheat.add_token_param('sim_id') with sim_career_schema.add_view_cheat('careers.retire', label='Retire') as cheat: cheat.add_token_param('career_uid') cheat.add_token_param('sim_id') with sim_career_schema.add_view_cheat('careers.remove_career', label='Remove Career') as cheat: cheat.add_token_param('career_uid') cheat.add_token_param('sim_id') with sim_career_schema.add_view_cheat('careers.add_performance',
planner_archive_schema.add_field('planner_id', label='Planner ID', width=2, hidden=True) planner_archive_schema.add_field('x', label='Start X', type=GsiFieldVisualizers.FLOAT, width=2) planner_archive_schema.add_field('y', label='Start Y', type=GsiFieldVisualizers.FLOAT, width=2, hidden=True) planner_archive_schema.add_field('z', label='Start Z', type=GsiFieldVisualizers.FLOAT, width=2) planner_archive_schema.add_field('qx', label='Start QX', type=GsiFieldVisualizers.FLOAT, width=2, hidden=True) planner_archive_schema.add_field('qy', label='Start QY', type=GsiFieldVisualizers.FLOAT, width=2, hidden=True) planner_archive_schema.add_field('qz', label='Start QZ', type=GsiFieldVisualizers.FLOAT, width=2, hidden=True) planner_archive_schema.add_field('qw', label='Start QW', type=GsiFieldVisualizers.FLOAT, width=2, hidden=True) planner_archive_schema.add_field('level', label='Start Level', type=GsiFieldVisualizers.INT, width=2) planner_archive_schema.add_field('ticks', label='Sleep Count', type=GsiFieldVisualizers.INT, width=2) planner_archive_schema.add_field('time', label='Sleep Time ms', type=GsiFieldVisualizers.FLOAT, width=2) planner_archive_schema.add_field('plan_time', label='Plan Time ms', type=GsiFieldVisualizers.FLOAT, width=2) planner_archive_schema.add_field('dist', label='Distance', type=GsiFieldVisualizers.FLOAT, width=2) planner_archive_schema.add_field('num_goals', label='Num Goals', type=GsiFieldVisualizers.INT, width=2) planner_archive_schema.add_field('num_starts', label='Num Starts', type=GsiFieldVisualizers.INT, width=2) planner_archive_schema.add_view_cheat('routing.serialize_pathplanner_data', label='Serialize Path Planner Data') with planner_archive_schema.add_has_many('Goals', GsiGridSchema) as sub_schema: sub_schema.add_field('index', label='Index', type=GsiFieldVisualizers.INT, width=2) sub_schema.add_field('x', label='X', type=GsiFieldVisualizers.FLOAT, width=2) sub_schema.add_field('z', label='Z', type=GsiFieldVisualizers.FLOAT, width=2) sub_schema.add_field('level', label='Level', type=GsiFieldVisualizers.INT, width=2) sub_schema.add_field('cost', label='Cost', type=GsiFieldVisualizers.FLOAT, width=2) sub_schema.add_field('final_cost', label='Final Cost (lower==better)', type=GsiFieldVisualizers.FLOAT, width=2) sub_schema.add_field('result', label='Result', width=2) sub_schema.add_field('raw_result', label='Raw Result', type=GsiFieldVisualizers.INT, width=2) sub_schema.add_field('group', label='Group', type=GsiFieldVisualizers.INT, width=2) with planner_archive_schema.add_has_many('Starts', GsiGridSchema) as sub_schema: sub_schema.add_field('x', label='X', type=GsiFieldVisualizers.FLOAT, width=2) sub_schema.add_field('z', label='Z', type=GsiFieldVisualizers.FLOAT, width=2) sub_schema.add_field('level', label='Level', type=GsiFieldVisualizers.INT, width=2) sub_schema.add_field('cost', label='Cost', type=GsiFieldVisualizers.FLOAT, width=2)
narratives_schema.add_field('groups', label='Narrative Groups', width=1) narratives_schema.add_field('active', label='Is Active', width=0.1) narratives_schema.add_field('previously_completed', label='Previously Completed', width=0.1) with narratives_schema.add_has_many('Linked Narratives', GsiGridSchema) as sub_schema: sub_schema.add_field('event', label='Narrative Event') sub_schema.add_field('narrative', label='Linked Narrative') sub_schema.add_field('progression_value', label='Progression Value') sub_schema.add_field('above_link', label='Above Link') sub_schema.add_field('above_threshold', label='Above Threshold') sub_schema.add_field('below_link', label='Below Link') sub_schema.add_field('below_threshold', label='Below Threshold') with narratives_schema.add_view_cheat( 'narrative.start_narrative', label='Start Narrative') as start_narrative_command: start_narrative_command.add_token_param('narrative') with narratives_schema.add_view_cheat( 'narrative.end_narrative', label='End Narrative') as end_narrative_command: end_narrative_command.add_token_param('narrative') with narratives_schema.add_view_cheat( 'narrative.reset_completion', label='Reset Completion') as reset_completion_command: reset_completion_command.add_token_param('narrative') @GsiHandler('narratives_view', narratives_schema) def generate_narrative_view(): narratives = []
sims4.resources.Types.CLUB_SEED) if instance_manager.all_instances_loaded: return [cls.__name__ for cls in instance_manager.types.values()] return [] def add_club(manager): with club_schema.add_view_cheat('clubs.create_club_from_seed', label='Create Club') as cheat: cheat.add_token_param('club_seed', dynamic_token_fn=generate_all_club_seeds) services.get_instance_manager( sims4.resources.Types.CLUB_SEED).add_on_load_complete(add_club) with club_schema.add_view_cheat('clubs.remove_club_by_id', label='Remove Club') as cheat: cheat.add_token_param('club_id') with club_schema.add_view_cheat('clubs.remove_sim_from_club_by_id', label='Remove Sim From Club') as cheat: cheat.add_token_param('sim_id') cheat.add_token_param('club_id') with club_schema.add_view_cheat('clubs.end_gathering_by_club_id', label='End Club Gathering') as cheat: cheat.add_token_param('club_id') with club_schema.add_view_cheat('clubs.start_gathering_by_club_id', label='Start Gathering') as cheat: cheat.add_token_param('club_id') with club_schema.add_view_cheat('clubs.refresh_safe_seed_data_for_club', label='Refresh Safe Data') as cheat: cheat.add_token_param('club_id')
from gsi_handlers.gameplay_archiver import GameplayArchiver from sims4.gsi.dispatcher import GsiHandler from sims4.gsi.schema import GsiGridSchema import gsi_handlers import services import sims4.resources achievement_schema = GsiGridSchema(label='Achievements', sim_specific=True) achievement_schema.add_field('achievement_uid', label='UId', unique_field=True) achievement_schema.add_field('achievement', label='Achievement', width=3) achievement_schema.add_field('category', label='Category', width=2) achievement_schema.add_field('points', label='Points') achievement_schema.add_field('achievement_complete', label='Done') achievement_schema.add_field('display_name', label='DisplayStr', hidden=True) achievement_schema.add_field('description', label='DescStr', hidden=True) achievement_schema.add_field('simId', label='SimId', hidden=True) with achievement_schema.add_view_cheat('achievements.complete_achievement', label='Complete') as cheat: cheat.add_token_param('achievement_uid') cheat.add_token_param('simId') with achievement_schema.add_has_many('objectives', GsiGridSchema, label='Objectives') as sub_schema: sub_schema.add_field('objective', label='Objective') sub_schema.add_field('objective_complete', label='Done') @GsiHandler('achievement_view', achievement_schema) def generate_achievement_view_data(sim_id:int=None): sim_info = services.sim_info_manager().get(sim_id) achievement_manager = services.get_instance_manager(sims4.resources.Types.ACHIEVEMENT) all_achievements = [] for achievement_id in achievement_manager.types: achievement = achievement_manager.get(achievement_id) achievement_data = {} achievement_data['achievement'] = str(achievement)
for sim_info in sim_info_manager.objects: if sim_info.sim_id == sim_id: whim_tracker = sim_info._whim_tracker if whim_tracker is None: continue for (whim, source_whimset) in whim_tracker.whims_and_parents_gen(): whim_data = {'sim_id': str(sim_info.sim_id), 'whim': whim.get_gsi_name(), 'instance': whim.__class__.__name__, 'whimset': source_whimset.__name__, 'target': str(whim_tracker.get_whimset_target(source_whimset)), 'value': whim.score} whim_view_data.append(whim_data) return whim_view_data sim_activeset_schema = GsiGridSchema(label='Whims/Whimsets Active', sim_specific=True) sim_activeset_schema.add_field('sim_id', label='Sim ID', hidden=True) sim_activeset_schema.add_field('whimset', label='Whimset', unique_field=True, width=3) sim_activeset_schema.add_field('priority', label='Priority', width=1, type=GsiFieldVisualizers.INT) sim_activeset_schema.add_field('target', label='Current Target', width=2) with sim_activeset_schema.add_view_cheat('whims.give_whim_from_whimset', label='Give from Whimset', dbl_click=True) as cheat: cheat.add_token_param('whimset') cheat.add_token_param('sim_id') with sim_activeset_schema.add_has_many('potential_whims_view', GsiGridSchema, label='Potential Whims') as sub_schema: sub_schema.add_field('whim', label='Whim', width=3) sub_schema.add_field('status', label='Status', width=5) sub_schema.add_field('weight', label='Weight', width=1, type=GsiFieldVisualizers.FLOAT) @GsiHandler('sim_activeset_view', sim_activeset_schema) def generate_sim_activeset_view_data(sim_id:int=None): activeset_view_data = [] sim_info_manager = services.sim_info_manager() if sim_info_manager is not None: for sim_info in sim_info_manager.objects: if sim_info.sim_id == sim_id: whim_tracker = sim_info._whim_tracker
from gsi_handlers.gameplay_archiver import GameplayArchiver from sims4.gsi.dispatcher import GsiHandler from sims4.gsi.schema import GsiGridSchema import gsi_handlers import services import sims4.resources achievement_schema = GsiGridSchema(label='Achievements', sim_specific=True) achievement_schema.add_field('achievement_uid', label='UId', unique_field=True) achievement_schema.add_field('achievement', label='Achievement', width=3) achievement_schema.add_field('category', label='Category', width=2) achievement_schema.add_field('points', label='Points') achievement_schema.add_field('achievement_complete', label='Done') achievement_schema.add_field('display_name', label='DisplayStr', hidden=True) achievement_schema.add_field('description', label='DescStr', hidden=True) achievement_schema.add_field('simId', label='SimId', hidden=True) with achievement_schema.add_view_cheat('achievements.complete_achievement', label='Complete') as cheat: cheat.add_token_param('achievement_uid') cheat.add_token_param('simId') with achievement_schema.add_has_many('objectives', GsiGridSchema, label='Objectives') as sub_schema: sub_schema.add_field('objective', label='Objective') sub_schema.add_field('objective_complete', label='Done') @GsiHandler('achievement_view', achievement_schema) def generate_achievement_view_data(sim_id:int=None): sim_info = services.sim_info_manager().get(sim_id) achievement_manager = services.get_instance_manager(sims4.resources.Types.ACHIEVEMENT) all_achievements = [] for achievement_id in achievement_manager.types: achievement = achievement_manager.get(achievement_id) achievement_data = {} achievement_data['achievement'] = str(achievement)