[3.1.2] Patch
Catspeak » Devlog
- Add codegen for simple calls with 4 and 5 parameters (gets around an LTS runner bug). (Harlem512) (Addendum #1)
- Added
catspeak_get_selfandcatspeak_get_index. (tabularelf) (Addendum #2) - Further patch for built-in functions with optional args.
Addendum #1 (written by Harlem512)
script_execute_ext<br>has issues with optional arguments for built-in functions. The following code fails:// expected output is `[ ]`, however this returns `["","","",""]` var ext = script_execute_ext(string_split, ["AAAA", "A", true]) var normal = string_split("AAAA", "A", true) // fails assertEq(array_length(ext), array_length(normal))For most functions this isn't a problem, since__compileCalldoes some short-cutting based on number of arguments (and the shortcuts usescript_execute, which does allow for optional arguments). However, some built-in functions (notablyinstance_create_depthandinstance_create_layer) have more than 3 arguments and fail.var parsed = Catspeak.parseString("instance_create_depth(0,0, -100, dummy_object, {my_var:20})") var compiled = Catspeak.compile(parsed) var inst = compiled() // fails assertEq(inst.my_var, 20)This pr adds__catspeak_expr_call_4__and__catspeak_expr_call_5__to bypass this issue.
Addendum #2 (written by tabularelf)
This PR introducescatspeak_get_selfandcatspeak_get_index, which play as counterparts tomethod_get_selfandmethod_get_index. The reason for this is thatmethod_get_indexwill return__catspeak_function__or__catspeak_method__from Catspeak programs. And even then, not as a method but as a GML function index. That's likely to cause all sorts of issues.method_get_selfalso has the unfortunate issue where it could return the Catspeak program struct itself. Which may also be unintended depending on who you ask.
catspeak_get_indexresolves this by always returning a method. Never a function ID. This means that any Catspeak functions or Catspeak methods, will always return their callee program "as is". And any GML function will be returned as a method with a bound toundefined.
catspeak_get_selfresolves this by returning self from only GML functions and Catspeak methods. Anything marked as a Catspeak function (viais_catspeak) will retrieveself_via accessor (if it exists), or returnsundefined.
Files
catspeak_3.1.2.yymps 86 kB
2 days ago
Get Catspeak
Catspeak
Modding language for GameMaker games
| Status | Released |
| Category | Other |
| Author | katsaii |
| Tags | Open Source |
More posts
- [4.0.0] Catspeak 4 - Beta2 days ago
- [3.4.1] Patch2 days ago
- [3.4.0] In a Cushioned Room, Cats Alone, Making Speaks2 days ago
- [3.3.0] Unknown Zhombie Credit2 days ago
- [3.2.0] Fae Well of Bugs, and Ferns, and Such2 days ago
- [3.1.1] Patch2 days ago
- [3.1.0] With Moss and Witches2 days ago
- [3.0.2] Patch2 days ago
- [3.0.1] Patch2 days ago

Leave a comment
Log in with itch.io to leave a comment.