[Solved] Game is crashing transitioning scenes

DylanMeeble

  • Posts: 24
I'm getting a stack overflow error. What happens is I have code blocks setup to enter a house and then basically the same blocks set to enter a different room in the house. Entering the house works fine, but going into the other room or trying to return to the previous "outside" scene crashes the game. I had this working fine, and I don't believe I changed anything. The only notable thing I did to the game since the last time it worked was delete/rename some sound files, but none of the scenes are using those sound files. 

The first picture is the code for entering the house, and the second is entering the kitchen.

« Last Edit: May 09, 2016, 05:17:52 am by DylanMeeble »

DylanMeeble

  • Posts: 24
Forgot to attach my logs.

Justin

  • *
  • Posts: 4716
The Stencyl logs don't capture the needed information. You'll need to get the error again and copy/paste the content of the flash debugger popup here instead.
For Live Support: Join our discord server and ping me @justin.
I'm most often available between 10am and 10pm Japan time. (GMT+9)

DylanMeeble

  • Posts: 24
Error: Error #1023: Stack overflow occurred.
   at flash.display::DisplayObject()
   at flash.display::Bitmap()
   at com.stencyl.graphics::BitmapAnimation()[C:/Program Files (x86)/Stencyl/plaf/haxe/lib/stencyl/1,00/com/stencyl/graphics/BitmapAnimation.hx:36]
   at com.stencyl.models::Actor/addAnim()[C:/Program Files (x86)/Stencyl/plaf/haxe/lib/stencyl/1,00/com/stencyl/models/Actor.hx:887]
   at com.stencyl.models::Actor()[C:/Program Files (x86)/Stencyl/plaf/haxe/lib/stencyl/1,00/com/stencyl/models/Actor.hx:527]
   at com.stencyl::Engine/createActor()[C:/Program Files (x86)/Stencyl/plaf/haxe/lib/stencyl/1,00/com/stencyl/Engine.hx:1813]
   at com.stencyl::Engine/createActorOfType()[C:/Program Files (x86)/Stencyl/plaf/haxe/lib/stencyl/1,00/com/stencyl/Engine.hx:2234]
   at com.stencyl::Engine/getRecycledActorOfTypeOnLayer()[C:/Program Files (x86)/Stencyl/plaf/haxe/lib/stencyl/1,00/com/stencyl/Engine.hx:2204]
   at com.stencyl.behavior::Script$/createRecycledActorOnLayer()[C:/Program Files (x86)/Stencyl/plaf/haxe/lib/stencyl/1,00/com/stencyl/behavior/Script.hx:1714]
   at scripts::SceneEvents_7/init()[Source/scripts/SceneEvents_7.hx:89]
   at com.stencyl.behavior::Behavior/initScript()[C:/Program Files (x86)/Stencyl/plaf/haxe/lib/stencyl/1,00/com/stencyl/behavior/Behavior.hx:97]
   at com.stencyl.behavior::BehaviorManager/initScripts()[C:/Program Files (x86)/Stencyl/plaf/haxe/lib/stencyl/1,00/com/stencyl/behavior/BehaviorManager.hx:105]
   at com.stencyl.models::Actor/initScripts()[C:/Program Files (x86)/Stencyl/plaf/haxe/lib/stencyl/1,00/com/stencyl/models/Actor.hx:904]
   at com.stencyl::Engine/createActorOfType()[C:/Program Files (x86)/Stencyl/plaf/haxe/lib/stencyl/1,00/com/stencyl/Engine.hx:2235]
   at com.stencyl::Engine/getRecycledActorOfTypeOnLayer()[C:/Program Files (x86)/Stencyl/plaf/haxe/lib/stencyl/1,00/com/stencyl/Engine.hx:2204]
   at com.stencyl.behavior::Script$/createRecycledActorOnLayer()[C:/Program Files (x86)/Stencyl/plaf/haxe/lib/stencyl/1,00/com/stencyl/behavior/Script.hx:1714]
   at scripts::SceneEvents_7/init()[Source/scripts/SceneEvents_7.hx:89]
   at com.stencyl.behavior::Behavior/initScript()[C:/Program Files (x86)/Stencyl/plaf/haxe/lib/stencyl/1,00/com/stencyl/behavior/Behavior.hx:97]
   at com.stencyl.behavior::BehaviorManager/initScripts()[C:/Program Files (x86)/Stencyl/plaf/haxe/lib/stencyl/1,00/com/stencyl/behavior/BehaviorManager.hx:105]
   at com.stencyl.models::Actor/initScripts()[C:/Program Files (x86)/Stencyl/plaf/haxe/lib/stencyl/1,00/com/stencyl/models/Actor.hx:904]
   at com.stencyl::Engine/createActorOfType()[C:/Program Files (x86)/Stencyl/plaf/haxe/lib/stencyl/1,00/com/stencyl/Engine.hx:2235]
   at com.stencyl::Engine/getRecycledActorOfTypeOnLayer()[C:/Program Files (x86)/Stencyl/plaf/haxe/lib/stencyl/1,00/com/stencyl/Engine.hx:2204]
   at com.stencyl.behavior::Script$/createRecycledActorOnLayer()[C:/Program Files (x86)/Stencyl/plaf/haxe/lib/stencyl/1,00/com/stencyl/behavior/Script.hx:1714]
   at scripts::SceneEvents_7/init()[Source/scripts/SceneEvents_7.hx:89]
   at com.stencyl.behavior::Behavior/initScript()[C:/Program Files (x86)/Stencyl/plaf/haxe/lib/stencyl/1,00/com/stencyl/behavior/Behavior.hx:97]
   at com.stencyl.behavior::BehaviorManager/initScripts()[C:/Program Files (x86)/Stencyl/plaf/haxe/lib/stencyl/1,00/com/stencyl/behavior/BehaviorManager.hx:105]
   at com.stencyl.models::Actor/initScripts()[C:/Program Files (x86)/Stencyl/plaf/haxe/lib/stencyl/1,00/com/stencyl/models/Actor.hx:904]
   at com.stencyl::Engine/createActorOfType()[C:/Program Files (x86)/Stencyl/plaf/haxe/lib/stencyl/1,00/com/stencyl/Engine.hx:2235]
   at com.stencyl::Engine/getRecycledActorOfTypeOnLayer()[C:/Program Files (x86)/Stencyl/plaf/haxe/lib/stencyl/1,00/com/stencyl/Engine.hx:2204]
   at com.stencyl.behavior::Script$/createRecycledActorOnLayer()[C:/Program Files (x86)/Stencyl/plaf/haxe/lib/stencyl/1,00/com/stencyl/behavior/Script.hx:1714]
   at scripts::SceneEvents_7/init()[Source/scripts/SceneEvents_7.hx:89]
   at com.stencyl.behavior::Behavior/initScript()[C:/Program Files (x86)/Stencyl/plaf/haxe/lib/stencyl/1,00/com/stencyl/behavior/Behavior.hx:97]
   at com.stencyl.behavior::BehaviorManager/initScripts()[C:/Program Files (x86)/Stencyl/plaf/haxe/lib/stencyl/1,00/com/stencyl/behavior/BehaviorManager.hx:105]
   at com.stencyl.models::Actor/initScripts()[C:/Program Files (x86)/Stencyl/plaf/haxe/lib/stencyl/1,00/com/stencyl/models/Actor.hx:904]
   at com.stencyl::Engine/createActorOfType()[C:/Program Files (x86)/Stencyl/plaf/haxe/lib/stencyl/1,00/com/stencyl/Engine.hx:2235]
   at com.stencyl::Engine/getRecycledActorOfTypeOnLayer()[C:/Program Files (x86)/Stencyl/plaf/haxe/lib/stencyl/1,00/com/stencyl/Engine.hx:2204]
   at com.stencyl.behavior::Script$/createRecycledActorOnLayer()[C:/Program Files (x86)/Stencyl/plaf/haxe/lib/stencyl/1,00/com/stencyl/behavior/Script.hx:1714]
   at scripts::SceneEvents_7/init()[Source/scripts/SceneEvents_7.hx:89]
   at com.stencyl.behavior::Behavior/initScript()[C:/Program Files (x86)/Stencyl/plaf/haxe/lib/stencyl/1,00/com/stencyl/behavior/Behavior.hx:97]
   at com.stencyl.behavior::BehaviorManager/initScripts()[C:/Program Files (x86)/Stencyl/plaf/haxe/lib/stencyl/1,00/com/stencyl/behavior/BehaviorManager.hx:105]
   at com.stencyl.models::Actor/initScripts()[C:/Program Files (x86)/Stencyl/plaf/haxe/lib/stencyl/1,00/com/stencyl/models/Actor.hx:904]
   at com.stencyl::Engine/createActorOfType()[C:/Program Files (x86)/Stencyl/plaf/haxe/lib/stencyl/1,00/com/stencyl/Engine.hx:2235]
   at com.stencyl::Engine/getRecycledActorOfTypeOnLayer()[C:/Program Files (x86)/Stencyl/plaf/haxe/lib/stencyl/1,00/com/stencyl/Engine.hx:2204]
   at com.stencyl.behavior::Script$/createRecycledActorOnLayer()[C:/Program Files (x86)/Stencyl/plaf/haxe/lib/stencyl/1,00/com/stencyl/behavior/Script.hx:1714]
   at scripts::SceneEvents_7/init()[Source/scripts/SceneEvents_7.hx:89]
   at com.stencyl.behavior::Behavior/initScript()[C:/Program Files (x86)/Stencyl/plaf/haxe/lib/stencyl/1,00/com/stencyl/behavior/Behavior.hx:97]
   at com.stencyl.behavior::BehaviorManager/initScripts()[C:/Program Files (x86)/Stencyl/plaf/haxe/lib/stencyl/1,00/com/stencyl/behavior/BehaviorManager.hx:105]
   at com.stencyl.models::Actor/initScripts()[C:/Program Files (x86)/Stencyl/plaf/haxe/lib/stencyl/1,00/com/stencyl/models/Actor.hx:904]
   at com.stencyl::Engine/createActorOfType()[C:/Program Files (x86)/Stencyl/plaf/haxe/lib/stencyl/1,00/com/stencyl/Engine.hx:2235]
   at com.stencyl::Engine/getRecycledActorOfTypeOnLayer()[C:/Program Files (x86)/Stencyl/plaf/haxe/lib/stencyl/1,00/com/stencyl/Engine.hx:2204]
   at com.stencyl.behavior::Script$/createRecycledActorOnLayer()[C:/Program Files (x86)/Stencyl/plaf/haxe/lib/stencyl/1,00/com/stencyl/behavior/Script.hx:1714]
   at scripts::SceneEvents_7/init()[Source/scripts/SceneEvents_7.hx:89]
   at com.stencyl.behavior::Behavior/initScript()[C:/Program Files (x86)/Stencyl/plaf/haxe/lib/stencyl/1,00/com/stencyl/behavior/Behavior.hx:97]
   at com.stencyl.behavior::BehaviorManager/initScripts()[C:/Program Files (x86)/Stencyl/plaf/haxe/lib/stencyl/1,00/com/stencyl/behavior/BehaviorManager.hx:105]
   at com.stencyl.models::Actor/initScripts()[C:/Program Files (x86)/Stencyl/plaf/haxe/lib/stencyl/1,00/com/stencyl/models/Actor.hx:904]
   at com.stencyl::Engine/createActorOfType()[C:/Program Files (x86)/Stencyl/plaf/haxe/lib/stencyl/1,00/com/stencyl/Engine.hx:2235]
   at com.stencyl::Engine/getRecycledActorOfTypeOnLayer()[C:/Program Files (x86)/Stencyl/plaf/haxe/lib/stencyl/1,00/com/stencyl/Engine.hx:2204]
   at com.stencyl.behavior::Script$/createRecycledActorOnLayer()[C:/Program Files (x86)/Stencyl/plaf/haxe/lib/stencyl/1,00/com/stencyl/behavior/Script.hx:1714]
   at scripts::SceneEvents_7/init()[Source/scripts/SceneEvents_7.hx:89]
   at com.stencyl.behavior::Behavior/initScript()[C:/Program Files (x86)/Stencyl/plaf/haxe/lib/stencyl/1,00/com/stencyl/behavior/Behavior.hx:97]
   at com.stencyl.behavior::BehaviorManager/initScripts()[C:/Program Files (x86)/Stencyl/plaf/haxe/lib/stencyl/1,00/com/stencyl/behavior/BehaviorManager.hx:105]
   at com.stencyl.models::Actor/initScripts()[C:/Program Files (x86)/Stencyl/plaf/haxe/lib/stencyl/1,00/com/stencyl/models/Actor.hx:904]
   at com.stencyl::Engine/createActorOfType()[C:/Program Files (x86)/Stencyl/plaf/haxe/lib/stencyl/1,00/com/stencyl/Engine.hx:2235]
   at com.stencyl::Engine/getRecycledActorOfTypeOnLayer()[C:/Program Files (x86)/Stencyl/plaf/haxe/lib/stencyl/1,00/com/stencyl/Engine.hx:2204]

Justin

  • *
  • Posts: 4716
This is kind of weird. I can't explain it without seeing your game. Could you send it to me so I can take a look?
For Live Support: Join our discord server and ping me @justin.
I'm most often available between 10am and 10pm Japan time. (GMT+9)

DylanMeeble

  • Posts: 24
Sorry, how can I post my game so only you can see it?

Justin

  • *
  • Posts: 4716
You can send me a PM with a link.
For Live Support: Join our discord server and ping me @justin.
I'm most often available between 10am and 10pm Japan time. (GMT+9)

DylanMeeble

  • Posts: 24
I sent it to you, are you able to repeat the error?

Justin

  • *
  • Posts: 4716
Haven't had time to test it yet, I'm going to try to get to it today but lots of people coming over for Mother's Day so I can't make any guarantees.
For Live Support: Join our discord server and ping me @justin.
I'm most often available between 10am and 10pm Japan time. (GMT+9)

DylanMeeble

  • Posts: 24
Of course, I understand! Thank you.

Justin

  • *
  • Posts: 4716
Okay so here's the problem. Your actor Brato actually has information for -5- behaviors attached to it. The 4 you see in the behavior page, and then it actually also has SceneEvents_7, which is the events for Brato Hallway.

I have no idea how it's possible that a scene events behavior was attached to an actor type (in the first place, events are usually only attached to one specific scene or actor type). You can fix it by going to stencylworks/games/DylanMeeble_Game/resources/data.xml, and remove the information for snippet id=24 from your Brato actor.

This is what you're looking for, with unnecessary information omitted.
Get rid of the whole < s>...< /s> where id = 24.
Code: [Select]
<actor ... id="0" ... name="Brato" ...>
    <snippets>
        <s enabled="true" id="1">
        <s enabled="true" id="3">
        <s enabled="true" id="24">
            <prop id="2147483647" list="0" val="thisactor"/>
        </s>
        <s enabled="true" id="10">
        <s enabled="true" id="26">
    </snippets>
</actor>


Now this could cause some really weird issues. Why was it an issue in your case? Because that scene has a "created" event that creates Brato. Because Brato has that scene's events attached somehow, when Brato is created, it calls "created" again for the scene. It's a never ending loop that causes a stack overflow.

« Last Edit: May 08, 2016, 07:50:59 pm by Justin »
For Live Support: Join our discord server and ping me @justin.
I'm most often available between 10am and 10pm Japan time. (GMT+9)

DylanMeeble

  • Posts: 24
Great! That fixed it! That is super bizarre though. I don't have a clue how I managed to attach a scene event behavior to my actor... I wish I could duplicate it to give you more information. At the time I noticed the error the only thing I was working on was regions in the living room and in the kitchen scene. The only other thing that was changed was sound files being renamed/deleted. So it's even more weird that an event from the Hallway got attached when at the time I don't believe I made any changes to that scene. Also, why would the error not occur when entering the house into the living room scene, since the living room has a "created" event as well?

Anyway, thank you so much for your help! I'll be paying closer attention to every change and action I do so if something else like this happens I'll be able to give you more details. Thanks again!  :D

Justin

  • *
  • Posts: 4716
The code from the scene event runs every time the actor is created. It only creates the actor when previous location is a certain value though. So it doesn't matter what scene you're entering, it always crashed if you leave the scenes with previous location values of 1, 3, 4, or 5.
For Live Support: Join our discord server and ping me @justin.
I'm most often available between 10am and 10pm Japan time. (GMT+9)

DylanMeeble

  • Posts: 24
Oh, I understand now. Thanks!