NPC.AddRelationship

From GMod Wiki

Revision as of 19:30, 27 November 2011 by Henry (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Mess.pngThis page has been deemed a mess. It may contain unnecessary information or be poorly organized. You can discuss changes on this article's talk page.
Function
Syntax NPC:AddRelationship( String relationstring )
Description:
Changes how an NPC feels towards another NPC.
Returns: nil
In Object: Npc
Realm: NewerServer.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=NPC.AddRelationship]NPC.AddRelationship [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Examples

DescriptionMake our NPC fear turrets.
Used onNewerServer.png
Code
 
function makeNPCFearTurrets(NPC)
    NPC:AddRelationship("npc_turret_floor D_FR 99")
end
 
OutputThe NPC will fear turrets.


DescriptionMake our NPC hate players.
Used onNewerServer.png
Code
 
function makeNPCHatePlayers(NPC)
    NPC:AddRelationship("player D_HT 999")
end
 
OutputThe NPC will hate and attack players.


Additional Notes

An NPC's disposition is the way it feels about another entity.

A list of disposition enumerations from the file:

 
D_ER	=	0		// Undefined - error
D_HT	=	1		// Hate
D_FR	=	2		// Fear
D_LI	=	3		// Like
D_NU	=	4		// Neutral
 

See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox