Page 1 of 1

[answered] changing / renaming ID support

Posted: 24 May 2015, 12:41
by asmo
What speaks against the possibility of renaming IDs in the CS?

What it would be useful for:
[*] A mod contains entities which have IDs that start with a number e.g. 123_hello_script. OpenMW throws an error and refuses to start when a script has an ID like that. This is a correct behaviour. Anyhow, to fix the mod it would be really helpful if you could just do
..... search ID "123_abc_xxx" and replace by "abc_xxx"
At the moment a clone has to be created for each entity. As well TopicInfo needs to be changed since it contains references to other entities. Unfortunately there is a bug which results in discarded TopicInfo entries.

[*] Fixing ID name inconsitencies.
[*] Changing ID names to comply with the "rules" of the community if a modder allowed using his work in your own mod.
E.g. from originalModder_bigMod_script to derivingModder_greatMod_script ...

Re: changing / renaming ID support

Posted: 24 May 2015, 13:55
by asmo
Zini in the bug tracker:
"You can not rename IDs. The data structures/file formats do not allow that. If we were to implement a rename feature, it would perform a clone and delete anyway, which is certainly not what would be expected from a rename function. I prefer the cumbersome variant here for the sake of clarity."
How about having an option to allow ID renaming. Something like "expert settings" (and a warning like "Don't mess with it if you don't know what you're doing." :twisted: ) - it could contain a checkbox next to "Allow renaming of IDs". A mouseover could give another warning - "This will create a clone and discards the original".
Another way would be just having a checkbox next to "rename IDs" reading "activate" in the search subview. It has to be activated to make ID renaming work and would not remember its (active) status after a renaming was done.

I tried to achieve renaming IDs by using sed 's,01_Pal,Pal/g' but it did - unsurprisingly - not lead to a usable mod file.

[Edit: I hope it's more understandable now. ^^]

Re: changing / renaming ID support

Posted: 24 May 2015, 14:19
by sjek
The data structures/file formats do not allow that. If we were to implement a rename feature, it would perform a clone and delete anyway
can deleting done cleanly ?

Re: changing / renaming ID support

Posted: 24 May 2015, 14:27
by asmo
sjek wrote:can deleting done cleanly ?
Is that not clear at the moment? :shock: