AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Coding MM:S Plugins & SM Extensions (https://forums.alliedmods.net/forumdisplay.php?f=75)
-   -   Difference between edict and entity? (https://forums.alliedmods.net/showthread.php?t=141204)

Chrisber 10-20-2010 18:17

Difference between edict and entity?
 
Hey.
Can someone of you explain the exact difference between edict and entity?
I tried to understand it and so I've looked into the SM API.
There are this functions:

CreateEntityByName
RemoveEdict

Edit: And why there is a CreateEdict function? I'm really confused :/

You see that there is no RemoveEntity. Why don't you call it RemoveEntity?

Thanks

BAILOPAN 10-23-2010 22:06

Re: Difference between edict and entity?
 
Edicts are bits of state sitting as a bridge between the game and the engine. For example they assist in networking.

The reason SourceMod has "RemoveEdict()" is because before 1.3 or so, we only supported edict-backed entities, which have canonical indices maintained in the engine. The game also maintains its own list, and these entities (for example, logical entities) are not maintained in the engine's edict list. So they're much harder to get at, the engine doesn't care and there's no API for them.

SourceMod supports these now (via a backwards-compatible index encoding - pRED knows the details), so RemoveEdict() may just be an archaic name.

Chrisber 10-23-2010 22:50

Re: Difference between edict and entity?
 
Hey.
Thanks for explanation.
Does it mean, that I can access nearly all entities (except the logic ones, starting with logic_) with an edict?

Thanks

BAILOPAN 10-23-2010 23:54

Re: Difference between edict and entity?
 
Yes. And a correction: the game's list has all entities. It's just that some of them are edictless. Arguably, those indices should be canonical, but it's such a pain to get at them ;)

pRED* 10-24-2010 03:22

Re: Difference between edict and entity?
 
RemoveEdict wraps the engine function of the same name, and will fail if used to an entity without an edict.


All times are GMT -4. The time now is 07:08.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.