Forum rules - please read before posting.

Rairun

About

Username
Rairun
Joined
Visits
1,123
Last Active
Roles
Member

Comments

  • using UnityEngine;using AC;public class CustomContainerHotspot : MonoBehaviour{ private void OnEnable() { EventManager.OnRequestMenuElementHotspotLabel += OnRequestMenuElementHotspotLabel; } private void OnDisable() { EventManager.OnRequestMen…
  • I might as well share the other script I use to handle the Hotspot labels for moving the inventory/container items around. Do notice that I'm using component variables for the strings so that they can be localised to different languages later, but I…
  • I'm sure Chris can give you proper advice here, but a while ago I wrote a custom script to handle my player inventory and other containers (which I use by changing the menu's inventory box type to "custom script"). It doesn't behave exactl…
  • AC should have created a new set of managers exclusively for your game (which then would just need to be reassigned). You should have a ManagerPackage asset that can assign all the individual managers for your game. So the answer is that (1) yes, b…
  • Try this: using UnityEngine;public class SwapAnimator : MonoBehaviour{ public RuntimeAnimatorController santaAnimator; void Start() { if (AC.GlobalVariables.GetIntegerValue(0) == 12) { this.GetComponent<Animator…
  • I've never tried something like this before, but my first idea would be to create two animator controllers, one with normal animations and another with santa counterparts, and then write a simple script to check the month variable and, if 12, swap t…
  • Off the top of my head, I believe there is also a different issue with the ":" character for both 'toggle' and 'cycle' elements - there is always an unwanted space before it, meaning the above example is displayed as "Subtitles : On/O…
  • You can rely on AC's UI logic. For example, if you add a button to your Unity UI, you can then link the button to an AC menu element, which can override its text label, on-click functionality, etc.
  • I believe I found a solution using the script you provided here: https://www.adventurecreator.org/forum/discussion/10466/remember-variables-on-menu-prefabs Instead of trying to assign an instance of the prefab to the scene object's component, I ad…
  • When manipulating the in-scene UI's variables using an actionlist, when I assign the object/component directly, it still records its ConstantID, I believe. I don't think it's possible to assign the object directly, even if you drag it to the field? …
  • Chris, I think I sorted the issue [Edit: no, I didn't lol]. I opened StateHandler.cs, and change this line: ConstantID[] allConstantIDs = Object.FindObjectsOfType <ConstantID>(); To this: ConstantID[] allConstantIDs = Object.FindObjectsOfTy…
  • If I change the menu type to Unity UI in Scene, this works. I can't get it to work with a prefab, though. This might suffice for my purposes, BUT I'm thinking about having a second PC the player can use in a different location (I'm not sure about th…
  • Right, I had to modify your script to: * Include an Editor to assign an object to rootObject. * Add (true) to the GetComponentsInChildren method (this is the includeInactive parameter). using UnityEditor;using UnityEngine;using System.Collections;…
  • Edit: still working on this, will post my modifications soon.
  • Also, once this can be assigned, should I then remove the "remember variable" components of all objects in the hierarchy? Should I add a Constant ID component to each of them instead?
  • Thank you! One last issue (maybe?) re: the remember script. I see a public GameObject rootObject; which I'd have expected to be exposed in the inspector so that I could drag the menu prefab to it, but it's not showing. (Image) I tried your "…
  • Thank you! Sadly I'm getting a script error here: variables[i].vars = SaveSystem.UnloadVariablesData(data.variablesDatas[i], true, Variables.vars); It gives me a Compiler Error CS0120 (an object reference is required for the nonstatic field, metho…
  • (Quote) Upon further testing, this is not true. Component variables can be set via an actionlist if and only if their gameobject is enabled at the moment the menu is first instantiated in the scene. If the gameobject is disabled within the prefab, i…
  • To give you a better idea of my use case: I have created the functionality of an in-game online forum that the player can navigate on a PC. This is made of a forum view as well as a thread view. The forum view looks like this: (Image) The "…
  • Does that mean component variables on an UI object aren't saved if the object happens to be disabled? Edit: opening a new thread for this.
Default Avatar

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.