Raised This Month: $12 Target: $400
 3% 

[Question] Entity Index


Post New Thread Reply   
 
Thread Tools Display Modes
Halt
Senior Member
Join Date: Jan 2015
Location: Black Mesa
Old 08-23-2019 , 13:22   Re: [Question] Entity Index
Reply With Quote #11

Quote:
Originally Posted by TheDS1337 View Post
smokegrenade_projectile, hegrenade_projectile, flashbang_projectile, decoy_projectile, molotov_projectile, incgrenade_projectile, tagrenade_projectile and breachcharge for the breach charge added in Danger Zone.
Sick, I'll post this for anyone who cares when I finish.
Halt is offline
Halt
Senior Member
Join Date: Jan 2015
Location: Black Mesa
Old 08-23-2019 , 13:35   Re: [Question] Entity Index
Reply With Quote #12

Alright I'm attempting to target this entity now. I just need to assign it a name or grab its index so I can find its location on the map when it lands. Now that's usually not an issue but there no further documentation on the Valve dev site.

Do I treat it the same as I would with prop_dynamic can I use AcceptEntityInput? Also shouldn't I be checking with StrEquals? Even though there is no other entities that contain the same string. Safe practice right?

PHP Code:
public void OnEntityCreated(int iEntity, const char[] classname)
{
  if (
StrContains(classname"smokegrenade_projectile"false) > -1)
  {
    
SdkHook(iEntitySDKHook_SpawnPostOnSpawnPost);
    
AcceptEntityInput(iEntity"targetname""ArtilleryStrikeMark");
  }

P.S. If you didn't know this is for an Artillery Strike. If anyones interested I'll publish it.


Edit - Then in order to grab its location accurately, I need to know when it stops moving. How would one go about that? Since it will be different with each throw.

Last edited by Halt; 08-23-2019 at 13:37. Reason: Added
Halt is offline
Ilusion9
Veteran Member
Join Date: Jun 2018
Location: Romania
Old 08-23-2019 , 14:08   Re: [Question] Entity Index
Reply With Quote #13

PHP Code:

public void OnEntityCreated(int entity, const char[] classname)
{
    if (
StrEqual(classname"smokegrenade_projectile"false))
    {
        
SdkHook(entitySDKHook_SpawnOnSpawnPost);
    }
}

public 
Action OnSpawnPost(int entity)
{
    
DispatchKeyValue(entity"targetname""ArtilleryStrikeMark");

Can you say what are you trying to do exactly with this entity?
__________________
Ilusion9 is offline
Halt
Senior Member
Join Date: Jan 2015
Location: Black Mesa
Old 08-23-2019 , 14:49   Re: [Question] Entity Index
Reply With Quote #14

*facepalm x2* Duh its not an input. My question was more or less if this entity had a "targetname" keyvalue.


Edit - As for what I'm trying to do is just target this entity and find out where it lands. It would help if I stopped derping and looking dumb with easy mistakes on the forums. That's what I get for trying to write while I'm in class. :/

Last edited by Halt; 08-23-2019 at 14:50.
Halt is offline
Ilusion9
Veteran Member
Join Date: Jun 2018
Location: Romania
Old 08-23-2019 , 15:17   Re: [Question] Entity Index
Reply With Quote #15

Quote:
Originally Posted by Halt View Post
*facepalm x2* Duh its not an input. My question was more or less if this entity had a "targetname" keyvalue.


Edit - As for what I'm trying to do is just target this entity and find out where it lands. It would help if I stopped derping and looking dumb with easy mistakes on the forums. That's what I get for trying to write while I'm in class. :/
then look at this topic: https://forums.alliedmods.net/showthread.php?t=186142
__________________
Ilusion9 is offline
Halt
Senior Member
Join Date: Jan 2015
Location: Black Mesa
Old 08-26-2019 , 09:38   Re: [Question] Entity Index
Reply With Quote #16

Quote:
Originally Posted by Ilusion9 View Post
Very nice, exactly what I'm looking for. I was just checking its velocity after creation but this seems that it may be more accurate.
Halt is offline
Reply


Thread Tools
Display Modes

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 18:11.


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