Forum rules - please read before posting.

Index Out of Range; Wait until Finish for Music; Fading Sprites and more...

Dear Chris and all the Adventure Creator forum people,
I'm moving forward with my game (if you are curious you can check the development on Facebook or Instagram) and I love working with AC asset, but I've few bugs/issues that I'd like to discuss.

First of all, I'm using:
Unity 2018.3.9f1 (9 is a "nine", not sure why it appears 9)
AC 1.66.7

Here a summary of my troubles:

1. Index Was out of Range
Since I moved to "Sprite Unity Complex", I'm often (not always) having the error message "Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index". And my character keeps walking until I click something else... Especially when "Walking to a Marker". Here a screenshot:::.
I'm not sure why it happens. If it's related with "Sprite Unity Complex" or some other kind of bug.
Some notes:

  • My animator is pretty simple (Idle-Walk-Run-Talk). Transition to Walk when "speed" greater than 0.1. Viceversa for Idle. Greater than 1 to Run, etc...
  • Destination accuracy: = 1 (Attempt to be super-accurate: = unchecked)
  • Last but not least, a screenshot of my player settings:.

What is causing it? How can I solve it?

2. "Wait until finish?" for Play-Music
Following this thread, now everything is working fine.
But I've one request:. Can the "Wait until finish?" be applied also on "Sound: Play Music"? It could be useful in many occasions... Now I've implemented it on "Sound: Shuffle music", but I'm not sure how to do it for the regular "Play Music". Can you (Chris) send me the updated Action for that? Or can you add it to the next AC release? (by the way, when you estimate to release an update?)

3. Vertical Movement Factor
The Vertical Movement Factor is not affecting my players (but it does affect the NPCs). Looking around the forum, I noticed it can be because (as you can notice from my screenshot for the point 1) I'm using "retro-style movement", as you explained on this thread.
If it's because of that, then I've to wait the next release...? Or does it depend also on "Sprite Unity Complex" or other factors?

4. Fading IN/OUT a Sprite when reaching a node of a path.
I've a scene (here a screenshot), where I'd like some random walkers to fade in/out when reaching (or moving from) the distant "foggy" part of the road. I'll have a dozen walkers walking randomly from or to that point, following a couple of paths. Well, since they aren't disappearing out of frame, I think would be great if they can "fade". I was thinking to add an action to the node of my path, but how can I check at which node my walkers are? And also, how can I fade only the sprite (walker) that is there and not the others? I was looking around for a "check path node" or a "check (Object) screen position" to combine with "Object: Fade Sprite"... But I guess I need to attach some specific script to my Sprite in order to do that. Something like: when reaching node X of Path A, fade out sprite. And when starting from node 0 of Path B, fade in sprite... Any suggestions? I'm bad with scripting! Or maybe you can add an "opacity" value to each Path Node in AC?

5. Spine Support
Looking around the forum, I noticed many people wishes for an official Spine support into Adventure Creator. I join them as well! Would be great if AC could work smoothly with Spine! I'd love that!!! Please Chris consider it! (AC 2D Bone animator is still very buggy and doesn't have all the possibilities of Spine... sigh). Anyway, I saw the wikia script implementation and other methods here in the forum, but they are all pretty tricky and elaborated, requiring custom scripts and whatnot... Would truly love if AC could naturally work with Spine! Maybe for the next release? (wink wink)

Thanks a lot and sorry for the lot of questions.
Hope they can help other people out there.

Warm regards.

Comments

  • Index Was out of Range

    I will need to attempt a recreation of this. I'm assuming this is a Player character - with point-and-click movement? Does the same issue occur if you load up the 2D Demo's Managers + Park scene, drop your Player prefab into the scene, and run it?

    "Wait until finish?" for Play-Music

    The Sound: Play music Action already has an option to wait until a transition ends. What is it specifically you're looking to wait until? Please share a screenshot of the Action's settings.

    v1.66.7 is planned for this week or next - barring any complications.

    Vertical Movement Factor

    Retro-mode movement will account for the scene's vertical movement factor in the next update.

    Fading IN/OUT a Sprite when reaching a node of a path.

    I'd recommend relying on an Animator to control you're sprite's alpha value, but you can assign a Cutscene to a Node within the Paths Inspector.

    If the Cutscene contains a GameObject parameter, then you can have this parameter set to the character that triggers it upon reaching the Node. This GameObject parameter can then be set to either the Object: Fade sprite Action or the Character: Animate Action to determine which object to affect.

    Spine Support

    What do you mean by "AC 2D Bone animator"? AC has none - are you instead referring to Unity's new 2D skeketal tools?

  • edited March 2019
    1. Index Was Out of Range
      Yes it's a Player Character with Point&Click. I'll try putting my player in the 2D Demo and let you know.

    2. Sound Play Music
      I mean the "Wait until finish?" for the whole track that is played, not for the transition (as you helped me for the Shuffle one, check the thread I linked on my first message). Like playing a track from the Music Storage and once that track is done playing, do some other actions (like starting the shuffle looping, etc).

    3. Vertical Movement Factor
      Great!

    4. Fading IN/OUT a Sprite
      I'll give it a try... but if I have 12 walkers, should I create a fade for each of them? And what if I've 2 on scene and 1 is walking mid way, isn't the CutScene fading also the one mid way as soon as the other reach the ending node? (And I'm not sure how in my case the animator controlling the alpha value should work).

    5. Spine Support
      Sorry I meant Unity 2D skeletal tool, not AC, lapsus.

  • edited March 2019

    Update for point 1: Yes, same problem happens also in the Demo Park scene when using my character.
    Here more screenshots about my player: (beside the settings you can see on the first message):
    https://ibb.co/QHpbX9b

  • Index Was Out of Range

    I cannot recreate from what you've shared. In private, PM me a .unitypackage file of the character's prefab and associated assets (Animator / animations / sprites etc), and I'll take a look.

    Fading IN/OUT a Sprite

    If they all share the same Animator, then you'd only need to update one. An animation can update a SpriteRenderer color field's alpha channel, but that's a Unity operation and not specific to AC. Otherwise, perhaps a SpriteFader would be best - at least to test more quickly.

    About the Node Cutscene-sharing: good point. A Cutscene can only run once at a time. ActionList assets, however, can so long as Can run multiple instances? is checked in their properties box. Set the Path's Node commands source field to Asset File, and you can rely on assets instead.

    Spine Support

    I cannot make any promises, but I shall give this a look. Please leave this with me.

    1. Index Was Out of Range
      Ok, sending soon a PM with a link to download the prefab and all the necessary.

    2. Sound Play Music
      You haven't replied to this... I thought it was something rather easy for you to do? I'm talking about the "public bool willWaitComplete;" that you added to the ActionShuffleMusic and I wonder if you can add it as well to the ActionMusic (standard AC action).

    3. Fading IN/OUT Sprite
      Ok, I'll give it a try.

    4. Spine Support
      Ok!

  • edited March 2019

    sending soon a PM with a link to download the prefab and all the necessary.

    Received, but I can't get any such error to appear. Can you share steps on how to reproduce this in the 2D Demo, with your Player prefab?

    You haven't replied to this...

    It'll be part of the next update.

  • edited March 2019

    Well, the steps to reproduce the error in the 2D Demo are these:

    • I open the Demo scene on my game project
    • I play the Park scene, my player is automatically launched
    • I click around randomly, especially to trigger "Walk to Marker"
    • After a bit (sometime earlier, sometime later) I got that error and the character play in loop the walking animation instead of stopping, until I click somewhere else.

    (Maybe on my first test I forgot to open the manager... Will try now)

  • UPDATE: I might have solved setting to 0 the "Pathfinding Update Time" under "Movement Settings" in the Settings. Before it was set to a non-zero value and confronting the 2D demo manager and my manager I've found out that difference. Been playing now for few minutes without reproducing the previous bug. Fingers crossed...

  • edited March 2019

    Were you assigning the 2D Demo's Managers when testing?

  • On the first test, yes, but I guess not for all the slots (maybe I missed "Settings"? not sure...). On a second test, I reloaded all of 2D Demo Managers and it was working better, so I compared 2D Demo's Managers with my Managers and I've found that difference in the "Pathfinding Update Time" so it might be that one that was creating the bug... I've tested some minutes without troubles. Will test more.

  • See my post on the Spine integation page here.

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.