Problem regarding custom objects in extension : "condition on behavior missing from extension"

Hi.
Trying to create an extension which will make available custom objects, and I get this error in red…

(I tried to look into adding a new parameter with a type BEHAVIOR, but I don’t know what the other options should be…specially OBJECT TYPE)
any idea how to solve that ? Thanks

What do you want to click? The custom object, a child object inside it or is the click behavior part of another behavior?

I’m just trying to figure out where the button is.

Your extension is using a condition from a button object but the button extension is not installed in your project.
https://wiki.gdevelop.io/gdevelop5/extensions/panel-sprite-button/

Your extension is using a condition from a button object but the button extension is not installed in your project.
Panel sprite button - GDevelop documentation

Yes, exactly, I create a custom object with several “Button(panel sprite)”. These standard buttons have their own functions (or behaviors ? : isClicked, IsHovered, etc) which don’t need to be added as extension in the normal editor since they are directly available when adding a new object.

So you @davy mean that when making an extension with buttons, I need to specifically add this “Button (panel sprite)” as an extension into my personal extension. Ok, that’s not obvious but I agree to do it… Then could you please help me on how I should do since I have no idea.
I have seen this page (Custom behaviors - create your own behaviors with events - GDevelop documentation ) explaining how to do with behaviors, but I don’t know how to apply it to my custom object… Thanks.

And to answer @Keith_1357 and better understand the goal of my extension :
it is a collection of buttons, which when are clicked open an other collection of buttons sometimes with parameter boxes, in order to make menus to open multiplayer using THNK in a simple way (just have to install the extension in the project, and make the custom object appear somewhere in a scene, and the whole P2P THNK multiplayer parameters are properly executed in the game). So for instance if in the first menu the player clicks on “Start multiplayer with P2P”, it will then show the following buttons, each activating the corresponding THNK functions :

If you add the buttons as child objects for a custom object then it should automatically add the behavior/extensions.

I added a button to a custom object and then this to the step event. I rotated the object to test it.

No, I meant you need to have the extensions that you’re using installed in your project.

@Keith_1357 I don’t know how you checked if it works or not, but I tested earlier that kind of thing earlier and :
in the same project (where I define the extension) ; IT Works nice,
but in an other project, where I install the export of the extension : I got the error I showed at the top of the page…

(By the way, it would be nice to have a simple way to test if the extension is working or not, without having to export it and import it into a new test project. But may be that’s not possible)

O may be it works in your case with the specific button extension you use, which is different from the standard simple button. (But stil I might be happy to use that). However it is interesting to know why the standard button doesn’t come easily into an extension.

OK, actually you are right, it was not installed…

I installed Button (panelSprite) into the project (which calls the extension).
extension added

and It crashed the preview :

did I do something wrong ?

Davy will be able to answer more accurately . In my case I think the issue is for me, when I add a button, it adds the button extension to the scene. If I was to try my custom object in another project it probably wouldn’t work. The button extension probably needs to be inside the custom object or setup somehow as a required behavior. IDK if that’s applicable to children objects.

Maybe if that is also happening to you then you need to add the button extension to the custom object not to the scene.

may be, and that’s precisely what I don’t know how to do at the moment… yet :sweat_smile:

I will keep on trying anyway, and let you know.

When you save the project and the extension of a custom object is missing, GDevelop doesn’t know what to save so the object configuration becomes blank and GDevelop doesn’t expect this because custom objects have initial configuration values even when they are created.
It’s kind of a bug as GDevelop should save and load unknown properties rather than dismissing them.

In your case, you should probably remove the the buttons objects and add them again.

Thanks @davy , I applied your advises, and it is much better but still with a sprite problem :

This is what I did, for memory, and order is probably very important !!!

  • I removed the old buttons from the custom extension
  • I specificaly added the extension ButtonSpritePanel into the custom extension (even if it seemed not necessary to use the buttons)
  • within the final project, I added the extension ButtonSpritePanel
  • and at last within the final project, I added my custom extension

And thanks to that :
I don’t get the error message any more, and the buttons are clickable and make actions :grinning: :grin: , but I still don’t get the sprites correctly… :
screenshot from editor inside the final project (which calls the extension) :

So we can see that the Text element at the top of the screen has been included in the extension and appears as planned, but the button sprites don’t, AND AN OTHER SPRITE which I created in the extension DOESN’T APPEAR EITHER… (it should be two simple red lines crossing).
This is probably a bigger problem I have with all the sprites included within the custom object in the extension…
Any idea what I do wrongly when inserting them in the custom object and extension ?

and for the record, this is what I get when running the preview :


(the buttons don’t have their sprites, but are clickable and work fine :grinning:)

Hi @davy, I was wondering how you did to insert the the button sprites within the extension panelspritebutton ? was it possible or did you find special sideways to do it (url, build them) ?
While looking at the extension (which is great by the way :slightly_smiling_face: ) I noticed 3 objects (idle, hovered, clicked) but I didn’t manage to see where they came from.
Thanks

With the object editor, but you can get ready to use buttons from the asset-store.

Ok, so I understand the extension doesn’t contain any sprite, it only get them from the asset store. Am I right ?

It seems from other posts in the forum that extensions can’t include sprites, and that’s a pity I believe, I was basically trying to check if I got it wrong and there was actually a way to do it.

So to summarize, if I want to attach a sprite in an extension, I need to have that sprite within the asset-store, and use its address in the extension.
Tell me if I’m wrong.

Note : if that’s the case, that could usefully be told in the extension / custom object user-manual

For the moment I’ll mark the topic as solved, if you have more answers, don’t hesitate. Later I may address very specific points in other topics.
Thanks @Keith_1357 and @davy .

(Strange, this time again I can’t modify the title of the topic to mark it as solved…)

1 Like

You can use any image for the panel sprite button. For example these beautiful buttons.

You also don’t need the extension anymore I don’t think, since they had built the panel sprite button object into the editor as one of the objects you can choose to create in your scene. You pick +Add an object/Panel Sprite Button and then down on the bottom right you click “skip and create from scratch” if you want to use your own assets. However you will need to set your margins correctly if you want it to look good. And do not size it in your game smaller than the default size.

But if you’re creating your own custom object it would probably be easier to do it from scratch.

Thanks, I may use that later, at the moment I finally chose to just click on the text… that is a bit basic, but more simple, which is ok since right now I try to have the functions, and later the look… Thanks for these nice buttons.

1 Like