Hi to all! I’m Nicola Castellani, a full stack web developer based in Verona, Italy.
I’ve used Unity for almost 8 years in my free time, now I want to develop games using JavaScript, my main dev language, and I’ve found GDevelop!
GDevelop is really cool, I want to collaborate, maybe help with core development too (I’d like to create a dark theme mode, my eyes are crying ).
Currently, I’m trying to replicate everything I’ve done with Unity in GDevelop, starting from camera zoom lerp, which is a cool improvement on game appearance.
Welcome on the forum
Camera zoom looks pretty cool. In GDevelop you can develop your own functions and behaviors and submit on GitHub to be included. It is looks something that would be useful to have in GD.
All contribution is welcome
Ciao
There’s a dark theme in File/Preferences, though not perfect. I think almost everyone is using it
On the Github and the Trello, you’ll find everything you need to contribute to the software, including bugs and feature requests
Cheers
I never used Behavior properties so I am not sure but the expression editor saying you can use the expression Object:Behavior::PropertyPropertyName() to get a property value within the behavior.
It seems the expression works only with variables?
I created a quick test and the expression did not work when I used it directly but if I was use it to assign the property value to a variable first and then use the variable, it worked.
So you can try something like this maybe:
Do = Object:Behavior::PropertyZoomTo() to scene variable ZoomTo
Do = Object:Behavior::PropertyInterpolation() to scene variable Interpolation
lerp(GlobalVariable(zoomCamera), Variable(ZoomTo), Variable(Interpolation))
Hi @4ian, nice to meet you, first of all I want to congratulate you for your great job.
Anyway, I can’t use function parameters inside my custom extension actions.
The goal is to create a function to handle a custom target zoom (for example in specific game areas).
I’ve made a custom function called “KeepZoom” which accepts 2 parameters:
targetZoom
zoomInterpolation
but I can’t access to those properties, with variable inspector and Object.Behavior::PropertytargetZoom() too.
I’ll take a more in depth look tonight, thanks for sharing the extension/project
I suspect though, as it’s working with scene variables, that properties are working well but not necessarily the way you would expect them: remember that contrary to the scene variables, they are specific to each and every instance of the behavior.
They are akin to object variables
Let me know if this was clear for you or not?
I think a tutorial on how to use action and function parameters is a must, what do you think?
Yeah ideally that would be the case. Any help for doing it on the wiki is welcome - I’m mostly spending time on the software so it’s hard to make up time to write tutorials. I do write the help pages though for new features, in this case on this page: http://wiki.compilgames.net/doku.php/gdevelop5/behaviors/events-based-behaviors
There is the section called “Add and use properties in a behavior”. I do agree it’s fairly short - let’s identify what piece is missing and add it
Yes, it is clear to me, but I don’t have any tool to inspect them or just reference them in my functions.
I think having a shortcut to reference these behavior variables could be a great improvement in usability.
There is the section called “Add and use properties in a behavior”. I do agree it’s fairly short - let’s identify what piece is missing and add it
I think is missing a specific example on how to use Behavior global properties and Function related properties, I think this is a must and I can extend the wiki by my self to help others reaching complex behaviors development.
The best way to handle this is to create a real use-case example, like I’m doing for my AdvancedPlatformCamera behavior, to introduce newbies to the custom Function/Behavior development.
I think this is a great way to extend GDevelop with new cool features!
So seems that the distinction is not clear, but you created all your functions as “free functions”, that are not part of the behavior. So you won’t have access to any of the behavior action/condition or expression to set/get the properties
On this screenshot your functions are on the left:
You can verifying that you’re “inside the behavior” because the first two parameters are grayed out and are called Object and Behavior.
This function is attached to the behavior. You can use the “Object” and its Behavior inside it… including the properties
You might want to activate the new action/condition editor in the preferences, because it will ask you for the object first when adding a new action/condition. This will help you to see what’s available.
You’ll find the expressions at the end of the list when editing a formula and opening the list of expressions
Dude I’m sorry but I can’t reach function related variables, I’ve removed each behavior parameter because I want to keep a single dynamic function to handle the zoom, but I can’t take the function parameters: