Skip to content

ATDRL_NPCSpawn

Klian edited this page Apr 14, 2023 · 15 revisions

Parent: AActor


This class is used to place NPCs in the map and trigger their spawn with an ATriggerVolume or ATDRL_SpawnVolume.

Variables

image

  • Spawn Class: ATDRL_Character class to spawn and possess
  • AIController Class: ATDRL_PlayerController class to spawn
  • Spawn Inventory: List of ATDRL_Item in this character's inventory on spawn
  • Spawn in Sight Area: It is spawning in an area where UTDRL_LineOfSightComponent is enabled, therefore will spawn invisible and the rest will be handled by the sight component.

Triggers

image

  • Triggers: ATriggerVolume used to trigger this NPC's spawn
  • Disable Despawn: When the player leaves any of the volumes contained in the Triggers list, a timer will start and at the end of it, the NPC will be despawned, but it will still be able to respawn if the player comes back to its area
  • Despawn Delay: Time to wait before despawning the NPC

Selection buttons

Group and manage ATDRL_NPCSpawn thanks to these selector buttons.

image

AI

image

Patrol

image

  • Patrol Target: Actor to patrol. Can be any actor in the scene, but ATDRL_AISplineTool adds a simple way to manage the patrolling state
  • UseAISplineToolRandomPoints: When using ATDRL_AISplineTool as patrol target, should this AI pick random points on it (true) or follow its natural order (false)?

Stencil

image

  • Stencil Value: Stencil value (uint8) to apply to the skeletal mesh (used with GlobalPostProcess).

Cosmetic

image

  • Meshes: List of meshes to merge
  • Skeleton: Skeleton asset to apply after merging (will use index 0 of Meshes list if null)
  • Physics Asset: Physics Asset to apply after merging (will use index 0 of Meshes list if null)
  • Shadow Physics Asset: Physics Asset for Capsule Shadows to apply after merging (will use index 0 of Meshes list if null)

Custom Properties

image

  • Character Custom Properties: List of custom properties to apply to the spawned character
  • Controller Custom Properties: List of custom properties to apply to the spawned aicontroller

image

Supported types

  • bool
  • int32
  • float
  • byte
  • name
  • string
  • vector3D

Native Blueprint Events

image

NPCSpawned: Fires when the NPC is spawned.

NPCDespawned: Fires when the NPC is despawned but not dead.

NPCDied: Fires when the NPC dies.

Restore function

You can script your game to restore spawn points when their characters have been killed with a simple blueprint node.

image