• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python services.get_zone_situation_manager函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中services.get_zone_situation_manager函数的典型用法代码示例。如果您正苦于以下问题:Python get_zone_situation_manager函数的具体用法?Python get_zone_situation_manager怎么用?Python get_zone_situation_manager使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了get_zone_situation_manager函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: _create_next_situation

 def _create_next_situation(self):
     worker_sim = next(self.all_sims_in_job_gen(self.default_job()), None)
     if worker_sim is not None:
         if worker_sim.is_on_active_lot() and self._visit_duration != False:
             services.get_zone_situation_manager().create_visit_situation(worker_sim, duration_override=self._visit_duration)
             return
         services.get_zone_situation_manager().make_sim_leave(worker_sim)
开发者ID:johndpope,项目名称:sims4-ai-engine,代码行数:7,代码来源:worker_npc_situation.py


示例2: reset

def reset(_connection=None):
    services.get_zone_situation_manager().reset()
    for sim in services.sim_info_manager().instanced_sims_gen():
        try:
            sim.reset_role_tracker()
        except Exception:
            logger.error('Error while resetting role tracker for sim {}', sim)
开发者ID:johndpope,项目名称:sims4-ai-engine,代码行数:7,代码来源:situation_commands.py


示例3: __call__

 def __call__(self, sim_infos, host_sim_info=None):
     npc_infos = []
     selectable_and_resident_infos = []
     for sim_info in sim_infos:
         if sim_info.is_npc and not sim_info.lives_here:
             npc_infos.append(sim_info)
         else:
             selectable_and_resident_infos.append(sim_info)
     if npc_infos:
         player_lot_id = services.active_household_lot_id()
         active_lot_id = services.active_lot_id()
         if active_lot_id == player_lot_id:
             if self.player_sim_lot is not None:
                 self.player_sim_lot(npc_infos, host_sim_info)
                 if services.get_zone_situation_manager().is_player_greeted():
                     if self.npc_lot_greeted is not None:
                         self.npc_lot_greeted(npc_infos, host_sim_info)
                         if self.npc_lot_ungreeted is not None:
                             self.npc_lot_ungreeted(npc_infos, host_sim_info)
                 elif self.npc_lot_ungreeted is not None:
                     self.npc_lot_ungreeted(npc_infos, host_sim_info)
         elif services.get_zone_situation_manager().is_player_greeted():
             if self.npc_lot_greeted is not None:
                 self.npc_lot_greeted(npc_infos, host_sim_info)
                 if self.npc_lot_ungreeted is not None:
                     self.npc_lot_ungreeted(npc_infos, host_sim_info)
         elif self.npc_lot_ungreeted is not None:
             self.npc_lot_ungreeted(npc_infos, host_sim_info)
     for sim_info in selectable_and_resident_infos:
         while sim_info.get_sim_instance() is None:
             op = distributor.ops.TravelBringToZone([sim_info.sim_id, 0, services.current_zone().id, 0])
             distributor.system.Distributor.instance().add_op_with_no_owner(op)
开发者ID:johndpope,项目名称:sims4-ai-engine,代码行数:32,代码来源:venue_tuning.py


示例4: callback

 def callback(sim_infos, callback_event_data):
     if sim_infos:
         for sim_info in sim_infos:
             services.get_zone_situation_manager().add_debug_sim_id(sim_info.id)
             sims.sim_spawner.SimSpawner.spawn_sim(sim_info, None)
             sims4.commands.output('Spawned {} with id {}'.format(sim_info, sim_info.id), _connection)
     else:
         sims4.commands.output('No filter with {}'.format(callback_event_data), _connection)
开发者ID:johndpope,项目名称:sims4-ai-engine,代码行数:8,代码来源:sim_filter_commands.py


示例5: _start_background_event

 def _start_background_event(self, scheduler, alarm_data, extra_data=None):
     entry = alarm_data.entry
     situation = entry.situation
     situation_manager = services.get_zone_situation_manager()
     if self._active_background_event_id is not None and self._active_background_event_id in situation_manager:
         situation_manager.destroy_situation_by_id(self._active_background_event_id)
     situation_id = services.get_zone_situation_manager().create_situation(situation, user_facing=False, spawn_sims_during_zone_spin_up=True)
     self._active_background_event_id = situation_id
开发者ID:johndpope,项目名称:sims4-ai-engine,代码行数:8,代码来源:venue_tuning.py


示例6: _create_NPC_hosted_situation

 def _create_NPC_hosted_situation(dialog):
     if not dialog.accepted:
         with telemetry_helper.begin_hook(writer, TELEMETRY_HOOK_SITUATION_REJECTED, sim=player_sim) as hook:
             hook.write_guid('type', chosen_situation.guid64)
         return
     guest_list = SituationGuestList(host_sim_id=NPC_sim_id)
     if chosen_situation.NPC_hosted_situation_use_player_sim_as_filter_requester:
         guest_list.filter_requesting_sim_id = player_sim.id
     guest_list.add_guest_info(SituationGuestInfo.construct_from_purpose(player_sim.id, chosen_situation.NPC_hosted_situation_player_job, SituationInvitationPurpose.INVITED))
     chosen_zone_id = chosen_situation.get_venue_location()
     services.get_zone_situation_manager().create_situation(chosen_situation, guest_list=guest_list, zone_id=chosen_zone_id)
     self.add_cooldown(self._cooldown)
     with telemetry_helper.begin_hook(writer, TELEMETRY_HOOK_SITUATION_ACCEPTED, sim=player_sim) as hook:
         hook.write_guid('type', chosen_situation.guid64)
开发者ID:johndpope,项目名称:sims4-ai-engine,代码行数:14,代码来源:npc_hosted_situations.py


示例7: create_sims

 def create_sims(cls, sim_creators, household=None, tgt_client=None, generate_deterministic_sim=False, sim_position:sims4.math.Vector3=None, sim_spawner_tags=None, account=None, is_debug=False, skip_offset=False, additional_fgl_search_flags=None, creation_source:str='Unknown'):
     (sim_info_list, _) = cls.create_sim_infos(sim_creators, household=household, starting_funds=DEFAULT, tgt_client=tgt_client, account=account, generate_deterministic_sim=generate_deterministic_sim)
     offset = 0.0
     for sim_info in sim_info_list:
         if sim_position is not None:
             sim_position = sims4.math.Vector3(*sim_position)
             if not skip_offset:
                 offset = 2.0
             sim_position.y = terrain.get_terrain_height(sim_position.x, sim_position.z)
         if is_debug:
             services.get_zone_situation_manager().add_debug_sim_id(sim_info.id)
         cls.spawn_sim(sim_info, sim_position, sim_spawner_tags=sim_spawner_tags, additional_fgl_search_flags=additional_fgl_search_flags, is_debug=is_debug)
         while sim_info.account is not None and tgt_client is not None:
             tgt_client.add_selectable_sim_info(sim_info)
开发者ID:johndpope,项目名称:sims4-ai-engine,代码行数:14,代码来源:sim_spawner.py


示例8: _push_open_street_sims_home

 def _push_open_street_sims_home(self):
     sim_info_manager = services.sim_info_manager()
     situation_manager = services.get_zone_situation_manager()
     for instanced_sim in sim_info_manager.instanced_sims_gen():
         while instanced_sim.id not in self._sims_told_to_leave and instanced_sim.is_npc and not instanced_sim.is_on_active_lot():
             situation_manager.make_sim_leave_now_must_run(instanced_sim, super_speed_three_request=True)
             self._sims_told_to_leave.add(instanced_sim.id)
开发者ID:johndpope,项目名称:sims4-ai-engine,代码行数:7,代码来源:super_speed_three_service.py


示例9: _try_start_special_event

    def _try_start_special_event(self, scheduler, alarm_data, extra_data):
        entry = alarm_data.entry
        situation = entry.situation
        situation_manager = services.get_zone_situation_manager()
        if self._active_special_event_id is None:
            client_manager = services.client_manager()
            client = next(iter(client_manager.values()))
            invited_sim = client.active_sim
            active_sim_available = situation.is_situation_available(invited_sim)

            def _start_special_event(dialog):
                guest_list = None
                if dialog.accepted:
                    start_user_facing = True
                    guest_list = SituationGuestList()
                    guest_info = SituationGuestInfo.construct_from_purpose(invited_sim.id, situation.venue_situation_player_job, SituationInvitationPurpose.INVITED)
                    guest_list.add_guest_info(guest_info)
                else:
                    start_user_facing = False
                situation_id = situation_manager.create_situation(situation, guest_list=guest_list, user_facing=start_user_facing)
                self._active_special_event_id = situation_id

            if not situation_manager.is_user_facing_situation_running() and active_sim_available:
                dialog = situation.venue_invitation_message(invited_sim, SingleSimResolver(invited_sim))
                dialog.show_dialog(on_response=_start_special_event, additional_tokens=(situation.display_name, situation.venue_situation_player_job.display_name))
            else:
                situation_id = situation_manager.create_situation(situation, user_facing=False)
                self._active_special_event_id = situation_id
开发者ID:johndpope,项目名称:sims4-ai-engine,代码行数:28,代码来源:venue_tuning.py


示例10: start_situation

 def start_situation(interaction, situation, user_facing):
     situation_manager = services.get_zone_situation_manager()
     guest_list = situation.get_predefined_guest_list()
     if guest_list is None:
         sim = interaction.sim
         guest_list = SituationGuestList(invite_only=True, host_sim_id=sim.id)
         if situation.targeted_situation is not None:
             target_sim = interaction.get_participant(ParticipantType.PickedSim)
             if target_sim is None:
                 target_sim = interaction.get_participant(ParticipantType.TargetSim)
             target_sim_id = target_sim.id if target_sim is not None else None
             job_assignments = situation.get_prepopulated_job_for_sims(sim, target_sim_id)
             for (sim_id, job_type_id) in job_assignments:
                 job_type = services.situation_job_manager().get(job_type_id)
                 guest_info = SituationGuestInfo.construct_from_purpose(sim_id, job_type, SituationInvitationPurpose.INVITED)
                 guest_list.add_guest_info(guest_info)
         else:
             default_job = situation.default_job()
             target_sims = interaction.get_participants(ParticipantType.PickedSim)
             if target_sims:
                 for sim_or_sim_info in target_sims:
                     guest_info = SituationGuestInfo.construct_from_purpose(sim_or_sim_info.sim_id, default_job, SituationInvitationPurpose.INVITED)
                     guest_list.add_guest_info(guest_info)
             else:
                 target_sim = interaction.get_participant(ParticipantType.TargetSim)
                 if target_sim is not None:
                     guest_info = SituationGuestInfo.construct_from_purpose(target_sim.sim_id, default_job, SituationInvitationPurpose.INVITED)
                     guest_list.add_guest_info(guest_info)
             guest_info = SituationGuestInfo.construct_from_purpose(sim.sim_id, default_job, SituationInvitationPurpose.INVITED)
             guest_list.add_guest_info(guest_info)
     zone_id = interaction.get_participant(ParticipantType.PickedZoneId) or 0
     situation_manager.create_situation(situation, guest_list=guest_list, user_facing=user_facing, zone_id=zone_id)
开发者ID:johndpope,项目名称:sims4-ai-engine,代码行数:32,代码来源:tunable.py


示例11: _send_service_npc

 def _send_service_npc(self, scheduler, alarm_data, situation_creation_params):
     household = situation_creation_params.hiring_household
     service_npc_type = situation_creation_params.service_npc_type
     if not self._auto_scheduled_services_enabled and service_npc_type.auto_schedule_on_client_connect():
         return
     service_record = household.get_service_npc_record(service_npc_type.guid64)
     preferred_sim_id = service_record.get_preferred_sim_id()
     situation_type = service_npc_type.situation
     user_specified_data_id = situation_creation_params.user_specified_data_id
     now = services.time_service().sim_now
     if service_record.time_last_started_service is not None and alarm_data.start_time is not None:
         alarm_start_time_absolute = date_and_time_from_week_time(now.week(), alarm_data.start_time)
         if service_record.time_last_started_service >= alarm_start_time_absolute:
             return
     service_record.time_last_started_service = now
     service_record.time_last_finished_service = None
     duration = alarm_data.end_time - now.time_since_beginning_of_week()
     min_duration = service_npc_type.min_duration_left_for_arrival_on_lot()
     if duration < min_duration:
         service_npc_type.fake_perform(household)
         return
     min_duration = service_npc_type.min_work_duration()
     max_duration = service_npc_type.max_work_duration()
     duration = clamp(min_duration, duration.in_minutes(), max_duration)
     guest_list = SituationGuestList(True)
     if preferred_sim_id is not None:
         guest_list.add_guest_info(SituationGuestInfo.construct_from_purpose(preferred_sim_id, situation_type.default_job(), SituationInvitationPurpose.PREFERRED))
     situation_creation_params_writer = PropertyStreamWriter()
     situation_creation_params_writer.write_uint64('household_id', household.id)
     situation_creation_params_writer.write_uint64('service_npc_type_id', service_npc_type.guid64)
     if user_specified_data_id is not None:
         situation_creation_params_writer.write_uint64('user_specified_data_id', user_specified_data_id)
     situation_creation_params_writer.write_bool('is_recurring', situation_creation_params.is_recurring)
     self._situation_id = services.get_zone_situation_manager().create_situation(situation_type, guest_list, user_facing=False, duration_override=duration, custom_init_writer=situation_creation_params_writer)
开发者ID:johndpope,项目名称:sims4-ai-engine,代码行数:34,代码来源:service_npc_manager.py


示例12: make_greeted

def make_greeted(opt_sim:OptionalTargetParam=None, _connection=None):
    sim = get_optional_target(opt_sim, _connection)
    if sim is None:
        sims4.commands.output('Invalid sim: {} provided.'.format(opt_sim), _connection)
        return
    situation_manager = services.get_zone_situation_manager()
    situation_manager.make_waiting_player_greeted(sim)
开发者ID:johndpope,项目名称:sims4-ai-engine,代码行数:7,代码来源:situation_commands.py


示例13: _advance_situations_to_postfire

 def _advance_situations_to_postfire(self):
     situation_manager = services.get_zone_situation_manager()
     if situation_manager is not None and self._situation_ids is not None:
         for situation_id in self._situation_ids.values():
             situation = situation_manager.get(situation_id)
             while situation is not None:
                 situation.advance_to_post_fire()
开发者ID:johndpope,项目名称:sims4-ai-engine,代码行数:7,代码来源:fire_service.py


示例14: destroy_situation

def destroy_situation(situation_id, _connection=None):
    sit_man = services.get_zone_situation_manager()
    if situation_id is None:
        sims4.commands.output('No situation id specified.  Valid options are: ', _connection)
        _list_situations(sit_man, _connection=_connection)
        return
    sit_man.destroy_situation_by_id(situation_id)
开发者ID:johndpope,项目名称:sims4-ai-engine,代码行数:7,代码来源:situation_commands.py


示例15: trigger_walkby

def trigger_walkby(_connection=None, command_type=sims4.commands.CommandType.DebugOnly):
    situation_id = services.current_zone().ambient_service.debug_update()
    if situation_id is not None:
        situation = services.get_zone_situation_manager().get(situation_id)
        sims4.commands.output('Created ambient situation: {}.{}'.format(situation, situation_id), _connection)
    else:
        sims4.commands.output('Did not create ambient situation. There are no types of walkbys that are available at this time.', _connection)
    return True
开发者ID:johndpope,项目名称:sims4-ai-engine,代码行数:8,代码来源:autonomy_commands.py


示例16: automation_list_active_situations

def automation_list_active_situations(situation_id:int=None, _connection=None):
    sit_man = services.get_zone_situation_manager()
    sit = sit_man.get(situation_id)
    if sit is None:
        sims4.commands.automation_output('SituationInfo; Exists:No', _connection)
        return
    sims4.commands.output('SituationInfo; Exists:Yes, Id:{}, ClassName:{}, NumSims:{}, Level:{}, Score:{}, State:{} '.format(sit.id, sit.__class__.__name__, len(sit._situation_sims), int(sit.get_level()), sit.score, sit.get_phase_state_name_for_gsi()), _connection)
    sims4.commands.automation_output('SituationInfo; Exists:Yes, Id:{}, ClassName:{}, NumSims:{}, Level:{}, Score:{}, State:{}'.format(sit.id, sit.__class__.__name__, len(sit._situation_sims), int(sit.get_level()), sit.score, sit.get_phase_state_name_for_gsi()), _connection)
开发者ID:johndpope,项目名称:sims4-ai-engine,代码行数:8,代码来源:situation_commands.py


示例17: force_neighbors_home

def force_neighbors_home(_connection=None):
    client = services.client_manager().get_first_client()
    active_household = client.household
    if active_household is not None:
        active_household_home_zone_id = active_household.home_zone_id
        active_household_home_world_id = services.get_persistence_service().get_world_id_from_zone(active_household_home_zone_id)
        send_home = active_household_home_zone_id == services.current_zone().id
        blacklist_until = services.time_service().sim_now + date_and_time.create_time_span(days=7)
        for sim_info in services.sim_info_manager().values():
            if sim_info.is_selectable:
                pass
            sim_info_home_zone_id = sim_info.household.home_zone_id
            sim_info_home_world_id = services.get_persistence_service().get_world_id_from_zone(sim_info_home_zone_id)
            while sim_info_home_world_id == active_household_home_world_id:
                services.get_zone_situation_manager().add_sim_to_auto_fill_blacklist(sim_info.id, blacklist_until=blacklist_until)
                if send_home and sim_info.zone_id != active_household_home_zone_id and sim_info.zone_id != sim_info_home_zone_id:
                    sim_info.inject_into_inactive_zone(sim_info_home_zone_id)
开发者ID:johndpope,项目名称:sims4-ai-engine,代码行数:17,代码来源:developer_commands.py


示例18: on_enter

 def on_enter(self):
     super().on_enter()
     situation_manager = services.get_zone_situation_manager()
     situation_manager.create_situations_during_zone_spin_up()
     services.current_zone(
     ).venue_service.initialize_venue_background_schedule()
     situation_manager.on_all_situations_created_during_zone_spin_up()
     return _ZoneSpinUpStateResult.DONE
开发者ID:johndpope,项目名称:sims4-ai-engine,代码行数:8,代码来源:zone_spin_up_service.py


示例19: _get_blacklist

 def _get_blacklist(self):
     if self._blacklist_sim_ids:
         blacklist = set(self._blacklist_sim_ids)
     else:
         blacklist = set()
     if self._request_priority == BouncerRequestPriority.AUTO_FILL or self._request_priority == BouncerRequestPriority.AUTO_FILL_PLUS:
         blacklist = blacklist | services.get_zone_situation_manager().get_auto_fill_blacklist()
     return blacklist
开发者ID:johndpope,项目名称:sims4-ai-engine,代码行数:8,代码来源:bouncer_request.py


示例20: show_blacklist

def show_blacklist(_connection=None):
    situation_manager = services.get_zone_situation_manager()
    blacklist = situation_manager.get_auto_fill_blacklist()
    for sim_id in blacklist:
        sim = services.sim_info_manager().get(sim_id)
        while sim is not None:
            span = situation_manager.get_remaining_blacklist_time_span(sim.id)
            sims4.commands.output('{} : {} remaining'.format(sim, span), _connection)
开发者ID:johndpope,项目名称:sims4-ai-engine,代码行数:8,代码来源:situation_commands.py



注:本文中的services.get_zone_situation_manager函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python services.object_manager函数代码示例发布时间:2022-05-27
下一篇:
Python services.get_instance_manager函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap