Improve sharing of events / bbcode on forum

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.

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.

1 Like

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”.

1 Like

What is sure is that the issue of character conversion can be solved by using triple backticks (```) rather than a quote (>) in Markdown.

```
your JSON    
```

Making a result like this:

{“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}}
2 Likes