Raised This Month: $ Target: $400
 0% 

What is Edict Index?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Xenogenetics
Member
Join Date: Jul 2007
Old 09-24-2007 , 07:50   What is Edict Index?
Reply With Quote #1

What is the edict index for entities? I do a lot of level design and I have never run across anything called edict index while dealing with entities.

PS I am really new to SourcePawn, will something like this work?
Code:
new bool:isPlayerDumb[64]
Xenogenetics is offline
BAILOPAN
Join Date: Jan 2004
Old 09-24-2007 , 09:38   Re: What is Edict Index?
Reply With Quote #2

An edict is block of data that the Engine and Mod share about every entity; it contains physics/network information. The edict table is a hard-coded array of size 2,048 (as of right now).

Clients are special entities and the server will always assign them an edict from 1 to N where N is the maximum number of clients. I.e. a 64 player server will have edicts 1 to 64 reserved for clients.

Thus you can have a forward like this:
Code:
public OnClientConnect(client) {    isPlayerDumb[client] = false;

But the array needs to be size 65.
__________________
egg
BAILOPAN is offline
Xenogenetics
Member
Join Date: Jul 2007
Old 09-24-2007 , 10:03   Re: What is Edict Index?
Reply With Quote #3

So these aren't like keyvalues?
How do I set keyvalues to be used with an entity created with
Code:
CreateEntityByName(const String:classname[], ForceEdictIndex=-1)
?

I also saw setting offsets with edicts but I'm not even gonna ask what that is :S

Everyone seems to already know what this stuff is, where can I learn what everything in the include files means?

One last question (I hope), when you say every entity do you mean every type of entity in the mod or every entity in the map, and is it generic information e.g. what every light entity should have or specific information e.g. what this light entity has.
Xenogenetics is offline
BAILOPAN
Join Date: Jan 2004
Old 09-24-2007 , 10:31   Re: What is Edict Index?
Reply With Quote #4

To set a key value on an entity you must use CBaseEntity::KeyValue(). That function isn't abstracted yet in sdktools so you may wish to file a feature request for it.

You can read about entity properties here: http://wiki.alliedmods.net/Entity_Properties

I am not too good with mapping so I don't know how well I can answer your question. Here is a function that will dump a list of entities by classname and network name:
Code:
Dump_Entities() {     new String:classname[64], String:net_class[64];     for (new i = 0; i <= 2048; i++)     {         if (IsValidEdict(i) && GetEdictClassname(i, classname, sizeof(classname)))         {             PrintToServer("[%04d] Class: %s", i, classname);                         if (IsValidEntity(i) && GetEntityNetClass(i, net_class, sizeof(net_class)))             {                 PrintToServer("[%04d] Net Class: %s", i, net_class);             }         }     } }
__________________
egg
BAILOPAN is offline
Xenogenetics
Member
Join Date: Jul 2007
Old 09-24-2007 , 11:21   Re: What is Edict Index?
Reply With Quote #5

So basically, I don't need to know anything about edicts if all I want to do is spawn an entity?
Xenogenetics is offline
BAILOPAN
Join Date: Jan 2004
Old 09-24-2007 , 13:13   Re: What is Edict Index?
Reply With Quote #6

If you're working with entities at all it's important to understand the relationship between an edict, its index, and an entity. You don't need to know any of the extra details.
__________________
egg
BAILOPAN is offline
Stinkyfax
BANNED
Join Date: Aug 2007
Old 01-21-2008 , 07:59   Re: What is Edict Index?
Reply With Quote #7

Bailopan is the link you provided for sourcemod? there are void, and "*" I didn't meet this in sourcemod scripting before and have no idea what they mean.
Stinkyfax is offline
BAILOPAN
Join Date: Jan 2004
Old 01-21-2008 , 12:49   Re: What is Edict Index?
Reply With Quote #8

The code provided is intended for C++ developers, since SourceMod has builtin functions for dealing with properties.
__________________
egg
BAILOPAN is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 21:51.


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