weird bugs after upgrading of the game

1MrPaul1

  • *
  • Posts: 1279
im trying to run my old game in the newest version of stencyl and getting a lot of null errors in the default blocks
like in the screenshot.
what can be a reason?

1MrPaul1

  • *
  • Posts: 1279
this is the line of the error       Utils.clear(_Words);

merrak

  • *
  • Posts: 2540
...getting a lot of null errors in the default blocks

Can you post the logfiles?

Sometimes just compiling again will help--if the error was in the part of the process that translates the blocks to Haxe code. I've ran into that issue when updating a game.

1MrPaul1

  • *
  • Posts: 1279
jar:file:/C:/Program%20Files/Stencyl/sw.jar!/res/logview4j/images/info.gif   false   INFO   1584904310106004998   stencyl.sw.util.platform.Flash   [Flash] ApplicationMain#uncaughtErrorHandler(298): TypeError: Error #1009: Cannot access a property or method of a null object reference.
jar:file:/C:/Program%20Files/Stencyl/sw.jar!/res/logview4j/images/info.gif   false   INFO   1584904306026004995   stencyl.sw.util.platform.Flash   [Flash] com.stencyl.Engine#switchScene(1895): Switching to scene 28
jar:file:/C:/Program%20Files/Stencyl/sw.jar!/res/logview4j/images/info.gif   false   INFO   1584904309586004997   stencyl.sw.util.platform.Flash   [Flash] com.stencyl.Engine#switchScene(1895): Switching to scene 29
jar:file:/C:/Program%20Files/Stencyl/sw.jar!/res/logview4j/images/info.gif   false   INFO   1584904303970004978   stencyl.sw.util.platform.Flash   [Flash] com.stencyl.utils.ToolsetInterface#cancelConnection(60): Couldn't establish gci connection.
jar:file:/C:/Program%20Files/Stencyl/sw.jar!/res/logview4j/images/info.gif   false   INFO   1584904298831004975   stencyl.sw.util.platform.Flash   [Flash] com.stencyl.utils.ToolsetInterface#new(46): GCI attempting to connect to toolset @localhost:64869
jar:file:/C:/Program%20Files/Stencyl/sw.jar!/res/logview4j/images/info.gif   false   INFO   1584904306526004996   stencyl.sw.util.platform.Flash   [Flash] scripts.ActorEvents_1187#init(96): scene reload falce


just null object reference, but im just trying to clear the list attribute


In the html5 console i can see little more info

Design_606_606_WelcomeScene.hx:93 Uncaught TypeError: Cannot set property 'length' of null
    at scripts_Design_$606_$606_$WelcomeScene._customEvent_SHOWBUBBLE (Design_606_606_WelcomeScene.hx:93)
    at com_stencyl_behavior_BehaviorManager.call2 (BehaviorManager.hx:245)
    at com_stencyl_Engine.say (Engine.hx:3385)
    at Function.com_stencyl_behavior_Script.sayToScene (Script.hx:1190)
    at com_stencyl_behavior_TimedTask.toExecute (Design_606_606_WelcomeScene.hx:187)
    at com_stencyl_behavior_TimedTask.update (TimedTask.hx:48)
    at com_stencyl_Engine.update (Engine.hx:2574)
    at com_stencyl_Engine.postUpdate (Engine.hx:2836)
    at com_stencyl_Engine.onUpdate (Engine.hx:2828)
    at openfl_display_Stage.__dispatchEvent (EventDispatcher.hx:402)

Luyren

  • *
  • Posts: 2019
Are you setting your list to "create new list" before doing anything with it?
My Stencyl resources are available here: https://luyren.itch.io/
Cutscenes, RPG Elements, Particles, Map System and many more.
Twitter

merrak

  • *
  • Posts: 2540
just null object reference, but im just trying to clear the list attribute

You can't clear a null list. Emptying a list, with regards to that block, is like taking the garbage can out to empty it... but in this case, the can isn't even there.

A list attribute that has to default value set will be null, rather than an empty list. There are three easy ways to fix this:

1. Give the list attribute some default contents.
2. In 'on created', set the list attribute to 'create new list'
3. Put the 'empty Words' block in an if wrapper: if Words has value...
do the same for TextList

If I remember correctly, at one point list attributes defaulted to empty lists, rather than null. Some time this was changed. Your game must predate that change.

1MrPaul1

  • *
  • Posts: 1279
just null object reference, but im just trying to clear the list attribute

You can't clear a null list. Emptying a list, with regards to that block, is like taking the garbage can out to empty it... but in this case, the can isn't even there.

A list attribute that has to default value set will be null, rather than an empty list. There are three easy ways to fix this:

1. Give the list attribute some default contents.
2. In 'on created', set the list attribute to 'create new list'
3. Put the 'empty Words' block in an if wrapper: if Words has value...
do the same for TextList

If I remember correctly, at one point list attributes defaulted to empty lists, rather than null. Some time this was changed. Your game must predate that change.

I did everything as you suggested. the error changed but the game still freezes in the same place

merrak

  • *
  • Posts: 2540
I see you set TextList to 'new list', but what about TextLines? Did you intend to use a different list there?

yoplalala

  • *
  • Posts: 1557
You must also set TextLines to create new list in "when Created"
Basically , do this for all the lists and maps.

1MrPaul1

  • *
  • Posts: 1279
Oh, yeah, it was the same attribute name and error line but in the other behavior
but i still have errors, in the different place now

yoplalala

  • *
  • Posts: 1557
It has to do with an actor and a layer where he should be on. Do you have all the code /or  blocks so we can see ?

1MrPaul1

  • *
  • Posts: 1279
update, i found where is the problem, i deleted some actors after 0.2 sec after press, it worked before but makes errors now. not sure why i was need to delete this actors, just do not dleting them now and errors not happen.
Thank you Guys, will need to fix all elements with lists now than will see if other parts of the game will work.