Forum rules - please read before posting.

AC with Input System and UCC

Hi Chris,

I'm using AC with UCC and Input System integrations. Thanks to excellent docs and provided code, I was able to make it work.

I'd like to use AC with:
-complex interactables (puzzles and interactables with multiple choices/actions)
-objectives
-conversations
-cutscene and timeline

Since AC has pretty good docs for its API, I'm not afraid for some coding.

I have some understanding of how AC works in some areas. I'd like to ask if my understanding is correct on those.

-AC input names are hard-coded. UCC and my custom Input Action Asset will have to use those names shown in Settings->Input.

-It seems I'll be only using "InteractionA" input with AC. Is this a problem? I'm getting some warnings but I guess I'm fine.

-I have my own ways to move Player in the scene at scene start. I'm not using any "Player Start" . I'm getting some warnings but it seems to be working fine.

-I've a tabbed UI (custom code) in my game scene and I'd like to show AC objectives in one of the tabs. From what I understand, I'll need to remove "Objectives" from "Menus" list. Then put the objectives prefab, the way I want, under my Tab UI. My UI code will keep a reference to "Objectives" menu class and call its "TurnOn" and "TurnOff" methods when necessary.

-I had some problems with Menu->Event System prefab (custom UI code requires Event System to be on scene).
I solved it by having just one scene copy of every component that "EventSystem_InputSystem" has. AC now doesn't instantiate the Event System prefab.
I also set the "Control Scheme Link" name exactly as my custom Input actions asset uses "Keyboard and Mouse". Will these bite me later on? I'm getting a warning but I guess it is OK.

-I have custom Localization ready and working. To make it work with AC, my plan is:
Use unique Database entry names while creating the dialogues (as Line text).
I'll listen to "OnStartSpeech_Alt" method, use the DB entry name to get actual dialogue string and call Speech.ReplaceDisplayText(). Does that sound good?

-Is there anything I need to do for cutscenes and timeline to work with UCC characters? I'll just follow your Youtube videos for those.

Cheers!

Comments

  • Welcome to the community, @ggrrhh.

    AC input names are hard-coded. UCC and my custom Input Action Asset will have to use those names shown in Settings->Input.

    That's correct - AC inputs are declared by naming convention.

    It seems I'll be only using "InteractionA" input with AC. Is this a problem? I'm getting some warnings but I guess I'm fine.

    What are the warnings, specificially? InteractionA is the main input used for interacting - any others are optional and may not be necessary if you're using a third-party motion controller. The inputs listed in the Settings Manager are merely what AC will respond to - they don't technically need to be used.

    I have my own ways to move Player in the scene at scene start. I'm not using any "Player Start" . I'm getting some warnings but it seems to be working fine.

    Where possible, I'd recommend letting AC take control of hard-setting the Player's position/rotation, as it'll also want to do so when loading e.g. save-game files. If you need to run additional code when doing so, you can hook into the OnCharacterTeleport custom event.

    -I've a tabbed UI (custom code) in my game scene and I'd like to show AC objectives in one of the tabs. From what I understand, I'll need to remove "Objectives" from "Menus" list. Then put the objectives prefab, the way I want, under my Tab UI. My UI code will keep a reference to "Objectives" menu class and call its "TurnOn" and "TurnOff" methods when necessary.

    To have AC auto-populate UI objects with its own data, you'll need a Menu in the Menu Manager that links to a UI canvas prefab, with Elements that link to the UI components within it.

    If you detach the elements from the UI objects, you'll need to populate your UI objects manually by accessing the data through custom script. The live data associated with the Player's active Objectives can be accessed from the RuntimeObjectives class, i.e.:

    KickStarter.runtimeObjectives
    

    I also set the "Control Scheme Link" name exactly as my custom Input actions asset uses "Keyboard and Mouse". Will these bite me later on? I'm getting a warning but I guess it is OK.

    If it's working, I'd say you're fine. AC will complain about there being a local EventSystem, but that's more to aid new users who are encountering issues by having one inadvertently.

    I have custom Localization ready and working. To make it work with AC, my plan is

    AC already supports Localization - in two key ways:

    • The Auto-sync Locale with Language? option in the Speech Manager's Languages panel
      The Rely on Localization? option for each gathered line in the Speech Manager, which - when checked - lets you connect the line to an entry in a Localization table
  • edited March 13

    Happy to be a part of this community and thank you for the reply!

    What are the warnings, specificially?

    Warnings are "Input Action 'ToggleCursor' (and its friends) not found"
    So I understand these will not be a problem.

    Where possible, I'd recommend letting AC take control of hard-setting the Player's position/rotation, as it'll also want to do so when loading e.g. save-game files. If you need to run additional code when doing so, you can hook into the OnCharacterTeleport custom event.

    Game creates levels procedurally, so there is no way to know where player will start until level has been created.
    I'm guessing "OnCharacterTeleport" will be too late for me. I'll need to wait until I'm done with level creation, then move the "Player Start" transform to where it should be and then rest of the AC code should run.
    For now, I'll stick with my current solution and see how it goes.
    It seems I will have questions about saving-loading in later stages though.

    If you detach the elements from the UI objects, you'll need to populate your UI objects manually by accessing the data through custom script.

    I understand that by "populate" you mean, adding all the necessary components and reference their data through Kickstarter.
    I took a look at the objectives prefab and see that (besides good hierarchy and graphics) GameObjects only have their IDs stored. Which is clever and clean way to do UI.

    So what happens if I cheat? Let AC do all the work and when it is finished, I simply move objectives UI from "DontDestroyOnLoad" scene into my scene and make a child of my Tabbed UI?

    My other option seems to be reading your code,
    learn who gets which component, what data,
    try to replicate it with my own class.

    AC already supports Localization

    I think you mean Unity' Localization by that.
    I meant I have other custom Localization ready and working. I tried Unity' some time ago and found it cumbersome at the time. So I switched to another solution. Currently, it is working for me.
    I'd like to use it with AC, if I can. And only simple way I found was the way I described.
    Switch the text right before AC works with it.
    But if you see bumps in my road then of course I'll re consider.
    Game isn't dialogue heavy. Conversations are for getting objectives and some lore mostly.

  • So what happens if I cheat? Let AC do all the work and when it is finished, I simply move objectives UI from "DontDestroyOnLoad" scene into my scene and make a child of my Tabbed UI?

    References would become lost upon either saving/loading, or by switching scene.

    If you want to avoid populating the data manually through code, you could try making your Tabbed UI a prefab, referenced as the Objective menu's Linked Canvas prefab, and move the ObjectiveUI's children onto the prefab. That way, AC will handle the turning on/off of the menu, link the Objective elements with their UI counterparts, and the rest of your UI (that is not linked to AC) can be controlled as necessary through your own code.

    If you're starting out with AC and its Menu system, it might be worth having a look at how AC is intended to link with UI prefabs - so that you're aware of which aspects are standard workflow, and which aren't. A tutorial on linking a prefab to the Menu system can be found here.

    I meant I have other custom Localization ready and working. I tried Unity' some time ago and found it cumbersome at the time. So I switched to another solution. Currently, it is working for me.

    That should be fine, then. If you want to ensure unique IDs for your Database entries, it may be worth gathering AC's text in the normal way using the Speech Manager, so that each line has a unique ID number. Either way, calling Speech.ReplaceDisplayText will let you alter the line's appearance at runtime.

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.