Jump to content

Custom NPCs in GTKRadiant


Recommended Posts

I'm sure this question has been asked a million times, but how does one load a custom (third party) NPC into a map with GTKRadiant? The only options I see are the default NPCs and the player's character from the game.

Link to comment
/*QUAKED NPC_spawner (1 0 0) (-16 -16 -24) (16 16 40) x x x x DROPTOFLOOR CINEMATIC NOTSOLID STARTINSOLID SHY SAFE

DROPTOFLOOR - NPC can be in air, but will spawn on the closest floor surface below it
CINEMATIC - Will spawn with no default AI (BS_CINEMATIC)
NOTSOLID - Starts not solid
STARTINSOLID - Don't try to fix if spawn in solid
SHY - Spawner is shy
SAFE - Won't spawn if an entity is within 64 units

NPC_type - name of NPC (in npcs.cfg) to spawn in

targetname - name this NPC goes by for targetting
target - NPC will fire this when it spawns it's last NPC (should this be when the last NPC it spawned dies?)
target2 - Fired by stasis spawners when they try to spawn while their spawner model is broken
target3 - Fired by spawner if they try to spawn and are blocked and have a wait < 0 (removes them)

If targeted, will only spawn a NPC when triggered
count - how many NPCs to spawn (only if targetted) default = 1
delay - how long to wait to spawn after used
wait - if trying to spawn and blocked, how many seconds to wait before trying again (default = 0.5, < 0 = never try again and fire target2)

NPC_targetname - NPC's targetname AND script_targetname
NPC_target - NPC's target to fire when killed
NPC_target2 - NPC's target to fire when knocked out
NPC_target4 - NPC's target to fire when killed by friendly fire
NPC_type - type of NPC ("Borg" (default), "Xian", etc)
health - starting health (default = 100)

"noBasicSounds" - set to 1 to prevent loading and usage of basic sounds (pain, death, etc)
"noCombatSounds" - set to 1 to prevent loading and usage of combat sounds (anger, victory, etc.)
"noExtraSounds" - set to 1 to prevent loading and usage of "extra" sounds (chasing the enemy - detecting them, flanking them... also jedi combat sounds)

spawnscript - default script to run once spawned (none by default)
usescript - default script to run when used (none by default)
awakescript - default script to run once awoken (none by default)
angerscript - default script to run once angered (none by default)
painscript - default script to run when hit (none by default)
fleescript - default script to run when hit and below 50% health (none by default)
deathscript - default script to run when killed (none by default)
These strings can be used to activate behaviors instead of scripts - these are checked
first and so no scripts should be names with these names:
default - 0: whatever
idle - 1: Stand around, do abolutely nothing
roam - 2: Roam around, collect stuff
walk - 3: Crouch-Walk toward their goals
run - 4: Run toward their goals
standshoot - 5: Stay in one spot and shoot- duck when neccesary
standguard - 6: Wait around for an enemy
patrol - 7: Follow a path, looking for enemies
huntkill - 8: Track down enemies and kill them
evade - 9: Run from enemies
evadeshoot - 10: Run from enemies, shoot them if they hit you
runshoot - 11: Run to your goal and shoot enemy when possible
defend - 12: Defend an entity or spot?
snipe - 13: Stay hidden, shoot enemy only when have perfect shot and back turned
combat - 14: Attack, evade, use cover, move about, etc. Full combat AI - id NPC code
medic - 15: Go for lowest health buddy, hide and heal him.
takecover - 16: Find nearest cover from enemies
getammo - 17: Go get some ammo
advancefight - 18: Go somewhere and fight along the way
face - 19: turn until facing desired angles
wait - 20: do nothing
formation - 21: Maintain a formation
crouch - 22: Crouch-walk toward their goals

delay - after spawned or triggered, how many seconds to wait to spawn the NPC
*/
In short, place an NPC_Spawner and set its NPC_Type to the name of your NPC.
Cerez and Asgarath83 like this
Link to comment

And here rises a question, which bothers a lot:

 

These strings can be used to activate behaviors instead of scripts - these are checked
first and so no scripts should be names with these names:
default - 0: whatever
idle - 1: Stand around, do abolutely nothing
roam - 2: Roam around, collect stuff
walk - 3: Crouch-Walk toward their goals
run - 4: Run toward their goals
standshoot - 5: Stay in one spot and shoot- duck when neccesary

...

 

I've used NPC_spawners quite often, on most of my maps. But "this one eludes me", as 8T88 said.

What is the command for these strings?

 

For instance, it's clear that use print "health - 300", or "targetname - my_goal_name". 

For func_breakable it is "material - 3".

Link to comment

"Familiar, yes?"

I believe they can be used with the various "spawnscript", "usescript", "awakescript", "angerscript", "attackscript", "victoryscript", "lostenemyscript", "painscript", "fleescript", "delayedscript", "blockedscript", "ffirescript", "ffdeathscript", "mindtrickscript", or perhaps a selection of these. Haven't really tested them, but as the description says, they're used to activate behaviors instead of scripts, that generally are started and executed on NPCs with these strings.

Link to comment

And here rises a question, which bothers a lot:

 

 

I've used NPC_spawners quite often, on most of my maps. But "this one eludes me", as 8T88 said.

What is the command for these strings?

 

For instance, it's clear that use print "health - 300", or "targetname - my_goal_name". 

For func_breakable it is "material - 3".

func breakable:

key material

value : the number you desire of material you want to use for chunks and explosion.

spawnflag NPC_Spawner

Key: spawnflags

value: the number of the behavour you desire, simply spawnflag 1, spawnflag 2, spawnflag 8, etc. :)

Agent Jones and NumberWan like this
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...