Hi… I’m thinking of starting a hobby adventure game project and
looking for game engine to do it in. I would like to build a text phaser
and use it for controlling the game, like the old Space Quest and Space
Quest 2 type thing.
I have looked into WME and Visionaire but they have no system in
place to do this kind of thing. I believe AGS can but haven’t looked to
far into it because while I want the old input style I was hoping to not
have the old school graphic look.
I would really like to use this system as from what I have seen it is very robust, but the very fact that unity obfuscates the code confuses me.
Thanks in advance!
-Jynks
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
I am not aware of any parser-based asset in Unity, but you may have better luck if you ask on the official Unity forums. If you can get your own parser working correctly, then you should be able to have it connect with AC quite easily, since you can trigger AC's ActionLists by simply invoking their Interact function.
Are there any tutorial series for Adventure Game Creator for Unity? Maybe a little more focused on unity beginners as well than the ones on the front page?
Wondering if there are any new native support/ possible workarounds for this using AC now? Wanted text inputs to launch specific Action Lists.
As far as I can see from the name input tutorial, it only records your input and can then be only displayed back as text in a dialogue right?
To be more specific - I only want the text input to recognize verbs (take, observe, touch etc) when interacting with a specific hotspot in 3D space (kind of like Life is Strange) So, my system wouldn't need the player to specify a noun/object (like "take sword" for instance)
So inputting take (or a list of other similar words like grab etc) would launch an actionlist for that verb. Observe would launch a different AL and so on.
Any simple solution for this?
Text-parsing is outside of AC's scope and does involve a lot of custom behaviour - e.g. in your case, no need for a Hotspot name.
You can still leverage the Input element type by parsing it via a custom script, however.
For example, this script's ParseInputBox function will search the contents of an Input element for verbs associated with the last-selected Hotspot, and then run the associated interaction:
To use it, attach to an empty GameObject, prefab it, and then use the Object: Call event Action to run the prefab's ParseInputBox function after the menu is closed.
Thanks for the script! Currently, GetLabelFromID at line 21 shows an error - "There is no argument given that corresponds to the required formal parameter 'languageNumber' of CursorManager.GetLabelFromID(int, int)"
Edit: fixed it by adding private int languageNumber; to line 9
Also, how do I associate verbs to a hotspot, in this case?
Edit: Do you mean the "Cursor/Icon" dropdown in the Use interactions of a hotspot?
Omg, this actually works, perfectly! For anyone looking for a similar setup in the future, you must define "Interaction Icons" in your cursor settings and write the Label of those icons in the input field of your menu.
Here is my setup, for reference:
![]( "")
Thanks @ChrisIceBox !
I do have an additional question - Is it possible to have one interaction for multiple inputs/ synonyms? For instance, a player might type "speak" or "chat" instead of "talk" - so I want to have a list of acceptable words for each interaction that lead to the "talk" interaction/Icon ID Label.
GetLabelsArray maybe? Trying to figure out how to use that though.
Something like this -
" alt="" title="" />
Yes, you can convert the label text into an array using a common separator and then check each verb individually.
For example, this'll process verb labels separated by a forward slash, i.e. "talk/chat/speak/say":
This is PERFECT. Thank you!!
It seems this script registers the input as correct/ launches the associated interaction even if the input word contains extra, incorrect alphabets.
For example, typing either "talk" or something like "talkasdaaf" both launch the associated interaction for "talk" because this contains the right alphabets, and it doesn't mind that incorrect letters have been entered after the correct one. How can the script be changed to account for this?
Also, the script/ menu stops working when I switch to a Unity UI Prefab for the menu.
Here is my menu setup -
And also what my script looks like atm:
Note that using the method suggested above by you worked perfectly when the menu was an AC menu. Since switching to the Unity UI Prefab based, pressing Okay/Submit after typing does nothing - the button is being pressed, but the associated interaction doesn't run. There are no console errors either.
Edit:
Odd, there is in fact this error that pops up as soon as I type the last alphabet of "talk", without even hitting submit. This error doesn't pop up with any other word, just with the "k" of "talk". It doesn't even look related to anything:
Apologies for the small image size, seems to be a limitation of the image hosting website
The error messages aren't AC-related.
To have the Input text be readable when using Unity UI, replace:
with:
To require the text entered to exactly match the verbs, replace:
with:
Thanks! Still doesn't seem to work with Unity UI. Is it because I'm using a Text Mesh Pro Input Field?
Edit: Oddly enough, it doesn't even allow me to drag a non-TMP input field to the AC Linked Input Field
Shouldn't factor in, but if you attach the script to your UI prefab you can bypass AC's Input element and just read the contents of the TMPro Input component directly.
If you've added TextMeshProIsPresent to your Scripting Define Symbols (in order to let AC know TMPro can be used), you can only rely on TMPro components. It's a global switch, not one per-element.
Ok, it works by switching to a non-TMP Input field. Any idea why it might not be working with a TMP one?
Another problem with this is that I'm only able to type within the Input field if the menu is set to Pause when enabled. This isn't needed with the AC version of the menu, it works without the game being paused.
Try replacing AC's MenuInput script's GetContents function with the following:
Try using the Menu: Select element Action to force the selection.
It works! Thank you! The input field focus/ selection is still a little finicky, but I think I can fix that by reworking the menu a little.