Commit Graph

19 Commits

Author SHA1 Message Date
D8H 4c7231e6ae Fix a crash at runtime when behaviors are missing in functions (#7830) 2025-09-15 16:40:21 +02:00
D8H d6c99b27af Allow to use parameters and properties in the variable action and condition (#7124) 2025-01-15 23:28:18 +01:00
Florian Rival a4f7aa6c43 Fix default behaviors not added properly to objects in functions (#7206) 2024-11-29 14:13:09 +01:00
Florian Rival eae75bdc72 Fix potential crashes in events function edition (#7204)
* Also hide object groups tabs in functions (unless there are groups already) - it's not recommended to use them anymore
2024-11-28 14:00:01 +01:00
D8H 011abaf808 Allow drag and drop in the extension function parameter editor (#6847) 2024-08-20 10:29:52 +02:00
Florian Rival d1385e5fc2 Fix completions in expressions not being case insensitive and limited for objects/variables/properties/parameters (#5742) 2023-10-10 10:48:33 +02:00
Florian Rival 8944df1831 Add support for writing parameter names directly in expressions (#5676) 2023-09-22 22:41:13 +02:00
Florian Rival a0925c79c3 Add a new simplified way to use variables in expressions, and automate renaming of variables in events (#5580)
* You can now simply write the name of the scene or global variable in an expression to use it: `1 + MyVariable` (instead of `1 + Variable(MyVariable)`).
* Objects can also have their variables accessed like this: `MyObject.MyVariable` (instead of `MyObject.Variable(MyVariable)`.
* This also works for properties inside functions of behaviors or custom objects. For example, you can write `Speed` instead of `Object.Behavior::PropertySpeed()`.
* This syntax will also handle all types of variables without the need to write ToString. For example, you can now write "Score: " + CoinsEarned instead of "Score: " + ToString(Variable(CoinsEarned)).
* This syntax will only work (and autocompletions will be shown) if you add the variable in the variables editor of the scene, the project or in the variables of the object. It's a good practice to always declare your variables here and give them a default value - do it to benefit from this new simplified syntax, which will make your formulas and expressions much more readable.
* When you rename a variable in an editor, it will now rename the variables everywhere in the events of the project. This makes it much easier to change the name of a variable if you find a better one. Note that this works for "rootæ variables, but not variables inside structures or arrays.
2023-09-21 18:56:12 +02:00
D8H 859b1d0a1c Refactor events when project elements are renamed (#5031)
* Project elements are: scenes, external layouts, external events, layers, layer effects, object effects, sprite animations and sprite points.
2023-03-20 12:02:36 +01:00
D8H 71f20d7852 Refactor to make some ParameterMetadata attributes private (type, supplementaryInformation and optional) (#4437) 2022-10-29 13:02:18 +02:00
D8H 763aa0aa25 Show expression errors directly in the event sheet (#3823) 2022-06-03 23:02:51 +02:00
D8H d40e360b8a Add support for behaviors based on other behaviors ("behavior composition") (#2781)
* This allows [custom behaviors](http://wiki.compilgames.net/doku.php/gdevelop5/behaviors/events-based-behaviors), that you can create in your project or get from extensions, to require the presence of one or multiple other behaviors on an object.
  * This is an advanced feature that is helpful to create behaviors that are based on other. For example, a behavior "Platformer enemy" using the "Platformer object" behavior and adding specific actions, conditions and logic to make an enemy chase the player.
  * If you create a behavior and want to use this, just go to the properties of this behavior and add a new property. Choose the type "Required Behavior" for this property. You can then use this new behavior in the events of the behavior you just edited.
* To use a behavior based on another, you don't need to do anything special! Just add it to your object as usual: any missing behavior will be added to your object, so you can start using it immediately.
2021-09-06 19:51:42 +01:00
Florian Rival eb2da55504 Prevent a behavior to be selected in a function parameter if it's incompatible with the object 2020-06-13 23:51:33 +01:00
Florian Rival e75db3a626 Allow to display long descriptions of some parameters as helper text 2019-12-22 12:07:59 +01:00
Florian Rival 42cbe3534f Add support for behaviors in EventsFunctionExtractor 2019-04-13 10:09:43 +02:00
Florian Rival eb31be67ed [WIP] Adding EventsFunctionsExtensions support to newIDE 2018-10-08 22:21:36 +01:00
Florian Rival dc27d5f962 Rename gd::ClassWithObjects to gd::ObjectsContainer 2018-09-09 21:28:26 +01:00
Florian Rival 67c051e9d8 Improve events function code generation and refactor OnceTriggers handler 2018-09-09 16:21:35 +01:00
Florian Rival 09095a257a Add ParameterMetadataTools to generate an object container from parameters 2018-09-09 16:21:35 +01:00