How to make NPC's shoot?
Quote from Madman on November 29, 2007, 3:19 amI already tried to find this out, unsuccessfuly.
So, npc's i put sctually are trying to shoot me, but no bullets fly.
I tried sk_npc_dmg command, but it doesn't seem to work...
So is it possible at all?Also one thing i can't figure out. When you put smth on a button, and it's triggered and goes down, than you stand at it together with physic object, and then you get off, the button untriggers. Any possible way to avoid this besides unchecking "clients"?
thx.
I already tried to find this out, unsuccessfuly.
So, npc's i put sctually are trying to shoot me, but no bullets fly.
I tried sk_npc_dmg command, but it doesn't seem to work...
So is it possible at all?
Also one thing i can't figure out. When you put smth on a button, and it's triggered and goes down, than you stand at it together with physic object, and then you get off, the button untriggers. Any possible way to avoid this besides unchecking "clients"?
thx.
Quote from volt on November 29, 2007, 4:26 amMadman wrote:I already tried to find this out, unsuccessfuly.
So, npc's i put sctually are trying to shoot me, but no bullets fly.
I tried sk_npc_dmg command, but it doesn't seem to work...
So is it possible at all?Also one thing i can't figure out. When you put smth on a button, and it's triggered and goes down, than you stand at it together with physic object, and then you get off, the button untriggers. Any possible way to avoid this besides unchecking "clients"?
thx.
Regular turrets should be an entity "npc_portal_floor_turret"
Rocket turrets should be an entity "npc_portal_rocket_turret"To make a button function properly, you need a small trigger in the middle for physics objects (normally filtering out anything that doesn't have the name "box"), and you need a bigger trigger that covers the whole button for clients only. You set each one to put the button down and disable theother onstarttouch, and enable the other and move the button up onendtouchall.
By the way, if what you are doing is making one trigger for both clients and physics objects, keep in mind that the client sets off a trigger if they are directly above it, while a physics object sets off a trigger if they are touching it at all. If you are using only one trigger, you'll find that activating it with client is too sensitive (aka you have to stand in the exact middle of the button) or activating it with the physics object is not sensitive enough (aka your box could be completely resting on the button's frame and still have the button depressed).
[url]See tutorial here[/url]
So, npc's i put sctually are trying to shoot me, but no bullets fly.
I tried sk_npc_dmg command, but it doesn't seem to work...
So is it possible at all?
Also one thing i can't figure out. When you put smth on a button, and it's triggered and goes down, than you stand at it together with physic object, and then you get off, the button untriggers. Any possible way to avoid this besides unchecking "clients"?
thx.
Regular turrets should be an entity "npc_portal_floor_turret"
Rocket turrets should be an entity "npc_portal_rocket_turret"
To make a button function properly, you need a small trigger in the middle for physics objects (normally filtering out anything that doesn't have the name "box"), and you need a bigger trigger that covers the whole button for clients only. You set each one to put the button down and disable theother onstarttouch, and enable the other and move the button up onendtouchall.
By the way, if what you are doing is making one trigger for both clients and physics objects, keep in mind that the client sets off a trigger if they are directly above it, while a physics object sets off a trigger if they are touching it at all. If you are using only one trigger, you'll find that activating it with client is too sensitive (aka you have to stand in the exact middle of the button) or activating it with the physics object is not sensitive enough (aka your box could be completely resting on the button's frame and still have the button depressed).
[url]See tutorial here[/url]
Quote from Madman on November 29, 2007, 8:59 amQuote:Regular turrets should be an entity "npc_portal_floor_turret"
Rocket turrets should be an entity "npc_portal_rocket_turret"And Combine soldiers should be...
As for the two triggers, onendtouchall command releases the button only if EVERYTHING gets off it, be it clients or objects, right?
Rocket turrets should be an entity "npc_portal_rocket_turret"
And Combine soldiers should be...
As for the two triggers, onendtouchall command releases the button only if EVERYTHING gets off it, be it clients or objects, right?
Quote from volt on November 29, 2007, 10:38 amYa should have said something about that! I figured you were using a prop_dynamic or physics to set up a Portal NPC (durrrr). I don't know anything about HL2, but i read on the SDK Wiki that you have to set up a relationship entity that makes the intended enemies hate you.
"OnEndTouchAll" makes sure that there are no entities that trigger it within the trigger volume before firing the commands you have set. For instance, if you put two buttons so that they are both activating the box trigger, if you remove one box, "OnEndTouch" would deactivate your button while "OnEndTouchAll" would not. Not sure how this applies to clients, though, but this is how Valve does it, so this is how I do it.
Ya should have said something about that! I figured you were using a prop_dynamic or physics to set up a Portal NPC (durrrr). I don't know anything about HL2, but i read on the SDK Wiki that you have to set up a relationship entity that makes the intended enemies hate you.
"OnEndTouchAll" makes sure that there are no entities that trigger it within the trigger volume before firing the commands you have set. For instance, if you put two buttons so that they are both activating the box trigger, if you remove one box, "OnEndTouch" would deactivate your button while "OnEndTouchAll" would not. Not sure how this applies to clients, though, but this is how Valve does it, so this is how I do it.
Quote from Madman on November 29, 2007, 10:43 amThank you, this seems to work for clients as well as everything that's checked in flags of the trigger.
And concerning NPC's, they Do hate me, and do shoot me. There are gunflashes, but no bullets and bullet sounds. Though if you come close, meelee attack works. That's just above my understanding.
Thank you, this seems to work for clients as well as everything that's checked in flags of the trigger.
And concerning NPC's, they Do hate me, and do shoot me. There are gunflashes, but no bullets and bullet sounds. Though if you come close, meelee attack works. That's just above my understanding.