Improve sharing of events / bbcode on forum


#1

I see a lot of people sharing “code” snippets here on the forum, which is inefficient and hard to reuse.
I think it would really improve the quality of life for newbies and veterans here if the IDE allowed you to copy logic blocks “As Markdown” which could be pasted as-is on the forums and elsewhere. (BBCode I think would be fine too)
Stretch goal of course would be to allow “Paste from Markdown” to allow importing.

The alternative approach would be to add a widget to the forum that understands how to render the JSON blobs that GDevelop currently uses… I’m guessing this would be harder and more tedious than adding human readable export/import natively.


#2

It would be great to be able to share functional snippets more easily, indeed.
I’m not fond of the forum widget approach because I would like to share snippets outside the forum (Discord, Whatsapp, etc.)
Note though that events can already be copy-pasted, it’s just ugly and you have to be careful about character conversion (e.g. quotes).

{“000kind”:“GDEVELOP_EventsAndInstructions_CLIPBOARD_KIND-jsBdHbLy912y8Rc”,“content”:{“eventsList”:[{“disabled”:false,“folded”:false,“type”:“BuiltinCommonInstructions::Standard”,“conditions”:[{“type”:{“inverted”:false,“value”:“DepartScene”},“parameters”:[""],“subInstructions”:[]}],“actions”:[{“type”:{“inverted”:false,“value”:“ModVarScene”},“parameters”:[“desiredlevelzoom”,"=",“0.5”],“subInstructions”:[]}],“events”:[]}],“eventsCount”:1,“actionsList”:[],“actionsCount”:0,“conditionsList”:[],“conditionsCount”:0}}

If such blocks could be hidden on the forum and converted to a ‘Copy events to clipboard’ button, it could be a nice start.


#3

With a little bit of modification the admin on the forum can edit this files for discourse.
This add a copy button.
Files can be easily edited for create a button “Copy the event” or “Copy action” or “Copy condition”.