JSON chat files?

All development conversation and discussion takes place here

Moderator: Moderator

Post Reply
Message
Author
Zizzo
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?

#1 Post by Zizzo »

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

nsrr
Sher'Tul
Posts: 1126
Joined: Mon Sep 21, 2015 8:45 pm
Location: Middle of Nowhere

Re: JSON chat files?

#2 Post by nsrr »

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

#3 Post by Zizzo »

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.
[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… :? :oops:
"Blessed are the yeeks, for they shall inherit Arda..."

Post Reply