I'm
having an issue where my actionLists in a particular scene aren't
doing what they're supposed to and are doing things they shouldn't,
under certain circumstances. This will be a little complicated to
explain, so please bear with me here.
Running
Unity 2018.2.9f1 (64-bit) and AC 1.65.0
In
this scene the player must preform multiple "songs" (a
short progression of notes) in a row, in order to progress. When a
song is failed, they get kicked back to the previous song. Failing
can happen by either hitting the wrong note or running out of time.
Each song uses the same timer and the timer is reset at the start of
each song. When a song is successfully played, the player progresses
to the next song.
Now everything is working as it should, except for when you run out of time. Even though the exact same thing is happening (running the same actionLists) somehow by running out of time it's making the actions act differently. For example if you fail "song_1", action "Fail_1" runs and then action "song_0" starts. This happens whether you fail by pressing the wrong note or by running out of time. When you fail by pressing the wrong button, everything works. However, when you run out of time the action "song_0" no longer works, even though it is running normally and all variables are correct / everything is reset properly. When I say that the action no longer works, this is the behavior: it fails on pressing the correct note (can be any note in the song, I can't see a pattern to it) and then it'll play the incorrect Fail action (I.E. failing "song_0" plays "Fail_1" when it's supposed to run "Fail_0").
I spent the entire day yesterday trying to figure this out, but I can't seem to make sense of why or how this would happen. So I'm not sure if it's an error on my end or a bug in AC. Any insight would be much appreciated. I'm hoping I just overlooked some small detail.
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
The actions are set up like this:
Action “song_1” (runs in background)
Run “timerSet” action (run from start)
Set variable “K3” = 1
Check variable “note” = 0
if 0, then check variable “note” = 0
if not 0, then check “note” = 1
if not 1, then run action “Fail_1”(run from start) (stop)
if 1, then check if “timerSet” is running
if not, then run action “Fail_1”(run from start) (stop)
if running, (plays corresponding sound and animation) and set “note” = 0
Check variable “note” = 0
if 0, then check variable “note” = 0
if not 0, then check “note” = 9
if not 9, then run action “Fail_1”(run from start) (stop)
if 9, then check if “timerSet” is running
if not, then run action “Fail_1”(run from start) (stop)
if running, then kill action “timerSet”, (play sound and animation), set “note” = 0, run action “Win_1” (run from start)
Action “timerSet” (runs in background)
Engine Wait X seconds
Action run “timerFailCheck”
Action “Fail_1” (pauses gameplay)
(plays sound and animation)
Turn off Menu “g”
Action kill “timerSet”
Action kill “song_1”
Variable set “note” = 0
(plays sounds and animations)
Engine wait 0.5s
Action run “song_0”
Turn on Menu “g”
Action “Win_1” (pauses gameplay)
(plays sound and animation)
Turn off Menu “g”
Action kill “timerSet”
Action kill “song_1”
Variable set “note” = 0
(plays sounds and animations)
Engine wait 0.5s
Action run “song_2”
Turn on Menu “g”
Action “timerFailCheck” (pause gameplay)
Variable check, “K3” = 0
then, run action “Fail_0” and kill action “song_0”
Else, Variable check, “K3” = 1
then, run action “Fail_1” and kill action “song_1”
ect
The timerSet Action is much more complicated and runs animations and sounds, but the above is a simplified version I experimented with to see if I could narrow down the issue. So it's better organized to run the timerSet and the timerFailCheck separately. Though I have experimented with combining them, with no luck.
The song, win and fail actions are all set up the same, just with different variables. I do have the active Actions displayed in engine already.
Additionally, the issue is not with "song_0" or any specific song action, it happens with any of the songs if the timer runs out.
I've gathered up screenshots of the actions the best I could. Hopefully that's helpful.
Like I mentioned above, the systems all work perfectly, variables are correct, actions trigger as they should, the song/note system works as it should, etc. It's only when the timer runs out (whether it's my standard timer as shown below or the simplified version I tried as stated above) is when it causes actions that are running to break in odd ways.
song_0:
song_1_FAIL:
song_1_WIN:
timerFailCheck:
The simplified timerSet (engine wait x sec, then run timerFailCheck) I did have set up in scene. But I didn't try totally stripping down the other actions until now. Once I had the bare bones running, the issue seems to be gone. It's tough to pin point what would have caused the issue.
I went back into my base project, and removed the "guitar" menu turning off while winning or failing, and this seems to fix the issue. However, when I go into the duplicate project (the one that's stripped down) and add in the menu turning off back in, the issue is still gone. So I'm assuming it's some combination of the menu turning off/on and the actions that are running. Which is strange since what I cut out was mostly just animations and sounds going off. And the fact that the same thing is happening when you win/fail versus the timer running out, in which case it works fine regardless.
So for now, I'm just going to leave the menu on, as that somehow fixes the issue. It sure is a weird one! I appreciate your help!
song_1:
song_1_FAIL:
song_1_WIN:
symbol_timerSet:
*not using "timerFailCheck" in this case
"song_1" starts, press a wrong note, "song_1_FAIL" runs, then "song_0" starts: can win or fail "song_0" normally
"song_1" starts, let timer run out, "song_1_FAIL" runs, then "song_0" starts: press correct note, "song_1_FAIL" runs (sometimes, you can play a couple correct notes before the incorrect fail action runs)
And keep in mind this isn't tied to any specific song, this pattern can happen from "song_2" to "song_1", from "song_3" to "song_2", etc.
So what the comments are telling me is that "song_1_FAIL" is being triggered by "song_1" BUT "song_1" is not running, "song_0" is running when this happens. I even put a comment at the start of both song actions, to see if it was getting briefly turned on by something but it is not. (I'm still using the AC Status Box as well.)
What it seems like is happening is that it's acting as though both "song_0" and "song_1" are running at the same time, even though they are not.