Super happy NPC spawning guide

Status
Not open for further replies.
YangMan: in my opinion some NPCs can memorize it and some can't. Citizens and antlionguard can't be set friendly to the player forever,however one to each other is possible. I figured that maybe it was because I edit while in ai_disable,or notarget: but,in the end,having experimented a lot,it just seems that even doing that,the information is not saved.

madcat: we should ask about the bodygroup on the Verc forums. I'm always asking things there,I'm spoiled as a coding noob. Please,try to post something about this in my place!

btw,substance 041 is out :naughty:
http://xdiesp.altervista.org/index.html
 
has anyone ever tried to kill a stalker with the superggun? does it crash also?

madcat: why don't you come editing some level for Substance? just the normal spawning
 
ríomhaire said:
I can't get the "setrelationship" to work

riomhaire look a few pages back for my guide on setrelationship. bear in mind u dont type the brackets in the console, thats just so u know exactly what to type for what command.
 
YangMan said:
I've been playing around with this setrelationship thing, and not only can you set an entity to hate/like a whole group (ie npc_combine_s), but also specific named npc's.

So if you create 2 antlions both named 'selected', and you use

ent_fire "selected" setrelationship "selected D_HT 500"

those 2 antlions will try to kill each other but not antlions that have not been named 'selected'.

Note for antlions before the Sand Traps level, they will attack you whether or not you carry the bugbait, unless you use setrelationship to make them friendly towards you. But then, they only respond to a bugbait throw and not squeeze.

How this selective relationship setting is helpful is that say you create several npc's that are usually hostile, but make them friendly, you can make them not attack each other, but still attack hostile npc's in a single line of code. Just name all of these converted friendlies "friendly", then use the setrelationship thing to make "friendly"s friendly to "friendly"s.

ie. ent_fire "friendly" setrelationship "friendly D_LI 500"

Then, a friendly zombie won't attack a friendly antion, but will attack a hostile one, etc.

Now all you have to do is use setrelationship to make other frienly npc's, like alyx, barney and citizens (and after sandtraps, antlions also) to like whatever is named "friendly". Then, whenever you convert a baddie to a "friendly", or spawn a new "friendly", they will not attack. But keep in mind to set "friendly"s to not attack alyx and barney, etc also whenever you create them (I don't think you can make an npc group like/hate another group/individual in they console - it has to be by a named npc).

Understand? Confused? Try it out, it should make sense in due time. It works because all of the friendly npc's are named "friendly". To make sure, try doing ent_fire "friendly" ignite, all of them should ignite, not just the one you named last.

This should also work to make friendly turrets not attack friendly turrets. Just make sure the like factor for friendly turrets is a higher number than the hate factor for combine (haven't tried it yet though).


However, I'm still trying to make alyx, barney, friendly npc's or more than 4 citizens follow you. It may also be necessary to make antlions follow you, as they don't respond to the bugbait squeeze.

BTW who said the GMan can take a lot of damage? 2 shots from a turret killed him!

Also, get two antlionguards to fight, they just growl at each other and fall dead!

Warning! Headcrabs that fall off zombies are still hostile!


well done u mite have made a break through i will test this out with the turrets! maybe this could help with the citizens hating the turrets by making them called friendly and make citizens friendly to friendly! i cant remember if i've tried this out before i think it didnt work but i dont think i took into account the priorities.


about the antlions not following you with the bugbait, the first entry on this thread says something about an imput for the antlions to hear/ignore the bugbait. have you tried this?
 
Notes said:
I think that would be the pulse rifle, or ar2(?) the one that shoots the glowing balls secondary fire that dissolves corpses.


does it dissolve dead bodies in your game then? in mine it only disolves them if they are alive, if they are dead on the floor it just bounces off the floor where the corpse lays. :O
 
YangMan said:
I've recently played around a bit more with the turret things. Apparently, they will still shoot you even if they 'like' you, and will not shoot any combine that you spawn even if they 'hate' them.

You have to get them to attack a combine you didn't spawn first, then any turret you spawn after that will not attack you and will attack spawned combine... Strange. Maybe if I named them turret_buddy like someone said, instead of 'friendly'?

xdiesp: If when you reload the npc's return to their normal state of liking or disliking you, then perhaps you'll need to be careful with spawning npc's that normally hate you then reloading...

Anyone know what the source engine does to change antlions to like you and respond to bugbait squeeze? It's obviously not the bugbait itself that makes them like you. And how do they toggle whether turrets like you or not, and whether npc's follow you or not? IF someone finds out how, we could try mimic it in the console. Or is that all dependant on which map you're on?


yangmang, turret_buddy and friendly should work the same as long as u change the ent_fire command using the name friendly. REMEMBER to make sure you're setting the turrets hostile to npc_combine_s AND npc_metropolice! try making the turret liking you command a higher priority, i use 90. i've never really encountered the turrets not liking you and not attacking enemies at first so i dont know what else to suggest, but if ur using ai_disable for whilst ur placing npc's, make sure when u enable the ai again, u use the ent_fire command on the friendly turrets using the 'enable' input otherwise the problem i've encountered is the turrets wont activate and start firing at things they hate until you enable them.
 
Luke: listen,do you know what the number after the D_LI is for?

Garry's mod's woman4 has the rebel model,does anyone know if the mod can spawn only ragdolls or "alive" people too?
 
xdiesp said:
Luke: listen,do you know what the number after the D_LI is for?

Garry's mod's woman4 has the rebel model,does anyone know if the mod can spawn only ragdolls or "alive" people too?

the number is the priority. if something has a priority of one and something else has the priority of 2, 2 will be the highest priority. so when u tell a turret to hate combine soldiers, it will automatically hate turrets as well (as explained earlier in this thread) because they are combine turrets. so u tell turrets to like turrets, and make it a higher priority than hating combine soldiers, so it will still hate combine soldiers but also like other turrets. does that make sense? :afro:
 
madcat75: did you read mys post about you,the VERC and garry's? Garry's can spawn them,but only dead (I think). The Verc forums are the right place to ask this,but please do it for me (I've already half a dozen open topics there)

luke: until now I've always set the same number (666). They both liked and hated as set,the number didn't seem to have things any different...
 
Yeah but I'd like to know how to change their body group while in single player campaign!
 
All I wanna know is how to change a citizen's model into a medic's one, during a single player game.
 
madcat75: setting,the Verc Forums. Subject,Setbodygroup Command. Message,"All I wanna know is how to change a citizen's model into a medic's one, during a single player game"
 
I think (hope) I might have another break through, but I never got to test it before my entire computer crashed. Now I'm re-installing everything, and HL2 is unfortunately very low on the priorities list.

Anyway, when I first tried to bind a key to make an npc friendly, for example:

bind "NP_ENTER" "ent_setname "friendly"; ent_fire "friendly" setrelationship "player D_LI 900""

Which should work by theory, except that it doesn't seem to be able to support quotation marks within quotation marks... And if you do something like:

bind "NP_ENTER" "ent_setname friendly; ent_fire friendly setrelationship player D_LI 900"

The engine thinks that you're trying to input "player" as the argument for setrelationship (which draws an error), rather than "player D_LI 900", which is the correct argument.

So where does this leave us? Hopefully with a solution. Note: The following idea has not been tested yet due to my computer crashing, but I thought that maybe it might help some of you if it does work. Plus, I'm dying to know.

Well, we can't have "..." within a "...", so then we need to make "player D_LI 900" into a single argument, without a space (and therefore eliminating the need for "..."). The only way I can think of is using alias. For example (and I hope this works),

alias "like_player" "player D_LI 900"
bind "NP_ENTER" "ent_setname friendly; ent_fire friendly setrelationship like_player"

Therefore we've eliminated the need for "..." as the argument no longer has a space. Could someone please test that? If it works, then you could use a similar method to make them hate combine and like your allies, etc.

Another, unrelated, idea that I wanted to test but never got the chance to was about getting antlions and alyx/barney to follow you. It's obvious now that Valve took a shortcut and didn't make the antlions really check whether you have bugbait or not, rather, it is either map-based or some variable is changed after a certain level. It is the latter that I am hoping for.

The latter is the case with the supercharged gravity gun. As, if you load the map in which you have the blue gravity gun with map [map_ name] (can't remember what it was), then changelevel [map_name] to a map where you're not meant to have the super gravity gun (and type impulse 101 if you're not even meant to have the normal gravity gun), then you will be given the super gravity gun instead.

This is what I am hoping for with the antlion thing as well. Could somebody try to use map [map_name] to load a sandtraps or nova prospekt level where the antlions are friendly and also hear your bugbait squeeze and not just throw, then use changelvel to load a previous level, where the antlions aren't friendly, hopefully the antlions will also be fully respondant to the bugbait and like you too. Could someone test that and posts the results here?

Maybe that would also work with alyx and barney. Load a level where they follow you, then change it to one where they don't. Just a theory, which I unfortunately can't test right now.
 
Yangman: spawned antlions do not respond to the squeeze even in sandtraps
 
madcat: it could only be done with the garry's mod,because those are props - anyway I don't know if it's included yet.
 
I got setrelationship working. Thanks.
Stange thing. I set up a battle with citizens V Combine, and spent AGES making a helicopter that was an enemy to the Combine and friendly to citizens. When I was done the Combine turned around and shot thier own gunship and were qickly killed by the citezens who the gunship killed and the helicopter just ignored everyone. IT REALY PISSED ME OFF. :angry:
 
How do you spawn an ammocrate? I tried this:

give item_ammocrate but it gave me an error.

(ya know, the green metal ammo crates that you open up)
 
madcat: I never tried this (Substance has lesser of those,I took them out actually),but the name is item_item_crate

most of the setrelationship settings do not get saved in savegames,remember this as a milestone. Time instead to do another step: check these commands:

npc_select (select one in the crosshair)
npc_go (the selected npc goes here)
npc_go_do_run (dunno,my selected npcs always run)
npc_go_random (the selected goes to a random node,not very useful)
 
xdiesp: Just a little thing; npc_go_do_run is a setting that determines if the NPCs run or walk when you use the npc_go command.
"npc_go_do_run 0" (without quotes) makes them walk, set it to 1 and they'll run to their destination.
 
The spawned antlions don't respond to the bugbait squeeze even in Sand Traps? Woah... so it's not map dependant or like the gravity gun. But it doesn't seem to be a totally different npc, so there musst be some other setting, right? Anyone have any idea what Valve did?
 
YangMan: maybe is a property of antlions that come from the respawn points...things that you can only change in hammer...
 
madcat75: If you need ammo, why not just use impulse 101? Or if you're creating a map, I don't think you're meant to just use the console anyway...

xdiesp: I thought that hammer was for outputs that triggered npc inputs. So, can't we just trigger the input in the console?
 
YangMan said:
madcat75: If you need ammo, why not just use impulse 101? Or if you're creating a map, I don't think you're meant to just use the console anyway...

I wanted to make it a bit more challenging for myself and just use specific ammo.
 
You can. Use:

give weapon_[something]
give item_[something]

Google 'half life 2 cheats' or something for a complete weapons/ammo list...
 
madcat: in my opinion it can't be done,speaking of the ammo crate. When I edit my Substance levels and I want more ammo,I use the give command repeatedly so that when I'm at full ammo,the others ammo box fall on the ground. If I have to spawn many grenades,I use the ent_fire npcname giveweapon weapon_frag command a lot (just be quick either moving or picking them up because sometimes they disappear)

Yangman: in the console you can use the addoutput command to have an imput on something trigger an existing trigger in something else. I'll paste a couple of text not mine:

"ent_fire name addoutput ..." : where ... stands for <output name> <targetname>,<inputname>,<parameter>,<delay>,<max times to fire (-1 == infinite)>

OnPhysGunPickup battery_relay_3:Trigger::0:1"
This adds an output to the target entity (in this case a physics prop). It creates a connection from the physics prop's "OnPhysGunPickup" output to the "Trigger" input of a target entity (or entities) named "battery_relay_3". The parameter is left blank, there's a 0 delay, and the connection removes itself after firing once.
 
Thanks, didn't know that. What's the difference between using simicolons and colons? I really need to learn the proper syntax of the console...
 
Yangman: can't helpl you...

sigh,I hoped the npc_go command could work with Striders and flying vehicles. There must be a way to get the name of a waypoint and then send them there! Maybe the Console Commands guide (full list,very detailed) on HL2world can help us
 
holy cow,I've been able to use the setbodygroup command! Try yourself:
ent_fire copname setbodygroup 1
 
anyone know how to make a gunship not explode when it dies? when i do "give npc_combinegunship" and shoot it down with smg grenades (i dont have a rocket launcher, and cant summon it!) but it always dies into pieces

also anyone know how to make synths/advisors/combine elites/scanner#2/?
 
xdiesp said:
holy cow,I've been able to use the setbodygroup command! Try yourself:
ent_fire copname setbodygroup 1

I tried it on citizens and it wont work
 
xdiesp: So, one could use hammer to find out what variable is changed to make the bugbait squeeze work and make alyx follow you, right? Then all is needed is to manually change that variable when you create an antlion or alyx, right?

Is anyone familiar enough with hammer to do that? I haven't reinstalled HL2 yet, and I'm not familiar with hammer.
 
shadow: it is needed that someone goes to the VERC forums and ask how to spawn those,as of now we don't have a clue

madcat: only work with cops!

yang: yes,but neither I know how to do it...
 
then why does it list the command under npc_citizen when I do:

ent_info npc_citizen
 
Status
Not open for further replies.
Back
Top