forgottenserver
forgottenserver copied to clipboard
Duplicate monster with the same name
Explanation of what you want to do that is currently impossible
If I put two monsters with the same name and files in different locations, it doesn't give any error. For example: monster name="Test" file="monsters/test1.xml" monster name="Test" file="monsters/test2.xml"
Desired functionality
It would be interesting to show an error message in this case.
I think that is because there are cases where monsters can have same name (butterfly, horse etc), that is why we don't throw any error, what matters for the code if I'm not mistaken, is file name. That is the name we use in commands
In the monsters.xml file even the horses and butterfly are differentiated ....
In the monsters.xml file even the horses and butterfly are differentiated ....
that was my fault to make them different on RME, not because of coding, but lets see what others think, I'm always open for new views
@EPuncker They have to be different in monsters.xml
the engine needs to uniquely identify each monster race. The name inside the
The same is true for revscriptsys which can't have collisions with monsters.xml either or other revscriptsys monsters. The difference is with revscriptsys the unique name is defined when creating the monsters local mType = Game.createMonsterType("Butterfly (Red)")
https://github.com/soul4soul/converted-tibiawiki-monster-data/blob/d6f48391acc93b2fe3bf948674d918bbe8b16225/tfs%20revscriptsys/Butterfly_(Red).lua#L1-L4
The names of the monsters placed with the map editor/in the spawn.xml file match the unique monster name. https://github.com/otland/forgottenserver/blob/master/data/world/forgotten-spawn.xml#L826
(Note this example is bad because the unique name of the butterfly don't match but they should)