Is there a way to copy code from other Gdevelop projects?

Seriously, is there a way to copy conditions and actions from one project to another? I keep hearing there is, but I’ve ever managed to do it myself. I’ve tried it from one web game to another web game, from one app game to anther app game, and even from an web game to an app game and vice-versa. But “paste” is always just greyed out. So can. it. be. done.

I know a lot of people have made topics about this already, but I had to write my own, cause it’s been bugging me to no end, and would VERY handy right about now.

1 Like

Have you tried it with 2 instances of GDevelop open, one for the source project and the other for the target project?

Generally you can copy/paste events from one project to another same as you copy folders
Ctrl-C Ctrl-V

But you cannot do it from web to desktop version or vice versa

HOWEVER you can save project to cloud or to desktop and launch it in whatever way you want to copy /paste events

For example you found browser project
You can totally go file > save as > desktop

And load it on desktop app
And vice versa

Keep in mind it is strongly recommended to not do this as an overwhelming majority of conditions and actions are object specific, and will simply not work in a project without the exact same objects.

If you are wanting to reuse logic in multiple projects the safest method is to extract the events to a function based extension and export it locally.

1 Like

I’d like to try that, but the problem is I’m working on the Gdevelop (desktop) app, on a project that’s stored on my computer.

I can’t open computer projects on the web, and if I try opening a second Gdevelop app, it won’t be logged on, and won’t let me log in.

Then open the source project, copy the events you want and paste them in a text editor (make sure to somehow identify what each event it, because it’s stored as JSON). Then open the target project, copy from the text editor and paste it into your target project event sheet.

Yep, I’ve had the won’t log in problem too. But even so, you can still open a project by using the File-Open menu. You’ll then be able to paste between projects - the one you’re logged into and the one you’re not.


But it sounds like you've already tried this?
2 Likes

Nope, I was wrong.

I just tried your suggestion, and it WORKED! Thank you!

1 Like