Forum rules - please read before posting.

Scene messed up after loading it Additive and then unload it...

edited May 2018 in Technical Q&A
I'm not 100% sure that this Additive load caused the problem but it is the only thing I did differently so I guess it must be.
So what I did... I loaded a Scene Additive in order to copy some actions from a Scene Actionlist to another Scene.

Then I removed it and unload it. I switch to that scene normally and

All the hotspots without being prefabs had gone missing
All the triggers Actionlists got emptied... (there is no Actions in them)

(and these two errors appeared.

ArgumentException: Input Button ToggleCursor is not setup.
 To change the input settings use: Edit -> Project Settings -> Input
AC.PlayerInput.InputGetButtonDown (System.String axis, Boolean showError) (at Assets/AdventureCreator/Scripts/Controls/PlayerInput.cs:1666)
AC.PlayerInput.UpdateInput () (at Assets/AdventureCreator/Scripts/Controls/PlayerInput.cs:214)
AC.StateHandler.Update () (at Assets/AdventureCreator/Scripts/Game engine/StateHandler.cs:249)

ArgumentException: Input Button InteractionB is not setup.
 To change the input settings use: Edit -> Project Settings -> Input
AC.PlayerInput.InputGetButtonDown (System.String axis, Boolean showError) (at Assets/AdventureCreator/Scripts/Controls/PlayerInput.cs:1666)
AC.UISlotClick.Update () (at Assets/AdventureCreator/Scripts/Menu/Menu classes/UISlotClick.cs:41)


Interactions / Dialogue Options and Conversations are ok!...

Unity Version 2018.1.0f2
AC . 1.62.6







Comments

  • edited May 2018
    Do you mean you were doing this at runtime via the Scene: Add or remove Action, or dragging the scene file into the Hierarchy manually?  Please be really clear with the steps involved so that I can attempt a recreation.

    The errors suggest that you were doing this at runtime, so I'm not sure of your exact intent - since changes to scene-based ActionLists during Play mode revert upon exiting.  Was the data loss permanent?

    The data loss may be a Unity issue.  If you weren't getting the input messages before, I'm assuming you had "ToggleInput" and "InteractionB" inputs defined?  It sounds like they too have been reset - check your Input manager and see.
  • edited May 2018
    I was doing it on Edit mode.

    I had a new scene and I wanted to transfer a big ActionList from another scene.
    So I opened the other scene additive in Hierarchy I opened the actionlist from there I copied all the actions and then I went on the new Actionlist on the new scene and I pasted them.
    Then I unloaded the first scene and deleted it from Hierarchy.

    The data loss is permanent. The strange thing is that only Triggers and Hotspots that I didn't had them as prefabs lost..

    About the buttons. I never had those inputs defined. And after this reset it started to ask me for more inputs to define (after I defined those two on Input then it asked me for more "InteractionA" , "EndCutscene" etc etc. 

    (I don't remember for sure but I think I pressed Play when both scenes were opened but I'm not 100% certain that I did it...)


  • edited May 2018
    Thanks for the info - I'll attempt a recreation.  Though I still can't predict what the cause was, I apologise if AC was to blame here.

    To be clear: the data loss was for Triggers and Hotspots that were not instances of prefabs?  Did you break those from their prefabs, or did you create them manually by adding their respective components?

    Was the ActionList you were copying in the original scene, or the one you loaded additively, and what was in it?

    Given the trouble this has caused, the "safe" way to to copy ActionList data is to click the cog in its Inspector to convert it to an ActionList asset, then convert it back to a Cutscene in the new scene.

    Regarding the inputs, they don't normally need to be defined unless Assume inputs are defined? is checked in the Settings Manager.  Is that enabled now, and wasn't before?

  • edited May 2018
    Thank you Chris for the quick replies! 
    The data loss occurred only on HotSpots I had created in Hierarchy without being instances of prefabs (basically I was creating them from the Game Editor but I forgot to make them prefabs too.)
    The Triggers also created from the Game Editor and I didn't make them prefabs either..
    Although similar objects like the Conversation Options / the Interactions etc etc those were ok...
    About the scene lets call Scene A the original scene and scene B the new scene
    On Scene A I had  a cutscene ActionList which I wanted to copy. So I opened scene B and added additive Scene A then opened the Actionlist , I selected all the actions pressed copy and then I went on the Actionlist of Scene B I opened it and pressed Paste. The I unload scene A and removed it. Also from what I remember on the question to save it when I was removing it I pressed don't save changes . Also I think but I'm not sure that while I had both scenes opened I might pressed play... but I don't remember if I did that before or after the unload.
    No assume inputs are defined is not checked now.

    From what I understand everything that I put on Hierarchy I should make them prefabs.. Just to be safe


  • edited May 2018
    Well, that's really strange - the code you're referencing, in v1.62.6, should only occur if that option is checked.

    About the logic objects: when creating objects in the Game Editor (Scene Manager), they should already be prefabs to begin with - linked to their "default" counterparts in /Assets/AdventureCreator/Prefabs/Logic.  Was this not the case, or by prefabs did you mean "new" prefabs by making separate prefabs for each?

    If you're looking to keep as much data out of the scene as possible, you can have scene-based Triggers, Hotspots etc refer to ActionList assets instead of keeping Actions in the scene.  Scene Actions can't live as prefabs, hence the need for a separate "ActionList asset" type.
  • Hello Chris sorry for the later answer...

    About the logic objects: when creating objects in the Game Editor (Scene Manager), they should already be prefabs to begin with - linked to their "default" counterparts in /Assets/AdventureCreator/Prefabs/Logic.  Was this not the case, or by prefabs did you mean "new" prefabs by making separate prefabs for each?

    Well I do it with 2 ways. When I create a hotspot I either duplicate from an existent and then I make it a prefab of their own or I use the Game Editor creates the default hotspot which I edit and then make it a new prefab. 

    The ones that messed up where all the prefabs that I had created with editor but I forgot to make them separate prefabs. It said missing prefab.

    I'm trying to use as much as possible the Actionlist assets but when I need use of local variables I can do it only with scene Actionlists...

    • The ones that messed up where all the prefabs that I had created with editor but I forgot to make them separate prefabs. It said missing prefab.
    If they were linked to AC's "regular" Hotspot prefab, what's the state of it now?  It sounds like the prefab itself somehow became corrupted, but you can re-import it from the AC installation.
  • edited June 2018
    I face another problem similar with this but different in the way of how I did it..  I was creating an ActionList and I pressed ctrl Z couple of times to undo something i had changed and the screen messed up like this.. https://imgur.com/a/m74prkV From the moment that happened, that Actionlist always looks like this... Even if I reload the project (close unity etc etc)

    Also this is how all the actionlists that I had lost in the previous problem looked like too.. so I post it here in case there is a connection between the problems..

    About what you asked I'm not sure I recovered the project to normal and I can't check that...



  • What was it exactly you were undo-ing?  The more accurate steps to recreate the issue you can provide, the more thoroughly I can look into it.

    As with the previous issue, what's the state of the Actions in the Inspector?
  • edited June 2018
    I added two dialogue actions and changed the text on a third one and I closed the actionList then I opened it again immediately because I had changed the wrong dialogues and I pressed ctrl z twice trying to roll back just in case they were in memory and that happened...  The actions on Inspector were visible at the beginning but when I tried to edit them from there they just disappeared..
  • The Undo system won't record changes in dialogue text - only changes to the ActionList as a whole, i.e. the adding of your two Actions.  Having both Actions become removed after pressing Ctrl-Z twice sounds like the expected behaviour.

    They shouldn't have become messed up as with the screenshot, however.  Did you try redo-ing twice to bring them back?

    I've found some issues related to the Undo system in the ActionList Editor that I'll be looking to fix as part of the next update - hopefully that's related, but without being able to recreate your exact scenario it's not possible to be certain.
  • I tried to recreate too but I wasn't able either... Looks like its a "random" bug that might happen... From how I understand it this happens when an Action gets broken so the whole ActionList mess up. But how can you break an action I haven't figured it out yet...

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.