View Issue Details

IDProjectCategoryView StatusLast Update
0026573RunnerFunctionsPublic2018-10-26 11:36
ReporterDanAssigned ToRussell Kay 
PriorityHighSeverityC - GeneralReproducibility100%
Status ClosedResolutionFixed 
PlatformWindowsOSWindows 10OS VersionPro x64
Product VersionPre-2.1.3 
Target Version2.2.1Fixed in Version2.2.1 
Summary0026573: Functions: instance_create_depth() should throw a compile error when passed a non-number string for the depth value
Descriptioninstance_create_depth() should throw a compile error when passed a non-number string for the depth value (i.e., a layer name). Right now, it allows the string, but this is invalid in the runner, and so your whole game is drawn as a black screen.

[EDIT: This change was likely a red herring as to what the actual issue was in this sample project that was causing the black screen, but coincidentally did expose a legit bug.]
Steps To Reproduce1. Import the attached sample.
2. Run it for Windows.
3. Observe no compile errors, but game just draws a black screen/nothing.
4. Swap out the code in the tank object's Create event and run the game again and observe it is fixed now.

Repro: 100%
TagsNo tags attached.
1.4 Found In
2.x Runtime Found In2.0.6.93
2.x Runtime Verified In2.2.1.268



2017-05-19 08:54


TanksPrototype.yyz (20,231 bytes)

Mike Dailly

2017-05-19 09:18

Developer   ~0053239

Won't throw a compile error, but could throw a runtime one.

Mike Rennie

2017-08-08 15:59

Developer   ~0054817

Looking at what the code does internally it'll actually try to convert a string to a number - i.e. it'll convert "100" to the actual numerical value. I'm not sure if that's what we actually want but I suppose it's not technically 'wrong'. It does mean that if we want to maintain that functionality I can't just do a string check and throw an error.

Russell Kay

2018-06-14 14:30

Manager   ~0060269

Fixed in gitlab


2018-10-26 09:43

Adminstrator   ~0061864

Last edited: 2018-10-26 09:46

View 2 revisions

Realised when verifying this that YYGTest has long done the exact same thing, and that always worked fine, but now throws a code error. Re-ran this sample in 2.2.0 (before our change to do the code error), and the sample works as expected, so the real fix for this project's issue must have been done previously.

We should undo this change before 2.2.1 goes out, as now devs will needless get a code error for previously-working code.


2018-10-26 11:23

Adminstrator   ~0061865

Okay, so... YYGTest and the sample above both work in 2.2.0, but the reason they work is because instance_create_depth() taking in a string has always just returned 0. The "Instances" layer happens to be 0, so it appeared to work.

The fix is good, as it stops user code issues when the layer specified does not equal 0. It also DOES now work if you pass in a string of a suitable depth number - e.g., "100".