Forum rules - please read before posting.
Tech questions during the weekend? Drop in on the community Discord channel!

Version 1.72 - Inventory overhaul and all-round refinements

A large update, but with a focus on refinement and small bugfixing over major features. Of note:

Inventory overhaul

This is more on the back-end of things, so skip over this if you're not relying on custom inventory scripting. If you are, though, this update makes many changes to the API to make the inventory system more stable and extensible. Where possible, the API has remain unchanged to aid scripters, though details and an upgrade guide can be found here: https://www.adventurecreator.org/tutorials/inventory-systems-v172-update - though if you have existing scripts that break, please post in Technical Q&A and I will advise.

image

As a demonstration of the kind of thing this new system brings, a "Shop system" package is now available on the Downloads page.

Conversaton camera system

image

This isn't actually part of the release, but out at the same time. This Downloads package demonstrates one way to build a dynamic camera system when two characters speak - creating and cutting shots automatically. It won't beat properly-directed camerawork, but should help where a game has many NPCs and dynamic conversations.

«1

Comments

  • And the full Changelog:

    Upgrade notes

    • The Inventory system has been rewritten - coders can learn more here: https://www.adventurecreator.org/tutorials/inventory-systems-v172-update
    • The Action class's GetVariableReferences function now has an additional optional integer parameter
    • The "Moveable: Set track position" Action's "Movement speed" value is no longer bound by the Draggable object's "Max speed"
    • The GetHotspotPrefixLabel function has been moved from RuntimeInventory to InventoryManager
    • The ISaveFileHandler interface has a new function, GetSaveFile, that returns a SaveFile class
    • RuntimeInventory's CanTransferContainerItemsToInventory parameters have been updated to reflect the new inventory system
    • The OnContainerAdd, OnContainerRemove and OnContainerRemoveFail events now take an InvInstance parameter instead of a ContainerItem
    • The OnInventoryDeselect event is now triggered even if the item is not present in the Player's inventory
    • The Button class's GetFullLabel now requires an additional InvInstance parameter
    • The appearance of the selected inventory item's "display count" is now set in the Cursor Manager, as opposed to being copied from the Inventory menu
    • The RuntimeInventory script's Look, Use, RunInteraction and Combine functions have been moved to InvInstance - use GetInstance to access inventory instances
    • The Settings Manager's options for examining inventory items when drag-dropping is now separated into two separate fields
    • Options related to Music and Ambience have been moved from the MusicEngine and AmbienceEngine prefabs to the Music and Ambience storage windows

    Inventory

    • Added: Overhaul to the inventory system, allowing for easier customisation through scripting - see https://www.adventurecreator.org/tutorials/inventory-systems-v172-update
    • Added: "Slot capacity" property to Inventory items - this replaces "Use separate slots?", and can be used to limit how many of a given item can be stored in a slot
    • Added: "Selection mode" property to inventory items that can have multiple instances - use to allow stacking when clicking multiple times
    • Added: "_Alt" variants of all Inventory events - use to access the affected InvInstance classes, as opposed to InvItem
    • Added: The selection of inventory items in a given InventoryBox element is now optional
    • Changed: The appearance of the selected inventory item's "display count" is now set in the Cursor Manager, as opposed to being copied from the Inventory menu
    • Changed: Runtime changes made to Inventory items in the Inventory Manager are now reflected in-game without a need to restart the game
    • Changed: The OnInventoryDeselect event is now triggered even if the item is not present in the Player's inventory
    • Changed: GetHotspotPrefixLabel has been moved from RuntimeInventory to InventoryManager
    • Changed: Removed unnecessary alternatives to RuntimeInventory's RunInteraction function
    • Changed: Inventory Items (InvItem) are no longer created at runtime - instead, instances are created (InvInstance) that reference them
    • Changed: RuntimeInventory's CanTransferContainerItemsToInventory parameters have been updated to reflect the new inventory system
    • Changed: The RuntmeInventory script's Look, Use, RunInteraction and Combine functions have been moved to the new InvInstance class
    • Changed: The Settings Manager's options for examining inventory items when drag-dropping is now separated into two separate fields
    • Fixed: Inventory drag-and-drop being available if inventory cursor-cycling is enabled, as the two modes are incompatible
    • Fixed: GetNumberOfItemsCarriedInCategory not accounting for category ID when accessing an inactive Player's inventory
    • Fixed: Issue when right-clicking over inventory items if "Reset cursor after an interaction?" is checked
    • Fixed: OnInventoryRemove event being triggered before the item has been removed from the Inventory

    Draggable objects

    • Added: Ability to manually begin and end the dragging of objects through custom script
    • Added: Deceleration to Draggable objects that move along tracks without use of a Rigidbody
    • Added: Warning message if a Draggable object's OnMove ActionList blocks gameplay
    • Added: Ability to limit the interactivity of draggable objects by camera
    • Added: The 'AC Status' box now lists the active Draggable
    • Fixed: Draggable "Simulated mass" property not having an effect when its Track's movement is based on cursor position
    • Fixed: Disabled Draggables sometimes being interactive if another Draggables is parented to them
    • Fixed: Draggable and PickUp ActionList assets not being included in searches
    • Fixed: Behaviour of Draggable object "Move" and "Collide" audio playback
    • Fixed: PickUp and Draggable collision settings sometimes being ignored
    • Fixed: Camera dragging being allowed if the same drag was previously affecting a Draggable object

    Drag tracks

    • Added: Ability to restrict Drag object movement to only one direction along a Track
    • Added: "Moveable: Toggle track region" - use to enable or disable a Track's region
    • Added: Ability to apply a gravitational force to Draggables that are locked to Tracks
    • Added: Ability to assign labels to Drag Track regions, displayed when referenced in Actions
    • Added: Remember Track component - use to save the state of a Drag Track
    • Added: Ability to assign an optional Track to check for in the "Moveable: Check Track position" Action
    • Changed: The DragTrack class's AssignColliders function is now protected
    • Changed: The "Moveable: Set track position" Action's "Movement speed" value is no longer bound by the Draggable object's "Max speed"
    • Fixed: Improved behaviour of draggables on Hinge Tracks that move according to the cursor position
    • Fixed: Drag Track regions not being visible in the Scene window unless snapping is enabled
    • Fixed: Straight track lengths varying slightly when viewed in the Scene window

    Interactions

    • Added: Ability to hide interaction icon labels when no item or Hotspot is selected in Choose Interaction Then Hotspot mode
    • Added: Ability for single-interaction Hotspots to require double-clicking to use
    • Added: Ability to limit Hotspot-based InventoryBox elements by category as well as interaction
    • Added: Option to halt Player movement upon running Inventory item interactions
    • Added: Ability to classify Hotspot and Inventory items as pronouns - if not, their names will be lower-cased when used inside sentences
    • Changed: The Button class's GetFullLabel now requires an additional InvInstance parameter
    • Fixed: Hotspot cursors from showing when in Choose Interaction Then Hotspot mode if "Change cursor based on Interaction?" is checked
    • Fixed: Interaction menus turning off without transitioning when combining Hotspots with Inventory items
    • Fixed: Various interaction settings missing from the Settings Manager when using Touch Screen input
    • Fixed: Display issues with the "Hotspot: Change interaction" Action
    • Fixed: Inventory interactions not cancelling a pending Hotspot interaction
  • edited October 1

    Movement

    • Added: Ability to run by double-clicking when using Straight To Cursor movement
    • Fixed: Issues with "Character evasion" when a NavMesh has multiple Polygon Collider 2D components

    Variables

    • Fixed: Options-linked variables not always resetting upon switching profile
    • Fixed: "Variable: Set" Action not supporting parameter tokens when setting a String variable's value
    • Fixed: "Find references" operation for Variables components not searching ActionList assets
    • Fixed: Global variables not being accessible if referenced by a Menu that is enabled when the game begins

    Sound

    • Added: "Only play when moving?" option to the Footstep Sounds component
    • Changed: Options related to Music and Ambience have been moved from the MusicEngine and AmbienceEngine prefabs to the Music and Ambience storage windows
    • Fixed: "Sound: Play music" and "Sound: Play ambience" Actions not showing "After running" option if no music or ambience is defined
    • Fixed: Issues related to crossfading of music and ambience tracks
    • Fixed: Music and Ambience data not clearing when using the Restart Game command
    • Fixed: Footstep Sounds component's "Only play when grounded?" option being hidden
    • Fixed: Issues with music and ambience playback if "Run In Background" is unchecked in Unity's Player settings

    Navigation

    • Added: Improvements to off-NavMesh click accuracy for 2D games in Unity 2019.1 or newer
    • Fixed: Pathfinding issue when a Remember NavMesh2D component is added to a NavMesh that is not the scene's default

    Camera

    • Added: Ability to use an Animation curve to the "Camera: Shake" Action to describe the intensity of the shaking effect over time
    • Added: Option to MainCamera Timeline tracks to update the attached camera once the Timeline ends
    • Fixed: Main Camera track not calling the OnSwitchCamera event when transitioning back to the regular camera
    • Fixed: OnSwitchCamera event being triggered twice when beginning a scene
    • Fixed: Issue with draggable cameras when the Camera system is disabled
    • Fixed: "Last gameplay camera" sometimes not being properly recorded in v1.71.0
    • Fixed: 2D cameras not responding to "Object: Teleport" Actions

    ActionLists

    • Added: Ability to log Action comments in the Console even if they are hidden from view
    • Changed: The Action class's GetVariableReferences function now has an additional optional integer parameter
    • Fixed: ActionList asset parameter values not being able to be set in OnStart cutscenes (Editor only)
    • Fixed: Issue when changing an ActionList's Source property to Asset File
    • Fixed: Actions sometimes widening in the ActionList Editor

    Editor

    • Changed: The Settings Manager's "Show icons in Hierarchy" option has been moved to the Player Settings
    • Fixed: Display issue with the "Engine: Control Timeline" Action
    • Fixed: AC Status box being drawn underneath AC Menus
    • Fixed: Compilation error when using Unity 2020.2
    • Fixed: Minor Editor styling issues

    Additive scenes

    • Added: The 'AC Status' box now lists scenes if multiple are open simultaneously
    • Added: Ability to add non-AC scenes additively using the "Scene: Add or remove" Action, provided it has a SubScene component configured in it
    • Fixed: "Scene: Add or remove" Action's "Run 'Cutscene on start'?" option not firing ActionList asset-based scene cutscenes
    • Fixed: ActionList Starter component not reacting when placed in scenes added using the "Scene: Add or remove" Action

    Save system

    • Added: OptionsFileFormatHandler_SystemFile class - use to save options and profile data as files on the machine, as an alternative to PlayerPrefs
    • Added: Ability to manually save and load save-game files with negative ID values - hidden from SavesList elements, but accessable through script
    • Added: Option to separate save files and options data generated by the Editor from those used by Builds on the same machine
    • Changed: The ISaveFileHandler interface has a new function, GetSaveFile, that returns a SaveFile class
    • Fixed: Error when viewing the Save-game file Manager while save-screenshots are enabled
    • Fixed: Remember components having an effect on an object's initial state when disabled
    • Fixed: Remember components handling data if their component is disabled in the Inspector

    Menus

    • Added: Option to directly-navigate Menus during Cutscenes
    • Added: The "Object: Visibility" Action and "Remember Visibility" component are now compatible with UI Canvas components
    • Added: Ability to find references made to Menus and Menu Elements
    • Fixed: Hover sounds not playing when directly-navigating Unity UI menus
    • Fixed: "Unity UI blocks interaction and movement?" option sometimes causing a crash if no Menu uses Unity UI
    • Fixed: OnMouseOverMenu event not triggering when directly-navigating Unity UI menus
    • Fixed: Issue related to the selection of Menu elements during Cutscenes

    Crafting

    • Added: "Behaviour after taking" property to Crafting elements that display ingredients
    • Added: UI improvements to the Crafting panel in the Inventory Manager
    • Fixed: Issue when modifying the number of slots of Crafting elements

    Containers

    • Added: Ability to rely on custom scripting for a Container's click behaviour
    • Added: Ability to open a Container in a specific InventoryBox element with the "Container: Open" Action
    • Added: Option to transfer items from one Container to another using the "Container: Add or remove" Action
    • Added: Improved behaviour of InventoryBox menu elements when an item from a Container is selected
    • Changed: The OnContainerAdd, OnContainerRemove and OnContainerRemoveFail events now take an InvInstance parameter instead of a ContainerItem
    • Fixed: Prevented the "Container: Open" Action from having an effect if the Container is disabled
    • Fixed: The "Container: Check" Action ignoring multiple instances of the same item when counting

    Misc

    • Added: Ability for the "Document: Open" Action to wait until the chosen Document has been closed
    • Added: OnTeleport event - called when an object has been teleported using the "Object: Teleport" Action
    • Changed: Removed limits on the "Input: QTE" Action's "Duration" field
    • Changed: The "Object: Teleport" Action no longer requires a "Teleport to" Marker if the position is relative to a fixed value or variable
    • Changed: Re- Added Conversation script's IsActive function after it was removed in v1.71.0
    • Fixed: Issues with "Character: Animate" and "Object: Animate" Actions that wait before finishing in Unity 2019.1 or later
    • Fixed: Minor cursor display issues

    Thanks to the testers on helping with the release.

  • edited October 2

    Hi Chris. I've updated to this version of AC. Immediately I got a new red error in the console. It is the only error upon updating to this version of AC.

    Assets\AdventureCreator\Scripts\Static\UltimateFPSIntegration.cs(286,6): error CS0200: Property or indexer 'MainCamera.attachedCamera' cannot be assigned to -- it is read only

    I am using Unity 2020.1.7f1 and the most recent version of the old UFPS (not UFPS 2).

    I have quit and restarted Unity and the error still persists. I have also reimported UFPS.

    When I comment out the line in the affected script (UltimateFPSIntegration.cs) it compiles cleanly and I can play test the game; but upon playing, red errors from PlayerInput.cs begin to pop up en masse.

  • Thanks for the details - yes, commenting out that line is the way to go.

    red errors from PlayerInput.cs begin to pop up en masse.

    Can you share these in full, stacktrace included?

  • edited October 2

    Here is the red console error, with stacktrace set to Full:

    NullReferenceException: Object reference not set to an instance of an object
    AC.PlayerInput._FixedUpdate () (at Assets/AdventureCreator/Scripts/Controls/PlayerInput.cs:1994)
    AC.StateHandler.FixedUpdate () (at Assets/AdventureCreator/Scripts/Game engine/StateHandler.cs:352)

    It appears 36 times in a single chunk when playtesting in Unity; all identical errors. Nothing is seemingly out of the ordinary when I move around and interact with the scene.

    I haven't modified these scripts in any way. I also created a new blank scene, organized the scene objects without folders, and playtested that; same 36 red errors.

  • Thanks - it looks related to the MainCamera.

    Does your AC MainCamera has the "MainCamera" tag? And what is the state of your Settings Manager's "Cache 'Camera.main' variable?" option?

  • Yes, the scene's default AC camera is tagged as MainCamera.

    The state of the Cache Camera Main variable is unticked/false. As a random test I ticked it and nothing different seemed to happen.

    And to revise what I noted in my previous comment, there is in fact a slight difference in player movement: the walk speed is slower, and to bring it back to speed I have to increase the float slider of the UFPS 'motor' setting in the player controller.

  • Yes, the scene's default AC camera is tagged as MainCamera.

    What about at runtime? Both UFPS and AC have their own MainCamera objects - or do you have this issue when running a scene without UFPS.

    there is in fact a slight difference in player movement

    What version were you updating from? Let's please move to a new thread for these.

  • Thanks for including my requests, Chris! I haven't tested the ambience/music crossfanding behaviour yet, but the pronouns option is great, and so is saving profiles to files instead of playerprefs.

  • Forgive my replying directly to this thread here, for some reason, the confirmation email is just not getting through!

    I've just gotten going with AC, and want to go SCUMM style, but I think some of the changes may have broken the nine-verb template?

    "Changed: GetHotspotPrefixLabel has been moved from RuntimeInventory to InventoryManager"

    After importing the nine-verb template and attempting to run the demo after assigning managers etc. I get two compile errors

    **Assets/AdventureCreator/Downloads/Nine verbs template/Scripts/ScummInterface.cs(113,27): error CS7036: There is no argument given that corresponds to the required formal parameter '_language' of 'Button.GetFullLabel(Hotspot, InvInstance, int)'
    **

    and

    **Assets/AdventureCreator/Downloads/Nine verbs template/Scripts/ScummInterface.cs(237,38): error CS1061: 'RuntimeInventory' does not contain a definition for 'Combine' and no accessible extension method 'Combine' accepting a first argument of type 'RuntimeInventory' could be found (are you missing a using directive or an assembly reference?)
    **

    Forgive my first post both A) being a reply to this and B) Probably me being dumb and running before I can walk!

    Best

    G

  • Welcome to the community, @greyskull.

    for some reason, the confirmation email is just not getting through!

    Sorry for the trouble - I've verified your account manually.

    After importing the nine-verb template and attempting to run the demo after assigning managers etc. I get two compile errors

    The nine-verbs template needs to be re-downloaded to be compatible with this update. I've re-uploaded the latest package, so give it another try.

  • Genius, many thanks indeed Chris. I took this time to pull up my sleeves, put on my big boy pants, and did a bit of DIY, and think I'm 80 percent there, and now far more familiar with AC. Thanks Again.

    Guy

  • @ChrisIceBox

    Excellent work, there are some really nice features/improvements added.

    FYO: No issues this side, working like a charm.

  • Thanks for the feedback, @monotonic. A few teething errors sorted:

    Version 1.72.1

    • Added: Ability to assign a background sprite to set a GameCamera 2D's constraints automatically
    • Added: Option to allow cursor-cycling when the game is paused, should the current interaction settings allow for it
    • Added: If the direct-navigation of gameplay menus is disabled while such a menu is being navigated, that menu is now de-selected
    • Added: Ability to configure the widths of labels in Managers and other AC Editors
    • Changed: The Subtitle menu property "Duplicate for each line?" has been removed for the "Unity UI in Scene" Source option, as the two modes conflict
    • Fixed: Error when switching scene with an overlay in some versions of the Unity Editor
    • Fixed: Compilation error with legacy UFPS integration
    • Fixed: Error when positioning Hotspot menus over Inventory items in v1.72.0
    • Fixed: Inventory items becoming inadvertently selected when cycling cursors in v1.72.0
    • Fixed: Characters not moving if they have an Animator that applies root motion but no Animator Controller assigned
    • Fixed: "Head Turn" Timeline tracks not firing the OnSetHeadTurnTarget and OnClearHeadTurnTarget custom events
  • edited October 11

    Hi @ChrisIceBox For some reason after the update, the camera crossfade effect has stopped working. Now the crossfade effect occurs immediately. Regardless of the amount of transition time set, or the type of transition curve...

    Could it be due to some kind of bug on the texture related to this latest update?

    Console:

    Cannot crossfade as the crossfade texture was not succesfully generated.

    -> AC debug logger
    UnityEngine.Debug:LogWarning(Object, Object)
    AC.ACDebug:LogWarning(Object, Object) (at Assets/AdventureCreator/Scripts/Static/ACDebug.cs:33)
    AC.MainCamera:DrawCameraFade() (at Assets/AdventureCreator/Scripts/Camera/MainCamera.cs:526)
    AC.StateHandler:_OnGUI() (at Assets/AdventureCreator/Scripts/Game engine/StateHandler.cs:456)
    AC.StateHandler:OnGUI() (at Assets/AdventureCreator/Scripts/Game engine/StateHandler.cs:363)
    UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

    Unity version: 2019.4.8f1
    AC version: 1.72.1a

  • @Dave: Is this occuring in the Editor, or in builds, or both, and what platform are you working on/building to?

  • @ChrisIceBox Yes, in both. Editor and build. The platform is PC, Mac & Linux Standalone.

  • Recreated, thanks.

  • edited October 14

    @ChrisIceBox Great! Waiting for the fix :smiley:

  • @Dave: Give the latest update a try:

    Version 1.72.2

    • Added: Label elements now support line breaks
      -Changed: The "Inventory: Select" Action's "Add if not held?" option has been replaced with a "Carry condition" PopUp field
    • Fixed: Display issue with the Music and Ambience storage windows
    • Fixed: Issue with directly-navigating Pause menus that turn on during a cutscene
    • Fixed: Issue when setting preset values for PopUp variables that rely on Label presets
    • Fixed: Minor display issue with Action output sockets
    • Fixed: Inventory items sometimes disappearing when being re-ordered
    • Fixed: Inventory items not stacking when being added in v1.72.0
    • Fixed: "Camera: Crossfade" Action causing an instant transition in v1.72.0
    • Fixed: PickUp objects moving incorrectly in v1.72.0
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.