Forum rules - please read before posting.

Handle inventory item being used on 'nothing'

Hi AC,

Just wondering what would be the best way to handle the following situation: We have a scenario where, when the player talks to this NPC, the cursor changes to a different icon. To do this, we're using a hidden inventory item.

From here, the player then can "use" this item on other hotspots in the scene. If they use it on the incorrect spot, we play a "No" animation and then reselect the inventory item (thus, forcing them to continue using it).

However, when the player clicks on a non-hotspot (ie, they move), the inventory item selected will become unselected and the player will move. We essentially want to force the player to always have this inventory item equipped.

Alternatively, we thought about just changing the main cursor to the icon and preventing player movement. Would that be possible instead?

Thanks!


Comments

  • You can use the Engine: Manage systems to temporarily disable movement.  This will prevent the player from moving when not clicking on a Hotspot.

    You can also un-check the Can move player if an Item is active? field in the Settings Manager to prevent movement at this time.

    This, and all fields in the Managers (including the main cursor icon), can be changed at runtime through script.  Just right-click on a field's label, and you'll get an API reference to modify it through code.
  • Thanks for the update. I should mention that this was for a 2D game.

    I had a look at the Demo_SettingsManager and did find that option, but it was not available in the Demo2D_SettingsManager.
  • Ah, sorry, I see what you  mean. It's still accessible via scripting:

    AC.KickStarter.settingsManager.canMoveWhenActive = false;

    Thanks!
  • It should be the case that only the fields visible in the Settings Manager have an effect on the game in question.  This particular field is only visible when drag-and-drop and "Left-click deselects active item?" are both unchecked.
  • That worked perfectly, thank you for your help!
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.