Behavior does not exist and exists at the same time

ColorPrinter

  • Posts: 2
All right, this one's a real stumper. In the behavior, the first time I try to change something in the Walking class (part of the Run and Jump kit), I get a console warning saying the behavior doesn't exist. When I try to change it via a key later, it does exist. I don't have these problems with Running, Wall Sliding, or Air Jumping.

Even weirder is something I forgot to get a picture of: If I add in commands asking whether or not Jumper has the behavior Walking, it says "true"...and apparently, it's even enabled as well. So what's going on here?

EDIT: Whoops, something went wrong. Those twos should be in the other box and the variable name in its place. That's not the problem, however.

Alexin

  • *
  • Posts: 3127
I guess it says it doesn't exist the first time because it isn't initialized yet. I can't say for sure, though. Perhaps Greg knows more.
"Find the fun"
alexin@stencyl.com

Darkhog

  • Posts: 1243
Maybe we should initialize every class used in scene (both scene and actor behaviors) BEFORE scene will load? Sure it'll increase scene loading time a bit but that way we'll avoid such errors in future.

There are no impossible things. There is only lack of skills.
Don't click this if your computer has less than 641 kilobytes of RAM.
Stencyl stencyling stencylish stencylers :D

ColorPrinter

  • Posts: 2
How would I go about doing that?

Epic428

  • Posts: 1118
there is a problem with using messaging blocks in the when created section of a behavior. I experienced this with another user and it was a very similar problem to this. Basically the behavior is not yet initialized, therefore the functions don't "exist". The way to solve this problem is to wrap all of your messaging blocks in a do after .1 seconds block. it should solve the problem.
James Moore - Official Support & Documentation.
We cannot and will not respond to PM's asking questions. Please make a new thread in the forums if you have any questions, Thank you.
For better support and faster response times, please post your logs regarding any Stencyl related issues. Debug > Logs > Generate Logs

Darkhog

  • Posts: 1243
@ColorPrinter You can't. Stencyl team must change engine to allow this.

There are no impossible things. There is only lack of skills.
Don't click this if your computer has less than 641 kilobytes of RAM.
Stencyl stencyling stencylish stencylers :D