-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Auto-incremented EntityPickup variants attempt to populate variant 0, which already has function in the base game #436
Comments
For all other types, is using variant 0 okay? e.g. for familiars, tears, etc.? |
Familiars (type 3) are fine, Effects (type 1000) are fine, Slots (type 6) are fine. Auto-incrementation works completely different for NPCs so this does not apply there. I haven't ever done it with any other special entity types (1, 2, 4, 7, 8, 9), since generally speaking there isn't a good reason to make variants of them over just using data tags. Tears especially aren't a great idea since some tear effects are linked to their variants rather than a tear flag (haemolachria). |
I'm also realising now that variant 0 for Players, Tears, Bombs, Knives, & Projectiles is already populated, so this doesn't apply to them at all. It's only an issue for pickups since variant 0 has function without being populated. |
I discovered today that doing this is not safe. In other words, having an entity of <entity name="Placeholder Pickup" id="5" /> or <entity name="Placeholder Pickup" id="5" variant="0" /> in your Steps to reproduce:
If you remove the placeholder pickup from your |
This crashes because your 5.0 entity doesn't have an anm2path for guppy's eye to render |
According to Xalum, effects (in addition to pickups) are not safe for auto-incrementation, which doesn't seem to be documented anywhere. He says that this is presumably because of |
I've recently been exploring using entity ID auto-incrementation to make my mods impossible to ID clash, however I have noticed something. When using variant auto-incrementation, regardless of entity type, the variant will auto-increment from 0. For most entity types this is a non-issue, however, entity 5.0.n has special behaviour used for spawning random pickups.
If you want to auto-increment pickup variants you have to first add a filler entry that absorbs variant 0, so that the rest of your entries can auto-increment safely. This isn't a huge issue, but it's something that may dissuade a newer modder away from using ID auto-incrementation, and is something that every mod that wants to use this feature will have to do. Populating the variant 0 pickup in the base game entities2.xml would alleviate this entirely.
The text was updated successfully, but these errors were encountered: