jakkn / nwn-devbase

Command line tool used to version control NWN module development
37 stars 17 forks source link

YAML Converter details #29

Closed devpitOne closed 5 years ago

devpitOne commented 5 years ago

Hi,

Any details on the YAML Converter you're using to output files, particularly the conversations? Is it RoR? Did you have to configure any type converters? If it's blindingly obvious in the source just let me know and I'll be happy to look it up myself. I've been using the docker version so far.

I'm trying to modify Flamewind's Conversation Editorto take input from the unpacked .yml files but am having trouble dealing with the custom tags.

Thanks and great work!

jakkn commented 5 years ago

Hi, interesting project! nwn-devbase uses the neverwinter.nim toolbox to do conversions. Refer to https://github.com/niv/neverwinter.nim for details on the YAML converter. niv might be able to answer your questions.

I'll close the issue for now, but feel free to reopen should you want to discuss conversion details further.

devpitOne commented 5 years ago

Thanks! I've found the YAML converter in https://github.com/niv/nwn-lib/blob/master/lib/nwn/yaml_support.rb and am digging through it to understand why it is built the way it is. If I get an input stream working with Flamewind I'll let you know.

jakkn commented 5 years ago

Nice, but note that the Ruby library nwn-lib is deprecated by the nim library linked to above. YAML support was added to the nim library around christmas, though I'm not sure if niv has settled on the labels and content. Regardless, file conversions are way faster in the nim library, so you most likely want to use that instead of the Ruby lib. You can probably reach out to niv directly in the nwnx discord https://discord.gg/YyV736

devpitOne commented 5 years ago

I wasn't able to find any yaml usage in the nim library so assumed it's using the older one. The output matches exactly that done by the yaml_support.rb

The main query was around the custom type used which I've since worked around anyway. I'm almost there, just need to make a few more modifications to the serialization. It messes up the formatting causing false flags to git.

jakkn commented 5 years ago

Ah right, the nim tools has a yaml branch that hasn't gone to master yet https://github.com/niv/neverwinter.nim/tree/yaml.

By the way I see the the conversation editor is tagged NWN2 on the vault. I assume it is NWN2 only then?

devpitOne commented 5 years ago

Yes, Flamewind was NWN2 only. It depends on a Toolset plugin to export conversations to an xml file.

Since we've no plugins in Aurora I've added YAML functionality which converts the NWN objects into Flamewind's custom objects. This is actually my first time doing YAML, I think I prefer JSON ._.

jakkn commented 5 years ago

Do I understand correctly that your version should also work for NWN then? If so I'd be very interested in trying!

devpitOne commented 5 years ago

Yes, that's correct. Do you process any of the YAML files into separate editors or do you use them strictly for version control? I know the ncs files can be edited in Visual Studio.

jakkn commented 5 years ago

The main purpose of yaml is version control. Afaik GFF diffs do not merge well so we still have to coordinate changes, but it's possible to edit things that makes sense. I often edit texts directly in the yaml.

devpitOne commented 5 years ago

I've completed an initial release for the Conversation Editor It's available at the Neverwinter Vault However due to the looser construction of NWN1 gffs, editing an existing conversation will cause the nodes to be re-organised. This is bad for the obvious reason that it will cause false flags for any source control programs. I'll look at this problem for the next release.

jakkn commented 5 years ago

Cool, have you considered hosting the code somewhere public like github?

devpitOne commented 5 years ago

Just put the latest version up on github.