Forum rules - please read before posting.

Version 1.47 - Scripting guide, tint maps, new movement options

edited August 2015 in Official news
Grab a drink and pull up a chair, this is a big one..

Scripting guide
As AC's scope becomes wider, it's clear that there's becoming a greater need for coders to be able to integrate their own scripts / assets with AC.  This update introduces the Scripting guide, which provides a breakdown of all of AC's classes, public functions and public variables.  A link to this guide is also provided in AC's top toolbar within Unity.

Some users, particularly those coming from an AGS background, have also expressed an interest in being more easily able to hand-code Interactions.  So, new functions have been added, and a full tutorial that covers the conversion of one of the Demo game's Interactions into a script can be found here.

Tint maps
This one's down to the excellent discussion over on this thread - sprites in Unity 2D games can now be tinted according to their position in a scene, allowing for some nice lighting effects without the need for custom shaders or sprite lighting assets.  A tutorial on using them can be found here.

Facial expressions
This one's for Mecanim characters and those that speak using portrait graphics: expressions can now be defined within a character's Inpector, and they can be called upon using tokens within their speech lines - allowing for portrait-switching (or a Mecanim integer parameter) to change midway through talking.  Thanks to @Eastman for the suggestion.  Again, a tutorial on this feature can be found here.

New movement options
Nothing major, but there's a fair few new options to be found - based on your chosen Movement method.  See the changelog below for the full list, but the main additions are improved 1st-person movement on mobile devices, and the ability to only move 2D characters when they change animation frame (equivalent to AGS's "anti-glide mode").

Variable presets
A very useful feature when testing - now you can define preset values for all your Global and Local variables, and bulk-assign them at any time. Thanks to @Ressie for the suggestion.

Those links again: Thanks also go to @humaldo this time around for some invaluable pre-release testing.

Full changelog below.  As ever, back up before upgrading, and happy dev-ing!
«1

Comments

  • Upgrade notes
    • The “Scrolling subtitle text” option in Speech Manager has been split into separate speech and narration options
    • Interaction icons can no longer by clicked with the right-mouse button
    • Mecanim characters no longer have a “Rely on root motion?” checkbox - this is inferred by the Animator
    • PlayerMenus.RecalculateAll () is no longer a static function
    • The InventoryBox menu element type “Hostpot Based” has been renamed to the correct “Hotspot Based”
    Scripting
    • Added: Scripting guide - get descriptions of all public AC functions and variables at adventurecreator.org/scripting-guide
    • Added: New script functions to easily enter and exit a cutscene through script
    • Fixed: KickStarter script’s TurnOffAC () function not completely disabling Adventure Creator
    Debugging
    • Added: Ability to mark an Action as a breakpoint, which causes the game to pause just before the Action is run (Editor only)
    • Added: Text entered in the “ActionList: Comment” Action can now span multiple lines
    Tint maps
    • Added: Tint maps - Sprites used in Unity 2D games can have their colours tinted based on their position in a scene, see section 8.9 of the manual.
    • Added: “Object: Change Tint map” Action - use to change which Tint map a FollowTintMap component follows, or the intensity that it is affected by it
    • Added: “Engine: Change scene setting” Action can be used to change the scene’s Tint map
    • Added: “Remember Visibility” component can be used to record changes made using the “Object: Change Tint map” Action
    Variables
    • Added: Variable presets - Global and Local Variables can be given preset values that can be assigned in bulk at any time
    • Added: “Variable: Assign preset” Action - use to assign all Global or Local Variables to preset values
    • Added: Variable tokens can now be used in Journal menu elements
    Movement
    • Added: “Minimum run distance” field to all character’s Movement settings - use to ease character speed as they near their destination
    • Added: Ability to only move 2D characters when the sprite changes (equivalent to AGS’ “anti-glide” mode)
    • Added: Ability to override the global “Vertical movement factor” setting per-scene, used in 2D games to reduce vertical move speed
    • Added: Ability to control touch screen first-person games by using one touch to look, two touches to move
    • Added: Option for Sprites Unity Complex characters to slow movement when they near 2D wall colliders
    • Added: Ability to turn Player instantly when moving with Direct control - works well for 2D games
    • Added: “Input magnitude affects speed?” option for Direct control now affects tank-turning as well, allowing for smooth rotations
    • Added: Option to use tank-turning with First Person movement - useful for keyboard-only first-person games
    • Changed: The “Touch-drag affects” field in Settings Manager for first-person games has been changed to “First person movement”
    • Changed: Mecanim characters no longer have a “Rely on root motion?” checkbox - this is inferred by the Animator
    • Fixed: Characters not always stopping when told to if “Experimental super-accurate” destination accuracy is enabled
    Camera
    • Added: Section to Manual explaining how to convert the MainCamera to work with VR projects
    • Added: GameCamera Third Person’s pitch and spin axes can now be simulated
    • Added: “Camera: Rotate third-person” Action - use to rotate a GameGamera Third Person to a fixed angle
    • Added: “Camera: Shake” Action’s fields can now be parameterised
    • Fixed: Roll rotations assigned to GameCamera Third-Person being incorrect
    • Fixed: “Camera: Shake” Action not being skippable
    • Fixed: “Overlay current screen” option in “Engine: Change scene” Action no longer working
    Menus
    • Added: Option to set a MenuJournal’s first open page to the one being previewed in it’s properties panel
    • Fixed: Menu text effects not always being correct colour if rich text is used
    • Fixed: Unity UI-based Menus set to Appear At Cursor And Freeze not being correctly positioned at some resolutions
    • Fixed: Error when saving a game that has no manually-controlled Menus
    • Fixed: Menus set to appear “On Interaction” not being able to pause gameplay
    • Fixed: Error when using Menu text effects on an empty label
    Interactions
    • Added: “Hotspot: Check interaction enabled” Action - use to determine if any Hotspot’s interaction is enabled
    • Changed: Interaction icons can no longer by clicked with the right-mouse button
    • Fixed: Rare issue with interaction icons not running their Interactions when clicked
    • Fixed: Rare issue with interaction icons being displayed inappropriately
    • Fixed: Rare issues with Touch Screen interactions
    Speech
    • Added: Facial expressions - character portraits and an integer Mecanim parameter can be changed on the fly using speech tokens
    • Added: Ability to limit Menus that appear “When Speech Plays” to either normal or background speech only
    • Changed: The “Scrolling subtitle text” option in Speech Manager has been split into separate speech and narration options
    • Fixed: Overriding Conversations not always running if a non-overriding Conversation was run beforehand
    • Fixed: Asset-based “Dialogue: Start Conversation” Action not being able to override a scene-based Conversation
    • Fixed: Subtitle scrolling speeds varying with frame-rates
    Inventory
    • Added: An inventory item’s properties box now lists any inventory items that make reference to it with their own combine interactions
    • Added: Option for InventoryBox elements of type “Hotspot Based” to only list items referenced in the Hotspot’s interactions (enabled by default)
    • Added: Ability to run a specific ActionList that runs when a Recipe is completed, regardless of whether or not the Player clicks on the resulting item
    • Fixed: Inventory item names showing in Hotspot label when hovering over an InventoryBox that displays text only
    • Fixed: “Active texture” property of Inventory items not always showing in Inventory Manager based on chosen inventory settings
    • Fixed: Game freezing if a crafting recipe has no ingredients defined
    • Fixed: The InventoryBox menu element type “Hostpot Based” has been renamed to the correct “Hotspot Based”
    • Fixed: Various issues with InventoryBox menu elements of type “Hotspot Based”
    • Fixed: InventoryBox elements not updating properly if they are visible when switching to a new Player prefab mid-game
  • edited August 2015

    Moveables
    • Added: Draggable and PickUp objects can now reduce the player’s movement speed when manipulated
    • Fixed: Errors with “Disable free-aim when dragging?” feature when using Ultimate FPS
    • Fixed: Draggable and PickUp objects still being moveable if the interaction system is disabled
    Other
    • Added: “Object: Check visibility” Action - use to check if an object is
      visible either in the scene or through the current camera
    • Added: Various performance improvements
    • Added: Option to assume all available inputs are defined - this increases
      performance, but will cause errors if inputs are undefined
    • Added: Option to also teleport the active GameCamera when teleporting the Player with the “Object: Teleport” Action
    • Changed: The sliders in “Engine: Pause game” and “Camera: Shake” Actions are now number fields, not sliders
    • Fixed: Inconsistent behaviour when using the LimitVisibility and RememberVisibility components on the same object
    • Fixed: “Sound: Play one-shot” Action not ending the sound when skipped
    • Fixed: Error when using the “Object: Add or remove” Action to delete an object during a collision
    • Fixed: Minor issues with the “Object: Fade sprite” Action
    • Fixed: Sprites Unity Characters not being able to play custom animations if their Animator is on the root GameObject
    • Fixed: “Ignore if already playing” option in “Sound: Play” Action sometimes inappropriately preventing a sound from playing
    • Fixed: Errors when switching Player prefab as soon as a scene begins
    • Fixed: Effects of “Engine: Change scene setting” no longer being restored from save game files
    • Fixed: Marker parameter not being assigned in “Object: Transform” Action
  • The full classes references, the tint maps, and the anti-glide are three things that alone would made me figuratively jump on my chair. But there is also all the rest. And the PDF documentation, always up-to-date.

    I think not enough words have been spent for praising the quality of your work, this is absolutely amazing. Thank you for delivering such this high quality so often! 
  • edited August 2015
    Wow lots of new features, many many many thanks Chris!
    This is indeed a rare case where quantity meets quality.
    More power to us! :)
  • Awesome!! 

    Weird thing - my mouse over inventory is pausing the game now/not opening. Thoughts?
  • great update, thanks for your continuing support!
  • Yeah, this is absolutely fantastic support from you, Chris, lots of useful stuff here!

    Found a possible issue with skipping a scrolling text that has an expression token in the middle. In the example below, when I skip, it jumps to the end but doesn't register the expression token, and the subtitle gets stuck after that and I can't click to get past it.

    image
  • @EBlomquist: Do you have more infos on this issue? Tried around with inventories now but didn't find issues. What's your Inventory properties, can you provide a screenshot? thx!
  • Awesome!!!

    The programming interface has become mainstream at last, and with a documented API to boot!

    Thanks. :)

  • Cool update! Thanks a lot Chris. Already playing with the new features :-) 

    With the scripting guide you might get into the unfortunate situation of prioritizing API compatibility over cleanliness and code efficiency. If you need a vote, mine would be to always go for breaking changes. We consumers can probably quickly adapt the coding on our side.

    One issue I found that is new: I deactivate NPCs in a startup script by disabling on certain conditions. That will now throw a lot of errors now in the log (5.2b3). I suspect this is due to the changes in the StateHandler and I need to call GatherObjects? Is there an action for it? 

    An initial workaround is to disable them from the beginning and then activate them ondemand but then their pathfinding does not work anymore. Another way is to teleport them from somewhere. That works currently but is not as efficient since skinning and updating eats a lot of CPU cycles. I'd rather disable them completely.

    Animator is not playing a Playable
    UnityEngine.Animator:SetFloat(String, Single)
    AC.AnimEngine_Mecanim:PlayIdle() (at Assets/AdventureCreator/Scripts/Animation/AnimEngine_Mecanim.cs:616)
    AC.Char:AnimUpdate() (at Assets/AdventureCreator/Scripts/Character/Char.cs:661)
    AC.Char:_Update() (at Assets/AdventureCreator/Scripts/Character/Char.cs:390)
    AC.NPC:_Update() (at Assets/AdventureCreator/Scripts/Character/NPC.cs:87)
    AC.StateHandler:Update() (at Assets/AdventureCreator/Scripts/Game engine/StateHandler.cs:282)

  • @humaldo Here's my menu setup - I have to pause and unpause with another menu to unlock the game. It's a mouseover on the bottom of the screen and pops up. Never had issues with this before. 

     image
  • So I duplicated the menu - and now it works. 
  • It seems that this update has brought back an old bug that I had trouble with a couple of months ago: http://www.adventurecreator.org/forum/discussion/3380/inventory-subtitle-issues

    In a nutshell: inventory hotspot dialogues (item descriptions, in my case), can't be skipped if the mouse cursor is positioned over a hotspot/item/grid location. The cursor has to be in a neutral location for the dialogue to be skipped by clicking the mouse.

    I also have another issue, which is possibly related, so I'll post it here:
    In my game, I have it set up so that labels appear at hotspots whenever the mouse cursor is over them. If I open my inventory while the mouse cursor is hovering over a hotspot in the game world, that hotspot name keeps appearing on my inventory screen, unless I hover the mouse over an inventory item. This doesn't happen if the mouse cursor is not over a hotspot when opening the inventory screen.
  • This is great. Indeed agreed about 'wider scope': I use Adventure Creator (in addition to actual adventure game making) for a number of curious little projects which the interactions and story/puzzle mechanics really help with.
  • @Eastman: Do you mean skipping the line by clicking the mouse, or skipping the whole ActionList it's on by triggering "EndCutscene"?

    @10FingerArmy: Correct - Update functions in the Player, NPC and Char scripts are now called by StateHandler for performance.  Try calling StateHandler's GatherObjects function after changing the enabled state of NPCs - though I may have to introduce a null check in there somewhere.

    @Geometrix: Is your second issue v1.47 related, or was it present beforehand?  Unless your Inventory menu pauses the game, I'd say that sounds like the correct behaviour.
  • @ChrisIceBox: (By the way, should I report bugs here, or do you prefer separate reports in the Engine section?) Skipping the line clicking the mouse. Triggering EndCutscene seems to skip right through everything as it should. Here's what the troublesome part looks like:

    image
  • Found another possible issue with the expression tokens. If I disable Disaply speech forever until user skips it? in the Speech Manager (image below) it will interpret the token text as regular text, and in the example above it will double the time the text is displayed from 6s (without tokens) to 12s (with tokens).

    image
  • Ah, a simply wonderful update! Thank you for the diligent continuing development Chris.

    Now I might stand a better chance of interacting with the AC scripts without breaking so many things. That'll teach me for not paying more attention to the forum, had been nose down in Mono this week so this has come at a perfect time.

    I'd also throw my vote into the same pool as @10FingerArmy regarding a preference for breaking changes in pursuit of cleanliness and efficiency.
  • Ah man, a scripting guide! What a gift! This is really going to help with some nitty-gritty coding stuff, and an overall understanding of how AC works. And I'm a little late to the party but having UnityUI support is really useful too. Especially when working together with Dialogue System, which now also supports UnityUI. Cheers!
  • Thanks for the Script Support, I hope it could help creating some generic behaviors that are very difficult to make with ConstantIDs+Prefabs. I think it could be a great feature for AC. Thanks for make more enhancements! :)
  • @carlosrovira: What do you mean, exactly?  Is there an example you could give?
  • Hi Chris,

    create "generalized" items in AC using the provided tools (ActionLists, ConstantIDs,...) is somehow dificult. I see AC works pretty well building scene specific logic. but I'm looking more for building prefabs that encapsulate all the logic to make it reusable.

    For example. If I would want to make "key" prefab item to reuse "throwing to the scene" instances (so I could have multiple "key items" in a single scene). We should have as well a "door" prefab that encapsulated as well the hotspot or trigger and the mesh and attach the action list.

    But Action list can't live in the prefab and it's not a matter of throw to the scene workflow. You then must configure in the scene configuring the action list and the parameters so the items behaves as expected.

    I would love to have real abstracted items that could be programmed in a prefab and then could be used without the need of further configuration.


  • Hi Chris,

    just to simplify what I want to express. I would want to have a generic "key Object" that would open "doors" without the need to assign a concrete key to a concrete door, without hotspot or trigger configurations. Just program the prefabs and populate the scene throwing the object to it.

    So the player could pick up the object and use it in other object since the later one expect objects of this kind.

    That would make possible a kind of adventures with scenes more dynamic with puzzles where you can take several objects of a type (AC support this already) and could be used in triggers/hotspots that depends on "have the right object" and at least have one in your inventory...

    For example FSMs in Playmaker seems to be more generalist and can be programmed and used all the time. For example if you make a "coin" object with a FSM you could sandbox all the behavior and then reuse the prefab with the FSM without the need to configure in the scene throwing instances in the scene in some textbox in the unity interface for the object.

    Hope this two responses could throw some light about what I think should make AC more powerful. Maybe this could be for a 2.0 release? :)

    Thanks Chris for reading and listening.
  • ^ I've been thinking about the same thing. In my game, I have a physics-based puzzle where the player drops a marble into a maze-like arrangement of colliders, and must rotate a number of paddles inside the maze to ensure that the marble gets to its goal. While making this, I thought that the logical approach would be to create a single paddle object that can be replicated (let's say I need five of these in the maze), but as it turns out that's not possible: a single prefab for the mesh and materials can (and should) be used, but the action lists that handle the interaction and rotation have to be manually created for each paddle.

    I agree that having this functionality would be useful. I'd even argue that it's definitely something that would make sense in a utility like Adventure Creator, but something like this does venture into "scope creep" territory, especially given how AC is designed to play well with PlayMaker. I don't own PlayMaker yet, but I intend to buy it during development of my game, especially as I start to design more puzzles. I think it's fair to rely on AC for the core adventure game stuff, and use other plugins/assets for the specifics.

    In a nutshell: I'd love to see a feature like this added, but I'd understand if Chris declined.
  • edited August 2015
    This is a very great news, Thank you so much!
    I've got some issue but I resolved most of them (player switch lost gravity when I use a load scene, etc.).

    One last issue: When I switch to a new scene, actionlist-skippable doesn't work. (no problem with 1.46g). It's only when my player move to a new scene. In fact it's skip the actionlist, but it's like "pause-gameplay" stay on. Cursor does'nt appear, etc.
    Any solution?
    EDIT: Ok, it does'nt work only when music plays across scenes. But it's not a great solution at all, any idea?
  • Version v1.47a is out, and fixes a fair few issues:
    • Added: Ability to rename the display label of the game’s original language
    • Added: Ability to edit translation text directly within the Speech Manager
    • Changed: Sorting Maps will no longer correct their rotation if changed, in case the rotation was intentional
    • Fixed: Hotspot interactions occasionally not running if the Interaction Menu is set to pause the game when enabled
    • Fixed: Speech being unskippable if the mouse is over a Menu at the time
    • Fixed: Error when loading a saved game that includes a Container with no items
    • Fixed: Active Hotspot not de-selecting if “Engine: Manage systems” Action is used to disabled the Interaction system
    • Fixed: Hotspot Menus not displaying when hovering over Inventory Menus that pause the game
    • Fixed: Various issues related to expression tokens in speech text
    • Fixed: UFPS players not facing the correct direction after loading a saved game
    • Fixed: MainCamera not being properly disabled when a UFPS camera is active
    • Fixed: Error when calling KickStarter.TurnOffAC () from an ActionList asset file
    • Fixed: Error when using Curved Tracks in Unity 5
    • Fixed: Rare errors when re-ordering inventory items after changing scene
    • Fixed: GameCameras not snapping to their correct position when cut to instantly

    @RedCityNoise: Please post in a new thread with details / steps to recreate the issue.

  • A couple of unfortunate bugs have forced an early v1.47b release.  However, it's safe to ignore it if you don't use UFPS or drag/drop inventory:
    • Fixed: Critical issue involving UFPS player rotation
    • Fixed: Rare issue when using a drag and drop Inventory interface
  • edited August 2015
    The camera rotation bug with UFPS still seems to be there after updating for me.
  • Great work as usual Chris!
  • edited August 2015
    Had a problem with my player not adapting the scene's tint map when I changed scenes (because the game object exists across scenes and ResetTintMap is only called in Awake and LoadData). Solved it by adding this to the FollowTintMap script:





    protected void OnBecameVisible ()
    {

        ResetTintMap ();
    }
      

    See Unity execution order for more details, if you're dealing with the same problem: http://docs.unity3d.com/Manual/ExecutionOrder.html
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 Unity's Adventure Creator.