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

[FRAMEWORK] CEntity


Post New Thread Reply   
 
Thread Tools Display Modes
Nail
BANNED
Join Date: May 2008
Location: PetrovЪ GradЪ
Old 09-18-2010 , 09:49   Re: [FRAMEWORK] CEntity
Reply With Quote #21

Is it possible with the help CEntity create entity "npc_zombie" in css?
Nail is offline
pheadxdll
AlliedModders Donor
Join Date: Jun 2008
Old 09-18-2010 , 22:12   Re: [FRAMEWORK] CEntity
Reply With Quote #22

The current version does not have the capability, its on the todo list but not much has added changed since the initial release.
__________________
pheadxdll is offline
petomatick
Member
Join Date: Sep 2010
Old 09-20-2010 , 11:52   Re: [FRAMEWORK] CEntity
Reply With Quote #23

How do you install this and sidewinder?
petomatick is offline
naris
AlliedModders Donor
Join Date: Dec 2006
Old 09-24-2010 , 16:52   Re: [FRAMEWORK] CEntity
Reply With Quote #24

Quote:
Originally Posted by petomatick View Post
How do you install this and sidewinder?
You don't "install" this. It's the source for a C++ class that you include into a project, such as sidewinder, when you write it.
naris is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 01-23-2011 , 14:26   Re: [FRAMEWORK] CEntity
Reply With Quote #25

So, I got my commit access to the CEntity repo, and I've synced in the latest version from TFDodgeball.
This includes pRED's changes to it for a large project that was never released (and were never pushed to the repo) along with my own improvements made over the course of working on TFDodgeball.

In no particular order:
  • Added many new hooks and props for CEntity and CPlayer.
  • Support for custom classnames.
  • Linking is now done via DLL classes and RTTI lookups.
  • Preliminary custom DATADESC support, including inputs and outputs (don't use, it crashes).
  • More seamless usage of EHANDLE props.
  • Cleaned up stuff.
  • Added support for detours, needs CDetours folder in the parent directory.
  • Added a helpers class that makes common functions easy (from CrimsonGT).
  • CScriptCreatedItem and CScriptCreatedAttribute (from TF2Items).
  • A new 'tracker', designed to get a generic pointer from a sig in a gamedata file.
  • A lot of CPlayer defines, including PLAYERCONDs, WEAPONSLOTs and LOADOUTSLOTs.
  • Added CAnimating with StudioFrameAdvance and Dissolve.
  • Changed CPlayer to inherit from CAnimating.

I'll be keeping this up to date with the changes I make in TFDodgball from now on, feature requests and bug reports are also welcome.
__________________

Last edited by asherkin; 01-24-2011 at 05:46.
asherkin is offline
Nail
BANNED
Join Date: May 2008
Location: PetrovЪ GradЪ
Old 01-24-2011 , 18:33   Re: [FRAMEWORK] CEntity
Reply With Quote #26

asherkin, Is it possible with the help CEntity create entity "npc_zombie" or other entitys from hl2 in css/tf2/dods server?

Last edited by Nail; 01-24-2011 at 19:04.
Nail is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 01-25-2011 , 13:39   Re: [FRAMEWORK] CEntity
Reply With Quote #27

Quote:
Originally Posted by Nail View Post
asherkin, Is it possible with the help CEntity create entity "npc_zombie" or other entitys from hl2 in css/tf2/dods server?
Yes, but it is a lot of work. Especially for non-TF2, as you'll need to cleanup/remove CPlayer as it uses a lot of CTFPlayer specific stuff.
__________________
asherkin is offline
Nite
Junior Member
Join Date: Dec 2007
Old 01-31-2011 , 20:00   Re: [FRAMEWORK] CEntity
Reply With Quote #28

I have been running into an issue w/ CEntity when it comes to dealing with engineers' buildables. For some odd reason, when a building is destroyed, the CBaseEntity and edict_t pointers change within CEntity to either another entity (instanced_scripted_scene) or get corrupted (change to 0xDDDDDDDD address). For some reason, this issue seems isolated to dispensers and sentry guns only. Teleporters behave just fine from my testing.

I wrote a simple function to deal damage to buildings only and ran it and here were the results (using Msg() to output).
How data below was outputted: pEntity is a CEntity pointer, BaseEntity is a CBaseEntity pointer, pEdict is an edict_t pointer, [classname] and [entity index]

Code:
Pre-Damage: pEntity @ 0x176BF070 BaseEntity @ 0x2338FF98 pEdict @ 0x112E30BC [obj_sentrygun] [623]
Post-Damage: pEntity @ 0x176BF070 BaseEntity @ 0xDDDDDDDD pEdict @ 0xDDDDDDDD 

Pre-Damage: pEntity @ 0x176BEDD0 BaseEntity @ 0x23390A20 pEdict @ 0x112E30E4 [obj_sentrygun] [625]
Post-Damage: pEntity @ 0x176BEDD0 BaseEntity @ 0xDDDDDDDD pEdict @ 0xDDDDDDDD 

Pre-Damage: pEntity @ 0x176BE7E8 BaseEntity @ 0x231F1F90 pEdict @ 0x112E3120 [obj_sentrygun] [628]
Post-Damage: pEntity @ 0x176BE7E8 BaseEntity @ 0xDDDDDDDD pEdict @ 0xDDDDDDDD 

Pre-Damage: pEntity @ 0x176BE890 BaseEntity @ 0x233AFC40 pEdict @ 0x112E3148 [obj_sentrygun] [630]
Post-Damage: pEntity @ 0x176BE890 BaseEntity @ 0xDDDDDDDD pEdict @ 0xDDDDDDDD 

Pre-Damage: pEntity @ 0x176BE938 BaseEntity @ 0x232099D0 pEdict @ 0x112E3198 [obj_sentrygun] [634]
Post-Damage: pEntity @ 0x176BE938 BaseEntity @ 0xDDDDDDDD pEdict @ 0xDDDDDDDD 

Pre-Damage: pEntity @ 0x176BEFC8 BaseEntity @ 0x2289A0D8 pEdict @ 0x112E31FC [obj_sentrygun] [639]
Post-Damage: pEntity @ 0x176BEFC8 BaseEntity @ 0xDDDDDDDD pEdict @ 0xDDDDDDDD 

Pre-Damage: pEntity @ 0x176BED28 BaseEntity @ 0x232B9388 pEdict @ 0x112E2E8C [obj_sentrygun] [595]
Post-Damage: pEntity @ 0x176BED28 BaseEntity @ 0xDDDDDDDD pEdict @ 0xDDDDDDDD 

Pre-Damage: pEntity @ 0x176BE740 BaseEntity @ 0x232BDD40 pEdict @ 0x112E3364 [obj_sentrygun] [657]
Post-Damage: pEntity @ 0x176BE740 BaseEntity @ 0xDDDDDDDD pEdict @ 0xDDDDDDDD 

Pre-Damage: pEntity @ 0x176C1F60 BaseEntity @ 0x2289EA90 pEdict @ 0x112E2BE4 [obj_sentrygun] [561]
Post-Damage: pEntity @ 0x176C1F60 BaseEntity @ 0xDDDDDDDD pEdict @ 0xDDDDDDDD 

Pre-Damage: pEntity @ 0x176C2DD0 BaseEntity @ 0x232BD2B8 pEdict @ 0x112E2D9C [obj_sentrygun] [583]
Post-Damage: pEntity @ 0x176C2DD0 BaseEntity @ 0xDDDDDDDD pEdict @ 0xDDDDDDDD 

Pre-Damage: pEntity @ 0x176C23F8 BaseEntity @ 0x232BFCD8 pEdict @ 0x112E2CD4 [obj_sentrygun] [573]
Post-Damage: pEntity @ 0x176C23F8 BaseEntity @ 0xDDDDDDDD pEdict @ 0xDDDDDDDD 

Pre-Damage: pEntity @ 0x176C2D28 BaseEntity @ 0x231F11F0 pEdict @ 0x112E2FF4 [obj_dispenser] [613]
Post-Damage: pEntity @ 0x176C2D28 BaseEntity @ 0xDDDDDDDD pEdict @ 0xDDDDDDDD 

Pre-Damage: pEntity @ 0x176C2A88 BaseEntity @ 0x232B7E78 pEdict @ 0x112E2E78 [obj_sentrygun] [594]
Post-Damage: pEntity @ 0x176C2A88 BaseEntity @ 0xDDDDDDDD pEdict @ 0xDDDDDDDD 

Pre-Damage: pEntity @ 0x176BEB30 BaseEntity @ 0x22898BC8 pEdict @ 0x112E2CE8 [obj_sentrygun] [574]
Post-Damage: pEntity @ 0x176BEB30 BaseEntity @ 0xDDDDDDDD pEdict @ 0xDDDDDDDD 

Pre-Damage: pEntity @ 0x176BF1C0 BaseEntity @ 0x2289F518 pEdict @ 0x112E2E14 [obj_sentrygun] [589]
Post-Damage: pEntity @ 0x176BF1C0 BaseEntity @ 0xDDDDDDDD pEdict @ 0xDDDDDDDD 

Pre-Damage: pEntity @ 0x176C3508 BaseEntity @ 0x23402EC0 pEdict @ 0x112E3C4C [obj_dispenser] [771]
Post-Damage: pEntity @ 0x176C3508 BaseEntity @ 0xDDDDDDDD pEdict @ 0xDDDDDDDD 

Pre-Damage: pEntity @ 0x176C2200 BaseEntity @ 0x234484E0 pEdict @ 0x112E3210 [obj_dispenser] [640]
Post-Damage: pEntity @ 0x176C2200 BaseEntity @ 0xDDDDDDDD pEdict @ 0xDDDDDDDD 

Pre-Damage: pEntity @ 0x176C3658 BaseEntity @ 0x23446B20 pEdict @ 0x112E2F2C [obj_dispenser] [603]
Post-Damage: pEntity @ 0x176C3658 BaseEntity @ 0xDDDDDDDD pEdict @ 0xDDDDDDDD 

Pre-Damage: pEntity @ 0x176C2158 BaseEntity @ 0x23575DA8 pEdict @ 0x112E2EB4 [obj_dispenser] [597]
Post-Damage: pEntity @ 0x176C2158 BaseEntity @ 0xDDDDDDDD pEdict @ 0xDDDDDDDD 

Pre-Damage: pEntity @ 0x176C1A20 BaseEntity @ 0x2289E008 pEdict @ 0x112E3350 [obj_sentrygun] [656]
Post-Damage: pEntity @ 0x176C1A20 BaseEntity @ 0xDDDDDDDD pEdict @ 0xDDDDDDDD 

Pre-Damage: pEntity @ 0x176C2E78 BaseEntity @ 0x231E6178 pEdict @ 0x112E2C70 [obj_dispenser] [568]
Post-Damage: pEntity @ 0x176C2E78 BaseEntity @ 0xDDDDDDDD pEdict @ 0xDDDDDDDD 

Pre-Damage: pEntity @ 0x176C33B8 BaseEntity @ 0x23573968 pEdict @ 0x112E333C [obj_dispenser] [655]
Post-Damage: pEntity @ 0x176C33B8 BaseEntity @ 0xDDDDDDDD pEdict @ 0xDDDDDDDD 

Pre-Damage: pEntity @ 0x176C2698 BaseEntity @ 0x232B9E10 pEdict @ 0x112E3044 [obj_teleporter] [617]
Post-Damage: pEntity @ 0x176C2698 BaseEntity @ 0x232B9E10 pEdict @ 0x112E3044 

Pre-Damage: pEntity @ 0x176C20B0 BaseEntity @ 0x23447550 pEdict @ 0x112E2EA0 [obj_dispenser] [596]
Post-Damage: pEntity @ 0x176C20B0 BaseEntity @ 0x23447550 pEdict @ 0x112E2EA0
This is problematic since CEntity instance is not destroyed (thus pointer to CEntity is still valid but internal pointers are corrupt/wrong). However, if you try to access any entity data w/ that pointer, crash occurs.

I have done testing 2 ways: 1. Just called OnTakeDamage if IsBaseObject returned true (both are virtuals of CBaseEntity) and 2. Destroyed object normally using Sniper class after storing his buildable in a CEntity pointer and outputting pointer information via Msg() function. Both ways yielded same results.

Any idea on what can be done to solve this issue?

Any help is appreciated. Thanks in advance.

Last edited by Nite; 02-01-2011 at 08:28.
Nite is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 02-01-2011 , 11:48   Re: [FRAMEWORK] CEntity
Reply With Quote #29

Which version of CEntity are you using? Also, any code you can provide will speed up debugging.
__________________
asherkin is offline
Quimbo
Member
Join Date: May 2008
Old 02-01-2011 , 17:23   Re: [FRAMEWORK] CEntity
Reply With Quote #30

Hi asherkin!

I'm working with Nite on an SM extension so I know he tried this with the latest CEntity taken from the dodgeball repository.

To test this just do a simple loop over all ents and call OnTakeDamage for buildables. For some, the entity will be a totally different one afterwards but the CEntity instance will not get deleted. Or the pointer will just point to garbage.

I'll see if Nite comitted something to test this to our repo, if not I gotta wait for him to show up ;)

Thanks for answering!
Quimbo 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:15.


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