JSON chat files?
Moderator: Moderator
-
- Sher'Tul Godslayer
- Posts: 2480
- Joined: Thu Jan 23, 2003 8:13 pm
- Location: A shallow water area south of Bree
- Contact:
JSON chat files?
Oddball question: I've seen, both in the game module and in several addons, chat definitions written in a JSON format rather than the usual Lua newChat{} method. The JSON data includes 'pos_x' and 'pos_y' fields, so I'm guessing they're generated by some GUI graph-manipulation program. Since the engine supports this format directly, and since I've seen it from several sources, I'm hoping that whatever program is being used to generate these is standardized and easily available? I've managed to cobble together a Perl script that mostly converts the JSON data back to the Lua format, but that has limits; I figure with the original program, I can examine the data directly to better understand it.
"Blessed are the yeeks, for they shall inherit Arda..."
Re: JSON chat files?
Those are generated using the "Remote Designer (experimental)" addon (included in current versions of ToME). In developer mode, you can launch it from the dev menu (with the addon active, of course). The interface will launch in your default web browser and you can choose between the map generator or chat editor. Once you launch the chat editor, you can load (JSON) chats from active addons into the editor.Zizzo wrote: ↑Thu Dec 14, 2023 12:39 am Oddball question: I've seen, both in the game module and in several addons, chat definitions written in a JSON format rather than the usual Lua newChat{} method. The JSON data includes 'pos_x' and 'pos_y' fields, so I'm guessing they're generated by some GUI graph-manipulation program. Since the engine supports this format directly, and since I've seen it from several sources, I'm hoping that whatever program is being used to generate these is standardized and easily available? I've managed to cobble together a Perl script that mostly converts the JSON data back to the Lua format, but that has limits; I figure with the original program, I can examine the data directly to better understand it.
-
- Sher'Tul Godslayer
- Posts: 2480
- Joined: Thu Jan 23, 2003 8:13 pm
- Location: A shallow water area south of Bree
- Contact:
Re: JSON chat files?
[sound F/X: testing] So it is. Awesome, thanks! [sound F/X: source diving] Ah, I see the problem: the addon has to be expanded in directory form for the chat editor to see and load its chats. [loads escort-category chat from Hammer of Urh'Rok] …gyeep! Wow, maybe I should just stick with my translator script…nsrr wrote: ↑Sat May 18, 2024 4:32 pm Those are generated using the "Remote Designer (experimental)" addon (included in current versions of ToME). In developer mode, you can launch it from the dev menu (with the addon active, of course). The interface will launch in your default web browser and you can choose between the map generator or chat editor. Once you launch the chat editor, you can load (JSON) chats from active addons into the editor.
"Blessed are the yeeks, for they shall inherit Arda..."