[crossfire] Archetypes collection changes proposal
Nicolas Weeger
nicolas.weeger at laposte.net
Fri Nov 13 11:15:56 CST 2020
Hello.
I finally managed to make good progress, so joining a patch to this message for
comments & review & whatever else :)
This is a work in progress, and may crash at any point :)
The following files are now grabbed from individual files instead of "collected"
files:
- treasures (from .trs files)
- face and animations (from .face files)
- archetypes (from .arc files)
It should be safe to point to the install directory containing the collected
files, if the "arch" directory is linked from there.
Still needs to be done:
- artifacts
- messages
- alchemy formulae
- faceset informations
- face data
- change the location of "smooth face" definition - it's in the .arc but
applied to the face with that name... (this will require changes to Gridarta
if used)
Maybe specific extensions may be introduced for eg artifacts, messages,
formulae, to not use the exact filename.
Collect is done from the base directory, each file is processed, then for each
sub-directory the process is repeated. Names are sorted case-sensitive in both
cases.
With those changes, it is now possible to redefine archetypes, treasures, faces
or animations. It's allowed to have multiple definitions, the latest found will
be used.
Archetypes in particular should correctly update items in inventories of other
archetypes when redefined (thus you could redefine the "event_apply" if you
want, it should be ok and update eg the altar of Valkyrie).
Warning: for multiple tiles monsters, this may crash, especially if you change
the size of monsters...
For artifacts, since it's hard to identify exactly an artifact (no exact
name), I think I'll add a mechanism to "remove" choices & such for types -
thus one could clean part of artifacts before adding one's specific ones.
Same mechanism for formulae probably.
Various comments on the code:
- I did introduce C++ (C++11 I think) for the collect code, and moved arch.c
to arch.cpp
- CRE is broken
- unit tests are broken / invalid / need to be updated
- much cleaning will probably be done, to separate cleanly "collecting" and
"use" parts (thus a collecting class, maintaining eg the list of treasures, in
its file, and functions related to actual treasure generation and thus). I do
intend to use C++ features for this, but not change everything for the sake of
it
Best regards
Nicolas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: nc.patch
Type: text/x-patch
Size: 96129 bytes
Desc: not available
URL: <http://mailman.metalforge.org/pipermail/crossfire/attachments/20201113/86c65705/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: This is a digitally signed message part.
URL: <http://mailman.metalforge.org/pipermail/crossfire/attachments/20201113/86c65705/attachment.sig>
More information about the crossfire
mailing list