datzach / gmlodash Goto Github PK
View Code? Open in Web Editor NEWA port of the Javascript library to GML2.3
License: Other
A port of the Javascript library to GML2.3
License: Other
Hello! I've discovered what might be an issue with GMLodash. I haven't been able to find a GM-specific bug for this issue (though I'll continue to find if one exists one).
To create a reproducible setup, I created a new blank project and added the following test object to the starting room:
Create event:
/// @description Set up struct for listening
users = [
{ user: "foo", age: 25, active: true },
{ user: "bar", age: 29, active: false },
{ user: "baz", age: 29, active: true }
];
Step event:
/// @description Listen for keyboard input and use GMLodash
if(keyboard_check_pressed(ord("1"))) {
var returned = _.find(users, { active: false });
show_debug_message(string(returned));
}
if(keyboard_check_pressed(ord("2"))) {
var returned = _.find(users, { active: true });
show_debug_message(string(returned));
}
All this does is listen to the keyboard inputs 1 and 2, and it would console out matches within the users
array. This works find when I run the game in VM
mode. But when I switch to YYC
mode and try run it, it fails to build with the following error:
Error : gml_Object_testFindFunction_Step_0(0) : Fatal Error while compiling gml_Object_testFindFunction_Step_0 - bailing details below
Final Compile...System.InvalidOperationException: Stack empty.
at System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource)
at System.Collections.Generic.Stack`1.Pop()
at GMAssetCompiler.GML2CPP.�(GMLToken �, Boolean �, StringBuilder �, CPPVarRef �)
at GMAssetCompiler.GML2CPP.�(GMLToken �)
at GMAssetCompiler.GML2CPP.�(GMLToken �)
at GMAssetCompiler.GML2CPP.�(GMLToken �)
at GMAssetCompiler.GML2CPP.�(GMLToken �)
at GMAssetCompiler.GML2CPP.�(GMLToken �)
at GMAssetCompiler.GML2CPP.�(GMLToken �)
at GMAssetCompiler.GML2CPP.�(GMLToken �)
at GMAssetCompiler.GML2CPP.�(GMLToken �)
at GMAssetCompiler.GML2CPP.�(GMLToken �)
at GMAssetCompiler.GML2CPP.�(GMLToken �)
at GMAssetCompiler.GML2CPP.�(GMAssets �, � �)
finished.
And some additional information: when I comment-out the use use _.find()
and have nothing in the project using GMLodash - but with GMLodash still included as a separate script
file - I get the following different set of errors:
Build for architecture - x86
Z:/text-gm-lo_2443EE70_611E4F00/text-gm-lodash-yyc/Default/Scripts/llvm-win/gml_Object_testFindFunction_Step_0.gml.cpp:43:66: error: use of undeclared identifier 'kVARID_self_returned'
YYRValue* sself_returned = &((CInstanceBase*)pSelf)->GetYYVarRef(kVARID_self_returned); /* set ContextID to sself_returned */
^
1 error generated.
Z:/text-gm-lo_2443EE70_611E4F00/text-gm-lodash-yyc/Default/Scripts/llvm-win/gml_GlobalScript_gmLodash.gml.cpp:4678:10: error: redefinition of 'local_args' with a different type: 'YYRValue' vs 'YYLocalArgs'
YYRValue local_args;
^
Z:/text-gm-lo_2443EE70_611E4F00/text-gm-lodash-yyc/Default/Scripts/llvm-win/gml_GlobalScript_gmLodash.gml.cpp:4666:13: note: previous definition is here
YYLocalArgs local_args( _count, 2, _args );
^
Z:/text-gm-lo_2443EE70_611E4F00/text-gm-lodash-yyc/Default/Scripts/llvm-win/gml_GlobalScript_gmLodash.gml.cpp:4762:11: error: no viable overloaded '='
local_args=YYGML_ds_stack_pop((int)(int64)((int)(int64)/* local */local_stack.asReal()));
~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
X://yyc/include\YYGML.h:2328:8: note: candidate function (the implicit copy assignment operator) not viable: no known conversion from 'YYRValue' to 'const YYLocalArgs' for 1st argument
struct YYLocalArgs
^
Z:/text-gm-lo_2443EE70_611E4F00/text-gm-lodash-yyc/Default/Scripts/llvm-win/gml_GlobalScript_gmLodash.gml.cpp:4765:153: error: type 'YYLocalArgs' does not provide a subscript operator
local_value=/* array index changed from System.Collections.Generic.List`1[System.String] to System.Collections.Generic.List`1[System.String]*/local_args[(int)(0)];
~~~~~~~~~~^~~~~~~~~
Z:/text-gm-lo_2443EE70_611E4F00/text-gm-lodash-yyc/Default/Scripts/llvm-win/gml_GlobalScript_gmLodash.gml.cpp:4769:37: error: type 'YYLocalArgs' does not provide a subscript operator
local_limit=/* volatile */local_args[(int)(1)];
~~~~~~~~~~^~~~~~~~~
4 errors generated.
I'm running GM v2.3.0.529, Runtime v2.3.0.401; I'll continue to look for other causes of this, and I'll update this issue if/when I find any other info.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.