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

spawned entities not responding to being shot


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
L. Duke
Veteran Member
Join Date: Apr 2005
Location: Walla Walla
Old 04-30-2008 , 15:36   spawned entities not responding to being shot
Reply With Quote #1

I have some tripmine code that works find in my MMS plugin that I am porting to an SM plugin. When I spawn the prop_dynamic using the same keyvalues/properties/vfuncs they don't respond to being shot (even though they do in my c++ code). The SM version does respond correctly to nades blowing up nearby or to another tripmine exploding.

Does anyone know what's necessary to allow a prop_dynamic to have it's health changed when shot?

Here is the code.
Attached Files
File Type: sp Get Plugin or Get Source (tripmines.sp - 669 views - 5.7 KB)
__________________
"Good grammar is essential, Robin."
- Batman

Last edited by L. Duke; 04-30-2008 at 15:49.
L. Duke is offline
raydan
Senior Member
Join Date: Aug 2006
Old 05-01-2008 , 08:01   Re: spawned entities not responding to being shot
Reply With Quote #2

i already make a tripmine long time with SM version(use amxmodx version to convert), i am using prop_dynamic, and i try prop_physics before, but "tpplug.mdl" can't change angle, i don't know why

in http://developer.valvesoftware.com/wiki/Prop_physics, can use SM to hook entity output "OnHealthChanged"

but, http://developer.valvesoftware.com/wiki/Prop_dynamic, no output "OnHealthChanged"

if you can spawn "prop_physics" with "tpplug.mdl" and make it a correct angle, you can do "OnHealthChanged"

Last edited by raydan; 05-01-2008 at 08:04.
raydan is offline
L. Duke
Veteran Member
Join Date: Apr 2005
Location: Walla Walla
Old 05-01-2008 , 10:10   Re: spawned entities not responding to being shot
Reply With Quote #3

OnHealthChanged applies to CBreakableProp which is inherited by both dynamic and physics props. I know that it works because it works fine in my mms plugin.

Also, setting the angle of the prop is not a problem:
[IMG]http://img238.**************/img238/244/csitaly0000pl4.th.jpg[/IMG]z

It just won't react to being shot for some reason.
__________________
"Good grammar is essential, Robin."
- Batman

Last edited by L. Duke; 05-01-2008 at 10:16.
L. Duke is offline
raydan
Senior Member
Join Date: Aug 2006
Old 05-01-2008 , 10:48   Re: spawned entities not responding to being shot
Reply With Quote #4

here is my lasermine

how is you code is mms?

raydan is offline
L. Duke
Veteran Member
Join Date: Apr 2005
Location: Walla Walla
Old 05-01-2008 , 10:51   Re: spawned entities not responding to being shot
Reply With Quote #5

I got it working. I used "prop_physics_override" and then didn't call CreateVPhysics (if I called CreateVPhysics it started simulating physics and fell off the wall).

It works to shoot it, and if someone walks through it the person who planted it gets a kill.

Thanks for the input, I probably wouldn't have tried changing the prop type if you hadn't said that (since it worked with prop_dynamic before).
__________________
"Good grammar is essential, Robin."
- Batman
L. Duke is offline
raydan
Senior Member
Join Date: Aug 2006
Old 05-01-2008 , 11:05   Re: spawned entities not responding to being shot
Reply With Quote #6

delete

Last edited by raydan; 11-06-2008 at 03:56.
raydan is offline
L. Duke
Veteran Member
Join Date: Apr 2005
Location: Walla Walla
Old 05-01-2008 , 12:07   Re: spawned entities not responding to being shot
Reply With Quote #7



Mine uses the source engine's entity I/O system to handle the tripmine's functionality once it has been spawned so that I can "set it and forget it."

I've posted the plugin with the final working code.
__________________
"Good grammar is essential, Robin."
- Batman
L. Duke 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 08:57.


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