summaryrefslogtreecommitdiffstats
path: root/modules/gdscript/gdscript_functions.cpp
Commit message (Collapse)AuthorAgeFilesLines
* GDScript: enable type checks on release modeGeorge Marques2020-01-081-3/+4
| | | | | Also make builtin GDScript functions report return type as Variant in release so type is converted when needed.
* Update copyright statements to 2020Rémi Verschelde2020-01-011-2/+2
| | | | | | | | | | | Happy new year to the wonderful Godot community! We're starting a new decade with a well-established, non-profit, free and open source game engine, and tons of further improvements in the pipeline from hundreds of contributors. Godot will keep getting better, and we're looking forward to all the games that the community will keep developing and releasing with it.
* Updates docs for GDScript built-in functionsHaoyu Qiu2019-12-151-1/+1
| | | | | | | * Adds description for `ord()` * Adds relationship description between `char()` and `ord()` * Describes the argument of `char()` as Unicode code point instead of ASCII code * Fixes wrong interval notation in `randi()` description
* Merge pull request #33018 from Xrayez/fix-inst2dict-gettersRémi Verschelde2019-12-111-17/+3
|\ | | | | Fix `inst2dict` calling to getters to retrieve value
| * Fix `inst2dict` calling to getters to retrieve valueAndrii Doroshenko (Xrayez)2019-10-241-17/+3
| | | | | | | | | | | | Use `GDScriptInstance` to iterate through all members directly instead. This is similar to how `dict2inst` works and makes the serialization behaviour more consistent.
* | Use GDScript resource path over script path for `inst2dict`Andrii Doroshenko (Xrayez)2019-11-021-1/+1
| | | | | | | | | | | | | | The resource path holds the original path which can be used to convert a dictionary to instance consistently both within editor and exported projects as the original path is automatically remapped from `gd` to `gdc` or `gde` in exported projects.
* | Provide and print error messages for JSON parsingAndrii Doroshenko (Xrayez)2019-10-311-0/+1
| | | | | | | | Core is not touched, only for binding and scripting.
* | Fixed leak in gdscript when creating empty WeakRefPouleyKetchoupp2019-10-291-1/+2
|/ | | | Fixes #33150
* Allow weakref(null) in gdscriptWindy Darian2019-09-161-25/+19
| | | | Tiny addition I personally found useful - this allows us to `var my_ref := weakref(null)` for nullable weak ref (with type hint!). When trying to test if `my_ref` is holding valid reference, we can just `if my_ref.get_ref():` instead of `if my_ref and my_ref.get_ref():` everywhere.
* Add ord() function to return Unicode code point of a string of length oneMasoud Montazeri2019-08-281-0/+36
|
* Replace 'ERR_EXPLAIN' with 'ERR_FAIL_*_MSG' in "platform", ↵Robin Hübner2019-08-091-2/+1
| | | | "modules/gdnative", "modules/gdscript" directories.
* Added lerp_angles built-in functionChaosus2019-07-201-0/+13
| | | | | Co-authored-by: Xrayez <https://github.com/Xrayez> Co-authored-by: DleanJeans <https://github.com/DleanJeans>
* Add integer posmod and rename default arg namesAaron Franke2019-07-181-3/+16
| | | | | "posmod" is the integer version of "fposmod". We do not need a "mod" because of the % operator. I changed the default arg names from "x" and "y" to "a" and "b" because they are not coordinates. I also changed pow's arg names to "base" and "exp". Also, I reorganized the code in the VS built-in funcs switch statement.
* Fix error macro calls not ending with semicolonRémi Verschelde2019-06-111-1/+1
| | | | | | | It's not necessary, but the vast majority of calls of error macros do have an ending semicolon, so it's best to be consistent. Most WARN_DEPRECATED calls did *not* have a semicolon, but there's no reason for them to be treated differently.
* Added move_toward functions for float, Vector2 and Vector3Giacom2019-05-281-0/+14
|
* Make "decimal" functions more consistentAaron Franke2019-04-301-1/+15
| | | | In GDScript, rename "decimals" to "step_decimals". In C#, add "StepDecimals", but keep the old functionality in a method called "DecimalCount".
* [Core] Expose approximate equality methods to GDScriptAaron Franke2019-04-251-0/+23
|
* Merge pull request #27231 from Chaosus/smoothstepRémi Verschelde2019-04-081-0/+14
|\ | | | | Added smoothstep built-in function
| * Added smoothstep built-in functionChaosus2019-04-071-0/+14
| |
* | Add object encoding param to serialization methodsFabio Alessandrelli2019-04-011-8/+49
|/ | | | | | | | | Network peers get_var/put_var File get_var/store_var GDScript/Mono/VisualScript bytes2var/var2bytes Add MultiplayerAPI.allow_object_decoding member which deprecates PacketPeer.allow_object_decoding. Break ABI compatibaility (API compatibility for GDNative).
* GDScript: Fix return value of "lerp" builtinRémi Verschelde2019-01-181-1/+2
| | | | Fixes #25082, fixes #24709.
* Update copyright statements to 2019Rémi Verschelde2019-01-011-2/+2
| | | | Happy new year to the wonderful Godot community!
* i18n: Sync translation template with current sourceRémi Verschelde2018-12-131-1/+1
| | | | Also French translation update and misc fixes to source strings.
* Merge pull request #22934 from SeleckyErik/issue-11457Rémi Verschelde2018-12-071-10/+2
|\ | | | | GDscript function str2var now returns null on invalid input
| * GDscript function str2var now returns input string on invalid inputErik2018-11-281-10/+2
| | | | | | | | | | | | | | str2var used to raise a blocking error when invalid input was passed. Now it logs an error message and returns the input string. This solution was proposed in #13021. Closes #11457 and #13021.
* | Add new "push_*()" functions to GDScriptMichael Alexsander Silva Dias2018-10-311-4/+47
|/
* Fixed argument names being swapped for atan2DualMatrix2018-09-161-1/+1
| | | | The arguments of atan2() should be y,x instead of x,y This was just wrong since the internal atan2 already had y,x as parameters, so if you followed the autocomplete the result would just be wrong.
* Make core/ includes absolute, remove subfolders from include pathRémi Verschelde2018-09-121-8/+8
| | | | | | This allows more consistency in the manner we include core headers, where previously there would be a mix of absolute, relative and include path-dependent includes.
* Fixed return type for get_stack() function callWiggleWizard2018-09-051-1/+1
|
* Make some debug prints verbose-only, remove othersRémi Verschelde2018-08-241-6/+0
|
* GDScript: Enable built-in function introspection in non-toolsGeorge Marques2018-07-251-1/+1
| | | | Only for debug builds. Fix problems in non-tools targets.
* Reduce unnecessary COW on Vector by make writing explicitHein-Pieter van Braam2018-07-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | This commit makes operator[] on Vector const and adds a write proxy to it. From now on writes to Vectors need to happen through the .write proxy. So for instance: Vector<int> vec; vec.push_back(10); std::cout << vec[0] << std::endl; vec.write[0] = 20; Failing to use the .write proxy will cause a compilation error. In addition COWable datatypes can now embed a CowData pointer to their data. This means that String, CharString, and VMap no longer use or derive from Vector. _ALWAYS_INLINE_ and _FORCE_INLINE_ are now equivalent for debug and non-debug builds. This is a lot faster for Vector in the editor and while running tests. The reason why this difference used to exist is because force-inlined methods used to give a bad debugging experience. After extensive testing with modern compilers this is no longer the case.
* Add static type checks in the parserGeorge Marques2018-07-201-11/+12
| | | | | | | | | | | | - Resolve types for all identifiers. - Error when identifier is not found. - Match return type and error when not returning a value when it should. - Check unreachable code (code after sure return). - Match argument count and types for function calls. - Determine if return type of function call matches the assignment. - Do static type check with match statement when possible. - Use type hints to determine export type. - Check compatibility between type hint and explicit export type.
* Merge pull request #18966 from chanon/new-debug-printMax Hilbrunner2018-07-041-0/+26
|\ | | | | Add new debug print method that shows line number where the print came from
| * add new print_debug method which shows source and line numberchanon2018-05-281-0/+26
| |
* | add new get_stack function to get GDScript stack trace as arraychanon2018-05-171-0/+22
|/
* Merge pull request #16106 from poke1024/gdscript-lerpJuan Linietsky2018-05-071-4/+18
|\ | | | | GDScript: generalize lerp
| * GDScript: generalize lerpBernhard Liebl2018-01-271-4/+18
| |
* | Add is_instance_valid() method to GDScript, ending more than a decade of pain.Juan Linietsky2018-05-071-1/+17
| |
* | Merge pull request #16173 from vnen/gdscript-argumentsRémi Verschelde2018-02-191-0/+10
|\ \ | | | | | | Add argument count check for some GDScript functions
| * | Add argument count check for some GDScript functionsGeorge Marques2018-01-301-0/+10
| |/ | | | | | | | | - Print functions have no check. - Also remove extra apostrophe from the error report.
* / Show default values in docs for GDScript built-in functionsGeorge Marques2018-01-301-0/+2
|/
* Fixes for parameter names of builtin functions in visual scripts/coreChaosus2018-01-161-3/+3
|
* Add missing copyright headers and fix formattingRémi Verschelde2018-01-051-0/+1
| | | | | | Using `misc/scripts/fix_headers.py` on all Godot files. Some missing header guards were added, and the header inclusion order was fixed in the Bullet module.
* Update copyright statements to 2018Rémi Verschelde2018-01-011-2/+2
| | | | Happy new year to the wonderful Godot community!
* Add cartesian to polar conversion functionspablotato2017-11-201-0/+30
|
* Add print_error function, akin to print_lineGeorge Marques2017-11-161-1/+1
|
* GDScript: Refactor "GD" class prefix to "GDScript"Rémi Verschelde2017-11-161-0/+1767