• Entity Index is not the same per server?
    5 replies, posted
I've been writing something which gets the ent ID of an ent, so I can then control that ent. However, I've been finding that the ID seems to change per server. I thought the entity ID was supposed to be unique, can anyone enlighten me?
It's probably like ModelIndexes and UniqueIDs, they're assigned on spawn, and they change depending on what's already there.
[QUOTE=PortalGod;24721081]It's probably like ModelIndexes and UniqueIDs, they're assigned on spawn, and they change depending on what's already there.[/QUOTE] The problem I have with this theory is that on the server they're always the same irregardless of when they're spawned (unless they're cached somewhere?). Just the numbers differ between servers.
It wouldn't make sense for an entity to be able to have an ID that's the same across all servers, since entities can be more or less the same. There's no way to consistently refer to a specific entity across all servers using EntIndex. You can, however, find this entity if it either has a specific name or occupies a static position.
[QUOTE=Entoros;24721702]It wouldn't make sense for an entity to be able to have an ID that's the same across all servers, since entities can be more or less the same. There's no way to consistently refer to a specific entity across all servers using EntIndex. You can, however, find this entity if it either has a specific name or occupies a static position.[/QUOTE] I know, but I assumed that (at least with map ents) they would remain static and have the same ID's each time. I know it's possible to get the ent Name / Class / Ents in a position, but sometimes I want a single entity that can sometimes be found in an area where many (of the same)entities are present. The main problem is that (bad) mappers often don't name their ents, which is a major irk if I need to do something with it. But oh well, guess I'm going with the detect in an area method :v:
They aren't bad mappers for not naming their ents. Ents should only be named if they need to be referenced.
Sorry, you need to Log In to post a reply to this thread.