the console

pacothegnome

Newbie
Joined
Apr 26, 2009
Messages
8
Reaction score
0
alright, i've been trying to make an epic battle in hl2 using the console at map d2_coast_07.
i've gotten all the characters i need to spawn, but now i need objects with which to create the proper effect. anyone know how to do this?

also, when citizens become part of my squad they spontaneously(not sure if i spelled that right) gain a chefs hat!! wtf is going on??
 
Trying to make an epic battle through the console in HL2 is going to be very frustrating for you.

If you want to do crazy stuff, either go into Hammer Editor or Garry's Mod.
 
ok, thanks
but, umm....

yeah, the guys still have chef hats, any ideas with that?
 
a massive thread bent on dominating the console!

oh btw, i was hoping that this thread would turn into something more than just a thing to answer my questions, so by all means, if anyone else has questions, i will do my best to help.

one last thing, how the heck do you get barnacles to stick on the ceiling?
 
yes, yes, i know what your thinking. use the phys gun and freeze or weld them or something to the ceiling. just as an update to my current situation, i downloaded garry's mod and it's fun and all, but it's a pain in the rump to make a building. i figured out whats wrong with the chef hats. it's that i had set npc_citizen_insignia to 1 in the hopes of making them have the skin they have in anti citizen one, but instead it gave them a chef hat. now i'm trying to see what would happen if a group of combine ran into a barnacle colony.

oh, and one other thing. this is my cfg file, and i was wondering if anyone had any suggestions for things i should add:

sv_cheats 1
bind x "impulse 101"
bind n "noclip"
bind h "npc_create npc_headcrab"
bind m "npc_create npc_manhack"
bind j "npc_create_equipment weapon_ar2; wait; npc_create npc_combine_s"
bind u "npc_create_equipment weapon_ar2; wait; npc_create npc_citizen"
bind i "npc_create_equipment weapon_smg1; wait; npc_create npc_citizen"
bind p "npc_create_equipment weapon_rpg; wait; npc_create npc_citizen"
bind o "npc_create_equipment weapon_shotgun; wait; npc_create npc_citizen"
bind b "notarget"
bind v "impulse 203"
bind t "ai_disable"
bind k "npc_create npc_zombie"
bind l "give item_box_buckshot"
bind y "npc_create npc_cscanner"
cl_ragdoll_collide 1
physics_highlight_active 1
physcannon_tracelength 1000
physcannon_maxforce 3000
physcannon_pullforce 10000000
physcannon_maxmass 100000
physcannon_chargetime 0
npc_citizen_squad_marker 0
npc_barnacle_swallow 1
npc_citizen_insignia 0
cl_showpos 1

thanks
 
Ones I always had bound to O and P (though I see you have them bound already) were the commands for ordering NPCs to go to a certain location. You can then guide any NPCs you like, not just citizens. I think the codes were "select" and "move". Any NPC that's currently selected will make his way to where ever you were pointed when you use the move command. Select an NPC a second time to deselect him. I think you need to have developer mode on to use them though. The code for this is "developer 1" or "developer 2". I don't know what the difference is between 1 and 2. When you're in developer mode you'll also get little text popups on your display. The only one I remember is that you get one whenever there is a physics error, ie, a clipping error. "Developer 0" turns off developer mode.

Recap on commands:
  • developer 1
  • select
  • move
  • developer 0

What you should look up next are outputs and inputs. It's been a while since I used the console so some of these codes might be slightly wrong. Inputs can be used to make the NPCs use specific abilities or do specific actions. An input command has the general form of "ent_fire [target] [input]". For example, "ent_fire george ignite" will cause george to burst into flames. Of course this means you must name your targets. To set the name of any object or NPC in the game, point at it and enter "ent_setname [name]". To find out an object's name and type point at it and enter "ent_show_response_criteria".

To find out all the inputs and outputs that can be used on a certain object or NPC use "ent_info [object]". So get a list of all the inputs and outputs one can use on an Overwatch soldier enter "ent_info npc_combine_s". When using "ent_fire" instead of using an object's name you can use "!picker" to do an action on whatever you're pointing at and "!player" to do it to yourself (in a multiplayer game "player" will do the action to all players. When an npc is created its name is, by default just the type of npc it is, npc_combine_s or whatever. You can name them when you create them though by just putting their name after the class when you spawn them, eg, "npc_create npc_citizen george".

Lots of NPCs have their own unique inputs. The strider has one for using it's super cannon. The helicopter has one for dropping mines. Overwatch soldiers have one for throwing grenades (in EP1, but not HL2. Never tested it for EP2). Headcrabs and antlions have ones for burrowing.

Recap:
  • ent_show_response_criteria
  • ent_setname [name]
  • ent_fire [target] [input]
  • npc_create [npc type] [name]

Special targets:
  • !picker
  • !player
  • player

Some fun inputs:
  • sethealth #
  • ignite
  • SetRelationship

Setrelationship is my favourite command and I'll explain how to use it now. This command changes how an NPC sees other NPCs, whether it considers it an ally or an enemy. It needs to be inputed in a specific way, this way:
ent_fire bob setrelationship "james D_HT 90"
This makes bob attack james. The HT means hate and the 90 can be any number. I think it's just an arbitrary value so that you can set an NPC to hate one enemy more than another, and therefore attack that one first. The values that can be entered for the type of relationship are:
  • HT -hate
  • LI -like
  • NU -neutral
  • FR -fear
What I used to love doing is making two groups of combine
  • npc_create_equipment weapon_ar2; wait; npc_create npc_combine_s alpha
  • npc_create_equipment weapon_ar2; wait; npc_create npc_combine_s beta
Putting them in squads
  • ent_fire alpha setsquad alphasquad
  • ent_fire beta setsquad beta
and then setting them as enemies
  • ent_fire alpha setrelationship "beta D_HT 90"
  • ent_fire beta setrelationship "alpha D_HT 90"
and watching them fight it out.

NPCs that are in the same squad will share information and work better as a team. Once one person on the squad knows where an enemy is, everyone in the squad does. It works great with making sure that a large hoard of zombies acts together or for attaching a scanner to a group of soldiers or a strider.

Speaking of scanners and striders, it's time for a lesson in outputs. These can do a few things. You can make mini scripts where when a certain event happens to one NPC, another NPC will do a certain event.
  • ent_fire npc_cscanner addoutput "onphotographplayer npc_strider,setcannontarget,!player"
I thin there is suposed to be a comma between setcannontarget and !player, but it could be a space. I'm not possitive. Either way, you should be able to tell what this should do. The general form for outputs like these are
  • ent_fire [outputentity] addoutput "[output] [inputentity],[input],#,#,#"
The three # are for three number entries. I haven't used them in quite some time so I don't quite remember what they're for. One represents how long after the output occurs that the input should occur. One says how many times the output can be used. I think the other one was "this output has to occur # number of times before the input will happen" but I'm not sure about that. I don't remember the order of the numbers either. They can be left out though (as above) so it's not a huge deal.


I'm sick of typing this for the moment but that's a introduction to inputs and outputs. Enjoy.


I just found this old thread through Google. Oh the memories!
 
that's awesome! thanks so much, i never knew i could put them in squads. this has got to be an "explaining astrophysics to a goldfish" scenario, and i feel like the goldfish.

i am defiantly going to have to make some major modifications to my cfg file
 
sorry about the double post, but the more i read the super happy npc spawning guide, the more i realize that i'm an idiot and that this thread has already been done. don't blame you guys if you trash this thread for being a fifth wheel.

still, can't thank you guys enough for showing me the guide.

oh, and one last thing. i was looking over what i had posted earlier and started thinking to myself "wow, i sound like an arrogant a-hole". so i just wanted to apologize for that
 
Back
Top