Raised This Month: $32 Target: $400
 8% 

[Question] What is edict ?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Abhinash
Senior Member
Join Date: Jan 2015
Location: India,kolkata
Old 01-26-2021 , 09:46   [Question] What is edict ?
Reply With Quote #1

As the title suggests I want to know what is Edict and whats the uses of ENTINDEX() and INDEXENT().
Thanks
Abhinash is offline
Old 01-26-2021, 13:08
HamletEagle
This message has been deleted by HamletEagle.
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 01-26-2021 , 17:18   Re: [Question] What is edict ?
Reply With Quote #2

Quote:
Originally Posted by Abhinash View Post
As the title suggests I want to know what is Edict and whats the uses of ENTINDEX() and INDEXENT().
Thanks
int ENTINDEX( edict_t* pEdict )

Every entity needs it's own edict or the ent won't appear in-game. So then how is it indexed? By integers.

BOOKMARKERS
https://developer.valvesoftware.com/wiki/Entity_index
https://developer.valvesoftware.com/wiki/Edict_t
__________________
DJEarthQuake is offline
Abhinash
Senior Member
Join Date: Jan 2015
Location: India,kolkata
Old 01-26-2021 , 22:01   Re: [Question] What is edict ?
Reply With Quote #3

Quote:
Originally Posted by DJEarthQuake View Post
int ENTINDEX( edict_t* pEdict )

Every entity needs it's own edict or the ent won't appear in-game. So then how is it indexed? By integers.

BOOKMARKERS
https://developer.valvesoftware.com/wiki/Entity_index
https://developer.valvesoftware.com/wiki/Edict_t
I mean what place ENTINDEX() should be used and at what place INDEXINT() should be used ?

Last edited by Abhinash; 01-26-2021 at 22:04.
Abhinash is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 01-26-2021 , 22:20   Re: [Question] What is edict ?
Reply With Quote #4

Based on the names, I would assume ENTINDEX() = entity index and INDEXINT() = slot index?
__________________
Bugsy is offline
Abhinash
Senior Member
Join Date: Jan 2015
Location: India,kolkata
Old 01-26-2021 , 22:26   Re: [Question] What is edict ?
Reply With Quote #5

ENTINDEX () = Returns the server slot (ie 1 to maxplayers) of the given player edict.
INDEXENT() = Returns the edict for the player in the given server slot (ie 1 to maxplayers).

So, now my question is that, at which place and purpose one should be used ?

Last edited by Abhinash; 01-26-2021 at 22:34.
Abhinash is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 01-26-2021 , 22:35   Re: [Question] What is edict ?
Reply With Quote #6

Ok, so your question is answered?
__________________
Bugsy is offline
Abhinash
Senior Member
Join Date: Jan 2015
Location: India,kolkata
Old 01-26-2021 , 23:16   Re: [Question] What is edict ?
Reply With Quote #7

Quote:
Originally Posted by Bugsy View Post
Ok, so your question is answered?
Nope. I am able to understand the use of INDEXENT() but not ENTINDEX().

On learning from few modules like Fun, I was able to understand the use of INDEXENT() which was called in fun using HlTypeConversion.h. There id_to_edict() i.e. INDEXENT() was used for accessing an entity's data and change it. So, I understood the first one. But I am still not able to understand the second one which is ENTINDEX()

Can anyone help me understand the second one ?
Abhinash is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 01-27-2021 , 00:09   Re: [Question] What is edict ?
Reply With Quote #8

You already answered your own question with the definitions you provided. You use them where you need those actions to occur.

Next time, post module coding questions in the module coding forum.
__________________

Last edited by fysiks; 01-27-2021 at 00:10.
fysiks is offline
Abhinash
Senior Member
Join Date: Jan 2015
Location: India,kolkata
Old 01-27-2021 , 06:16   Re: [Question] What is edict ?
Reply With Quote #9

Quote:
Originally Posted by fysiks View Post
You already answered your own question with the definitions you provided. You use them where you need those actions to occur.

Next time, post module coding questions in the module coding forum.
For the second one just from the sentence I cant understand its use thats why I asked a code example with explanation or a picture.

And I already posted in module section, since nobody answered my question there, I asked there.
Abhinash is offline
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 01-27-2021 , 10:55   Re: [Question] What is edict ?
Reply With Quote #10

Remember my links?

https://developer.valvesoftware.com/wiki/Entity_index.

Code:
int ENTINDEX( edict_t* pEdict )

Converts between an entity index and its attached edict.
Quote:
Originally Posted by Abhinash View Post
Nope. I am able to understand the use of INDEXENT() but not ENTINDEX().

But I am still not able to understand the second one which is ENTINDEX()

Can anyone help me understand the second one ?
Utilize them and that Wiki.
__________________
DJEarthQuake 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 19:06.


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