mirror of
https://github.com/mapbase-source/source-sdk-2013.git
synced 2024-12-25 06:15:30 +03:00
Page:
Base NPC
Pages
Base Animating
Base Combat Character
Base Entity
Base NPC
Base Weapon
Convar Lookup
Debug Commands
Drawing entities in specific view IDs
Entity List
Enum Reference
Filters
Frequently Asked Questions (FAQ)
Gameplay Changes
Graphical Changes
Home
How Mapbase can be used in specific settings
I O System Changes
Introduction to Mapbase
List of Modified Source Files
Map Compilers
Map Specific Scripts
Mapbase Credits
Mapbase Disclaimers
Mapbase Multi Tool
Mapbase Setup Troubleshooting
Media Resources
Modding with Mapbase
Prefabs and workarounds obsoleted by Mapbase
Projected textures
RPC Integration (Discord, etc.)
Reviewing Mapbase pull requests
Setting up Mapbase
Shader Changes
Skyboxes
Using Git with Mapbase
Using Mapbase Content
Using VScript as a HL2 mapper
VScript Basic Entity Code Tutorial
VScript Basic IO Tutorial
VScript Filters
VScript VScriptProxy
VScript in Mapbase
Wildcards and Matchers
math_lightpattern
4
Base NPC
Blixibon edited this page 2019-11-28 18:53:49 -06:00
This page lists changes to CAI_BaseNPC
, which every NPC derives from. This means every NPC in the game technically possesses these changes, although some changes might only be relevant to a specific group of them.
There are also Base Combat Character changes, which apply to both NPCs and players.
Some I/O were ported from other games or were already possible through other, more complicated means (e.g. keyvalues changed with AddOutput).
Inputs
- SetHealthFraction
<float>
- Sets a NPC's health as a ratio in between 0 and 1. This input already existed on npc_helicopter, but it was expanded to be used on any NPC.
- GiveWeaponHolstered
<string>
- Gives a NPC the specified weapon, but make it start holstered (meaning the NPC has to get it out on their own). - ChangeWeapon
<string>
- Holsters a NPC's current weapon, and then unholsters the specified weapon. - PickupWeapon
<string>
- Makes a NPC look for and pick up the specified weapon, which should be an entity in the world. - PickupItem
<string>
- Makes a NPC look for and pick up the specified item, like a health vial or even a frag grenade.
Additional weapon inputs exist on Base Combat Character.
- SetFriendlyFire
<integer>
- Overrides how the game should treat friendly fire towards a specific NPC. 0 = No friendly fire, 1 = Friendly fire, 2 = Use NPC settings/no override - SetDynamicInteractions
<integer>
- Sets a NPC's ability to use dynamic interactions. 0 = No interactions allowed, 1 = All interactions allowed, 2 = Non-Mapbase interactions only
- AddCapabilities
<flags>
- Adds the specifiedCapability_t
capabilities to a NPC. See (Enum-Reference)[Enum Reference] for more info. - RemoveCapabilities
<flags>
- Removes the specifiedCapability_t
capabilities to a NPC. See (Enum-Reference)[Enum Reference] for more info.
- SetCondition
<integer>
- Adds the specified condition to a NPC. - RemoveCondition
<integer>
- Removes the specified condition from a NPC.
- SetHintGroup
<string>
- Sets a NPC's hint group.
- SetThinkNPC
<float>
- Sets an entity's general think function toCallNPCThink
. A float can be passed to delay this by a specific time.
Outputs
- OnStateChange
<integer>
- Fires whenever a NPC changes state, passing the NPC's new state.
- OnItemPickup
<ehandle>
- Fires when a NPC picks up an item (e.g. a health vial), passing the item entity.
- OnHolsterWeapon
<ehandle>
- Fires when a NPC holsters their current weapon, passing the weapon entity. - OnUnholsterWeapon
<ehandle>
- Fires when a NPC unholsters their current weapon, passing the weapon entity.
KeyValues
- Friendly fire override
<integer>
- Overrides how the game should treat friendly fire towards a specific NPC. 0 = No friendly fire, 1 = Friendly fire, 2 = Use NPC settings/no override - Dynamic interactions enabled
<integer>
- Sets a NPC's ability to use dynamic interactions. 0 = No interactions allowed, 1 = All interactions allowed, 2 = Non-Mapbase interactions only - Spawn with StartScripting
<bool>
- Spawns a NPC in the StartScripting state.
- Something Index
- Something special
- Something else