Npc attackin at start

  • Thread starter Thread starter demetri
  • Start date Start date
D

demetri

Guest
Ok, i made some Npc's on a map I made, I want them to attack humans(combine or rebels). I know you have to type something in the console to just do reg spawning, but I want these to just start at my map and attack whoever it comes in range with. Do i have to make some kind of script? Im more used to Doom3 than anything but A little help would be nice.
 
they will attack as soon as they see you!
 
No they don't attack you. I'm talking about Half life 2 DEATHMATCH. in deathmatch they see you but just stand there and dont do anything.
 
I have the same problem.

I followed the tutorial at http://www.*************/wiki/index.php/Ai_Assaults, and I'm positive I've done what it says word for word. However, I can't get the Combine soldiers to attack. They won't even move, even when I start killing them myself.
Correction, I did do one thing differently. It says to start the assault when the func_button is pressed. I couldn't find where func_button is, so I changed the cue to 'on gunfire', and created an env_gunfire. When they hear it the Combine soldiers adopt a combat stance, but that's it.

Hopefully we have the same solution Demetri. :)

EDIT - Odd, am I not allowed to type hl2world dot com?
 
Yeah, took me a bit to work out how to make them. :P

What's odd is that if you load the map up in Singleplayer, the NPC's work fine. They will perform assaults and attack you perfectly. However, loading the exact same map in a Deathmatch mod, they just stand there, like demetri said. Anyone know why this is or how to fix it?

EDIT - Just found something. Quoted from SnarkPit.com
Q: Can I have monsters attack me in deathmatch levels?
A: No- there is no AI configured for them in DM mode.

Hopefully Valve adds this in.
 
Actually i have pretty all monsters/machines working including gunships, helicopters and striders... Only combie soldiers and other characters wont work :)
 
Whoohoo said:
Actually i have pretty all monsters/machines working including gunships, helicopters and striders... Only combie soldiers and other characters wont work :)

Ya, that's what sucks.. why can't you put in a combine to attack? That's very disappointing. :(

And striders are WAAAY too complicated...

What about the new(ish) Half Life 2 Multiplayer option that you can make.. is it possible in that? What's the difference between making a "Half Life 2 Multiplayer" and a Deathmatch server?

Cheers
 
if you spawn them manually, the will attack you. I remember reading a guide somewhere that you can type something in the console and they attacked.
 
demetri said:
if you spawn them manually, the will attack you. I remember reading a guide somewhere that you can type something in the console and they attacked.

Ok, in your original post, you said you "made some Npc's on a map" and then went on to say "I know you have to type something in the console to just do reg spawning"

Well, that's not right. "Regular" spawning for a MAP is done by the map, you don't type anything in the console.

Then in a post further down, you say "I'm talking about Half life 2 DEATHMATCH."

Ok, if this is Deathmatch we're talking about, then I highly doubt what you say is true, and I think you're simply mistaken. Either you read the "guide" wrong, or the guide itself was wrong.

I've been trying for some time, and looking for posts on how to make combine attack in Deathmatch. That, combined with my discussions with the person who made the tim-coop maps (with most type of attacking NPCs, except combine and other humans... and I think he didn't use barnacles anywhere, but not for any reason) .. well, all leads me to believe that if it's possible, it's not trivial, and highly doubtfully done by a simple console command.

Next up, spawning something manually shouldn't really make any difference.. if anything, doing stuff from the console is more limited than using other game creation tools, since the console is inherently a subset of what the game is capable of doing..

I'd be happy if you proved me wrong, but.. I'm not holding my breath.
 
Ok, what i do to put Npc's in my map


1st)Load up Hl2 Deathmatch with hammer.
2nd)make a map and put a entity as npc_antlion
3rd)compile and all he does is stand there and i can kill him with 1 shot ;(

plus what guide are you talking about?
 
crap. Hammer can be so annoying sometimes.. crashes just when you will lose the most amount of work possible.. Fortunately I suspected it might switching back and forth to it to write this message properly, so I pasted and saved as I went along and at least didn't have to re-write the -whole- thing from scratch! :-/

demetri said:
Ok, what i do to put Npc's in my map


1st)Load up Hl2 Deathmatch with hammer.
2nd)make a map and put a entity as npc_antlion
3rd)compile and all he does is stand there and i can kill him with 1 shot ;(

Yup. You need to add in a few more things to your map. You need an ai_relationship, to set the antlion to hate !player. You need a logic_auto, to send commands to the server, and probably client (I do both cause that's how tim taught me, and it works), and so you need a point_clientcommand and point_servercommand for the logic_auto to send to.

Then you tell the logic_auto to send commands on onmapspawn to the point_clientcommand and point_servercommand in pairs, starting with sv_cheats 1 with a delay of 0, then sk_antlion_health 400 (or whatever) with a delay of 0.02, and other sk_'s you might want to change at 0.02 intervals (0.02, 0.04, 0.06, etc.) - like you might want to also set sk_antlion_jump_damage 80, and sk_antlion_swipe_damage 50, or some such thing.. and lastly send off sv_cheats 0 with a delay of maybe 1.00 (at least round up to the next 0.5 seconds or so.. so if you only changed a few sk_'s, then probably 1.00 is fine)

It's quite possible that you will also have to use an npc_template_maker as well. Tim does it, and my attempts to make things work without have been unsuccesful also. So you make your actual NPC flagged Template, and make an npc_template_maker, which names your NPC.. which you should give a unique name to (like MyAntlion01 or whatever) Then in your logic_auto add in another onmapspawn spawn MyAntlion01_maker (or whatever you called your antlion npc_template_maker)

More or less, the fairly-painful "one template" to "one template maker" with unique names seems to consistently work, at least. Other ways seem flakey at best, if not completely broken.

Last bit.. you -may- not have to do this for antlions, if you have ONLY antlions on your map, since I don't think they ragdoll.. but you may have to anyway, as my map didn't even work right until i did... and it probably won't hurt anyway... juts put in a game_ragdollmanager, and probably set max ragdolls to 1.

Actually, if you DO have any enemies that will ragdoll (also can exclude antlions here I -think-) you should set their sk_ health sufficiently high that they'll have twice the health you'd normally want them to have. Then you set in an output in the NPC (again a template, whatever it may be) to Onhalfhealth break probably with a delay of 0.

If you do not break them onhalfhealth, and thus get ragdolls when they die... I think you will find that your client will crash, sometimes as soon as you get a ragdoll or two, and sometimes later, but (for me at least) always by the time you either try to change levels or quit, it will crash. Feel free of course to try it without doing this, and even without the ragdoll manager (or perhaps with ragdoll manager set to max ragdolls something higher.. but also there seems to be issues with "fade corpse") .. cause if you CAN get it to work, I'd love to know how!

(if you can get it to deal with ragdolls, then you could have your template maker make multiple NPCs from your template NPC, since they could then have the same name.. if you try it the way I tell you, except you make multiple NPCs from your template, the NPCs will have the same name, and when you do your "onhalfhealth break" thing, it'll break ALL the NPCs with the same name! -- and since the time-delay in the npc_template_maker seems to be ignored (they're all just spawned one after the other) well.. then they're all alive with the same name.. and if you try a delay of -1, meaning don't spawn the next untill the previous one is dead.. it seems pretty buggy and sometimes won't even spawn one..)

Whew! I think I sort of got it more or less down. It's quite possible I didn't explain it all that well, so feel free to ask questions, if you're not sure, or you can't get something to work... there's pretty much a reason for every single thing I said to do.

I also take no credit for learning any of this stuff myself.. Tim taught it all to me... and I just found in my own fumbling way that nothing else (that I've tried..) works. (well enough to be usable)


plus what guide are you talking about?

Uhmm. the one YOU are talking about...

if you spawn them manually, the will attack you. I remember reading a guide somewhere that you can type something in the console and they attacked.

That guide. ;)
 
Cheers for that Notes, very helpful. Just to confirm though, it won't work for Combine troops will it? Is there any other 'human' unit that does work? The main idea for my multiplayer mod included NPC humans, and if that doesn't work I'm going to have to rethink the whole thing.
Thanks again.
 
Ya.. sadly, it does not work for combine or any other human type npc.

Tim is working on a mod though.. and may yet get them to work somehow. (with his mod, he has already fixed a few of the problems that all that stuff I explained to do was work-arounds for.)

I also assume Sven will have a working mod eventually that will have combine attack.. or else the whole Sven project (for HL2) will not be possible, I'd think... so you may still think to build your idea down the road, but just either work more on the layout now, or just do other stuff for the time being.
 
Ok, I still am a little nooby at this, so if you could answer them "kindly", that be even better. Ok i have all those entities and crap.
Right now im working on the logic_auto. Do i go into the properties and go to outputs? I sort need to know a lot a crap. Whats with the sv_cheats 1 thing? Where do i put all your info into! :angry:
 
demetri said:
Ok, I still am a little nooby at this, so if you could answer them "kindly", that be even better. Ok i have all those entities and crap.
Right now im working on the logic_auto. Do i go into the properties and go to outputs? I sort need to know a lot a crap. Whats with the sv_cheats 1 thing? Where do i put all your info into! :angry:

Ya.. sorry, I did assume a fair amount.. I have to head out now, but I'll drop you a reply here and/or look for you on MSN when I get back in a couple hours.
 
Ok, like I say ask away if anything else needs more detail or whatever.. but.. here 'goes:

In the logic_auto, ya, you go into the properties, and you go "Add" and then under "My Output Named" and put "OnMapSpawn" and then Targets, you put client (or server), and "Via this input" put "Command" and in "With a parameter override of" you put "sv_cheats 1" and leave the delay (for these first two) at zero.

Then you hit Add again, and make one exactly the same, except put server (or client - whichever one you didn't do in the first one) So now you have one line for client and one line for server to set sv-cheats to 1.

The idea here is that you are telling both the client and the server to change a bunch of settings (the health of monsters, etc.) which are actually classified as cheats... so first we enable cheats, set all the settings we want, and then disable cheats.

Here is a little example one with just some zombie stuff for you to get an idea:

logic_auto_example-1.jpg


After you do that, you should then be able to go into your point_servercommand and point_clientcommand and see under the INPUTS tab, all the commands for the server, and the client, respectively.

That is assuming you name/named your point_clientcommand "client" and your point_servercommand "server" - again, just go into the properties.. and just change the only Keyvalue in the Class Info tab, which is "Name" for each of them. You might want to do that first, not that it matters really, just establishes the name, so when you type "client" or "server" in the logic_auto outputs, it knows what you're talking about.. but it doesn't really matter what order you do it in, as long as you do it... and you don't -have- to use the names client and server, they could as easily be black and blue, as long as your logic_auto outputs then went to black and blue.. ;)

Hope that helps a bit more.. let me know how it goes. I guess that was you I saw popped on MSN..? Anyway, I'm heading back out in a bit, but only for about half an hour.

Cheers
 
Back
Top