How to make NPCs friendly and semi-binding it

Was this helpful?

  • Yes

    Votes: 0 0.0%
  • No

    Votes: 0 0.0%
  • I'm confused what is this? [Post if confused]

    Votes: 1 33.3%
  • You suck GTFO this forum

    Votes: 2 66.7%

  • Total voters
    3
M

MirrorImage

Guest
Orginal Link to the guide I posted on hl2 world If your wondering yes I did modify with a few updates.

http://www.hl2world.com/bbs/how-to-make-a-npc-ally-hatebinding-it-vt44044.html

MOVE THIS IT IF IT IS IN THE WRONG LOCATION PLEASE and post your questions if you have any I think this could be best merged with the super happy entity guide thing. I will update this post as I figure out new things or adding new entities to my spawnlist

What it is.
Ok I don't know if this has been posted before. But I'm posting a tutorial on how to bind the

ent_fire !picker setrelationship "player d_li 90"

Because you can't bind quotes inside quotes in half-life. This command makes what ever your looking at a ally you can also change this to work for other entities to ally something else or for entities to hate eachother.

How it works.
It is a alias that spawns a npc and executes the command from another cfg. The way I did it it works around binds by executing another file which does it for you. I did it this way because you can't bind it or use alias to bind the command but to use the command after it set is really easy

Creating it
First you have to create two .cfgs, in your config folder located in your half-life2 folder, name one spawnent second one ally or what ever you want to call them. For the allying I called it "ally.cfg" and for the spawn list I called it "spawnent.cfg" or course you can change it to something else but you'd have to modify "exec ally" to "exec (nameyouchoose)"

In the like.cfg add this in
ent_fire !picker setrelationship "player d_li 90"
alias ally "exec ally"

//thats all don't do anything else

In spawnent.cfg put your spawn commands in example
alias spawnsold "npc_create npc_combine_s;ally"
//replace spawnsold and npc_combine_s with whatever you like

than type in your console exec spawnent which will update your config and add them in. You might want to put a line in your config.cfg "exec spawnent" which will automaticily load it when you start half-life2.

EDIT: My List so far
//Combine Soldier
alias spawnsold "npc_create npc_combine_s;ally"
alias spawnsoldpatrolsquad "npc_create npc_combine_s;ally;ent_fire !picker startpatrolling;ent_fire !picker setsquad 1337"

//Metro Police
alias spawnpol "npc_create npc_metropolice;ally"
alias spawnpolpatrolsquad "npc_create npc_metropolice;exec ally;ent_fire !picker startpatrolling;ent_fire !picker setsquad 1338"

Using it
To actually spawn them
1.Open your console
2.type in spawnsold
3.Close

You can also bind a key to "ally"
bind x "ally" and whatever your looking at will ally you.

It should have spawned the npc and executed the config which makes whatever your looking at ally.

Other things to do
Setting the relationship
"d_li" makes them like you.
"d_ht" makes them hate you.

You can also make other npcs like eachother with

ent_fire !picker setrelationship "npc_citizen d_li 90"

which would make anything you were looking at a ally to citizens so you can make a big war like rebels and metropolice vs cmbine.

How to make them into a squad so the help eachother and they patrol.

alias spawnsoldpatrolsquad "npc_create npc_combine_s;exec ally;ent_fire !picker setsquad 2;ent_fire !picker startpatrolling"

Only works on metropolice and combine soldiers I believe.

Note: I will update as I figure more things out. Also upon loading the game they will revert so I'd bind a key to "ally"

MOVE THIS IT IF IT IS IN THE WRONG LOCATION PLEASE and post your questions if you have any I think this could be best merged with the super happy entity guide thing.
 
Back
Top