Skip to content

Lock Interactions based on custom criteria #4

@SiliconOrchid

Description

@SiliconOrchid

Not sure if this one is a bug or a feature request.... ;-)

My understanding (which hands-up, may be completely wrong) is that the locking mechanism provided in CommonCore.SimpleInteraction by CanPerform(...) and LockInteraction(...), is based on an agent (or number of agents) "currently interacting with a smart object".

Question:
Is there a way to temporarily include/exclude an interaction based on some other custom criteria ?

Usage Scenario:

  • In the demo we have a TV, with a TVInteraction_TogglePower interaction.
  • If there are no, or not-many, other actions for the agent to select, currently it seems that the agent will keep arbitrarily toggling the power.
  • This behaviour is masked in the demo, as there are a large number of alternative actions/interactions to select.
  • It would be useful to be able to add object-specific code, such as a cooldown timer to prevent the switch being repeatedly toggled), that interacts with the SmartObjects' CanPerform(...) availability.

To reproduce:

  • With a fresh clone of the demo.
  • Disable all smart objects, apart from "LargeObject_TV" and "LargeObject_BookShelfRight". The intention is to keep the agent focussed on just two distinct objects.
  • In the LargeObject_TV object, fully remove the components TVInteraction_ChangeChannel and both TVInteraction_Watch. Leave the only interaction as TVInteraction_TogglePower (also leaving SmartObject_TV and other Unity stuff). The intention is that the agent can only perform the instantaneous "power toggle". Note: Don't just disable the components, otherwise they remain in effect.
  • Using console, observe the agent toggle the power status a random number of times, before they eventually elect to go to the bookshelf instead.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions