Forum rules - please read before posting.

a bug in version upgrade

I changed to U6000.5.0f1 and AC1.86.4. In the actiolists in scene starting with custom node the first item was lost. And when I added again the right node I couldn't set it to first - setting first didn't work at all.
But after clicking the actual gameitem it somehow reseted the actiolist editor and another node was set first and then I was able to set the correct first.
I don't know it it was that I had a custom AL node that was put into Dialog group or not. But for future I changed custom AL group into custom.

Comments

  • What version were you previously using?

    If you reset the ActionList editor, does that fix the ActionList? Check the Console for related messages.

  • From U6000.4.11f and AC1.86.3. I already fixed the broken ones and this bug seems to only have affected the open scene, so can't test it.

  • Actually also the custom Final IK nodes went missing from the open scene. And all of the Objectives were set wrong.

  • I'll need more details about the way in which things were set wrong. Did the Console show any related messages?

    If you can share the code for the custom Action, I will attempt a recreation.

  • This was the one in front:

    using System.Collections.Generic;
    using UnityEngine;
    #if UNITY_EDITOR
    using UnityEditor;
    #endif
    
    namespace AC
    {
    
        [System.Serializable]
        public class ActionCheckConversationOnlyBye : ActionCheck
        {
    
            public override ActionCategory Category { get { return ActionCategory.Custom; }}
            public override string Title { get { return "Only bye"; }}
            public override string Description { get { return "Checks if a Conversation has only one option"; }}
    
            public Conversation myConversation;
            public int conversationConstantID;
            public int conversationParameterID = -1;
            private Conversation runtimeConversation;
    
            public int numOptions = 1;
            public int numOptionsParameterID = -1;
    
            public override void AssignValues (List<ActionParameter> parameters)
            {
                runtimeConversation = AssignFile<Conversation>(parameters, conversationParameterID, conversationConstantID, myConversation);
                numOptions = AssignInteger(parameters, numOptionsParameterID, numOptions);
            }
    
            public override bool CheckCondition ()
            {
                Debug.Log("Checking if " + runtimeConversation + " has only " + numOptions + " options");
                return runtimeConversation.GetNumEnabledOptions() <= numOptions;
            }
    
    
            #if UNITY_EDITOR
    
            public override void ShowGUI (List<ActionParameter> parameters)
            {
                conversationParameterID = Action.ChooseParameterGUI("Conversation:", parameters, conversationParameterID, ParameterType.GameObject);
    
                if (conversationParameterID >= 0)
                {
                    conversationConstantID = 0;
                    myConversation = null;
                } else
                {
                    myConversation = (Conversation)EditorGUILayout.ObjectField("Conversation:", myConversation, typeof (Conversation), true);
    
                    conversationConstantID = FieldToID<Conversation> (myConversation, conversationConstantID);
                    myConversation = IDToField<Conversation>(myConversation, conversationConstantID, false);
                }
    
                numOptionsParameterID = Action.ChooseParameterGUI("No. of options:", parameters, numOptionsParameterID, ParameterType.Integer);
                if (numOptions < 0)
                {
                    numOptions = EditorGUILayout.IntField ("No. of options:", numOptions);
                }
            }
    
            #endif
    
        }
    
    }
    
  • And this in middle:

    using UnityEngine;
    using System.Collections;
    using System.Collections.Generic;
    using RootMotion.FinalIK;
    
    #if UNITY_EDITOR
    
    using UnityEditor;
    
    #endif
     namespace AC
     {
        [System.Serializable]
    
        public class FinalIK_RunInteraction : Action
        {
            public bool isPlayer;
            public InteractionSystem interactionSystem;
            public int interactionSystemConstantID = 0;
            public int interactionSystemParameterID = -1;
    
            public InteractionObject interactionObject;
            public int interactionObjectConstantID = 0;
            public int interactionObjectParameterID = -1;
    
            public FullBodyBipedEffector effector;
            public bool canInterrupt;
    
            public FinalIK_RunInteraction ()
            {
                this.isDisplayed = true;
                category = ActionCategory.Custom;
                title = "Final IK - Run interaction";
                description = "Starts an interaction using the Final IK Interaction System";
                isPlayer = true;
                canInterrupt = true;
            }
    
            override public void AssignValues (List<ActionParameter> parameters)
            {
                if (!isPlayer)
                    interactionSystem = AssignFile <InteractionSystem> (parameters, interactionSystemParameterID, interactionSystemConstantID, interactionSystem);
                interactionObject = AssignFile <InteractionObject> (parameters, interactionObjectParameterID, interactionObjectConstantID, interactionObject);
            }
    
            override public float Run ()
            {
                if (isPlayer)
                {
                    interactionSystem = KickStarter.player.GetComponent<InteractionSystem>();
    
                    if (interactionSystem == null)
                    {
                        Debug.LogWarning("FinalIK_RunInteraction: No InteractionSystem found on Player.");
                        return 0f;
                    }
                }
                else if (interactionSystem == null)
                {
                    Debug.LogWarning("FinalIK_RunInteraction: No InteractionSystem defined.");
                    return 0f;
                }
    
                if (interactionObject == null)
                {
                    Debug.LogWarning("FinalIK_RunInteraction: No InteractionObject defined.");
                    return 0f;
                }
    
                interactionSystem.StartInteraction(effector, interactionObject, canInterrupt);
                return 0f;
            }
    
            override public void Skip()
            {}
    
            #if UNITY_EDITOR
    
            override public void ShowGUI (List<ActionParameter> parameters)
            {
                isPlayer = EditorGUILayout.Toggle ("Is player?", isPlayer);
    
                if (!isPlayer)
                {
                    interactionSystemParameterID = Action.ChooseParameterGUI ("Character:", parameters, interactionSystemParameterID, ParameterType.GameObject);
                    if (interactionSystemParameterID >= 0)
                    {
                        interactionSystemConstantID = 0;
                        interactionSystem = null;
                    }
                    else
                    {
                        interactionSystem = (InteractionSystem) EditorGUILayout.ObjectField ("Character:", interactionSystem, typeof(InteractionSystem), true);
                        interactionSystemConstantID = FieldToID (interactionSystem, interactionSystemConstantID);
                        interactionSystem = IDToField (interactionSystem, interactionSystemConstantID, false);
                    }
                }
    
                effector = (FullBodyBipedEffector)EditorGUILayout.EnumPopup ("Effector:", effector);
                interactionObjectParameterID = Action.ChooseParameterGUI ("Interaction object:", parameters, interactionObjectParameterID, ParameterType.GameObject);
    
                if (interactionObjectParameterID >= 0)
                {
                    interactionObjectConstantID = 0;
                    interactionObject = null;
                }
                else
                {
                    interactionObject = (InteractionObject) EditorGUILayout.ObjectField ("Interaction object:", interactionObject, typeof(InteractionObject), true);
                    interactionObjectConstantID = FieldToID (interactionObject, interactionObjectConstantID);
                    interactionObject = IDToField (interactionObject, interactionObjectConstantID, false);
                }
                canInterrupt = EditorGUILayout.Toggle ("Can interrupt?", canInterrupt);
    
                AfterRunningOption ();
            }
    
            override public string SetLabel ()
            {
                string labelAdd = "";
    
                if (interactionObject)
                {
                    if (isPlayer)
                    {
                        labelAdd = " (Player to " + interactionObject.name + ")";
                    }
                    else if (interactionSystem)
                    {
                        labelAdd = " (" + interactionSystem.name + " to " + interactionObject.name + ")";
                    }
                }
    
                return labelAdd;
            }
            #endif
        }
     }
    
  • I'm not quite sure if I had actually set the objectives in action lists already in the last scene...

  • I cannot reproduce the issue, I'm afraid. I used the same custom Action and followed the same upgrade path. It may have been an issue unique to your project.

    A possible typo:

    if (numOptions < 0)
    
    if (numOptionsParameterID < 0)
    
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.