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! :)
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.