WiseNPC03: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(Created page with "{{DISPLAYTITLE:WiseNPC03: NPC Act busy with Sequence}} {{wisemxport|~~~~}} In this tutorial we are going to transition from a {{ent|scripted_sequence}} directly into an {{ent...")
 
mNo edit summary
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
{{DISPLAYTITLE:WiseNPC03: NPC Act busy with Sequence}}
{{DISPLAYTITLE:WiseNPC03: NPC Act busy with Sequence}}
{{SDKNuts Tutorials}}
{{wisemxport|[[User:Pinsplash|Pinsplash]] ([[User talk:Pinsplash|talk]]) 05:16, 21 July 2018 (UTC)}}
{{wisemxport|[[User:Pinsplash|Pinsplash]] ([[User talk:Pinsplash|talk]]) 05:16, 21 July 2018 (UTC)}}


Line 34: Line 35:
When Alyx gets to the last <code>scripted_sequence</code> this Output is fired:
When Alyx gets to the last <code>scripted_sequence</code> this Output is fired:
{| {{OutputsTable}}
{| {{OutputsTable}}
| [[Image:Io11.png]] || OnEndSequence|| actbusy|| ForceThisNPCToActBusy|| walking|| 0.00 || No
| [[File:Io11.png]] || OnEndSequence|| actbusy|| ForceThisNPCToActBusy|| walking|| 0.00 || No
|}
|}


Line 45: Line 46:
These are the two Outputs that make it work:
These are the two Outputs that make it work:
{| {{OutputsTable}}
{| {{OutputsTable}}
| [[Image:Io11.png]] || OnEndSequence|| combiness02|| BeginSequence||  || 0.00 || No
| [[File:Io11.png]] || OnEndSequence|| combiness02|| BeginSequence||  || 0.00 || No
|-
|-
| [[Image:Io11.png]] || OnEndSequence|| combiness01|| BeginSequence|| &nbsp; || 0.00 || No
| [[File:Io11.png]] || OnEndSequence|| combiness01|| BeginSequence|| &nbsp; || 0.00 || No
|}
|}


On map spawn our {{ent|logic_auto}} adds this Output to start the Soldier pacing:
On map spawn our {{ent|logic_auto}} adds this Output to start the Soldier pacing:
{| {{OutputsTable}}
{| {{OutputsTable}}
| [[Image:Io11.png]] || OnMapSpawn|| combiness01|| BeginSequence||  || 0.00 || No
| [[File:Io11.png]] || OnMapSpawn|| combiness01|| BeginSequence||  || 0.00 || No
|}
|}


This project was simple to create but has a lot going on now. Compile it and have a look.
This project was simple to create but has a lot going on now. Compile it and have a look.


==See Also==
==See also==
*[http://type3studios.com/downloads/tutorials/SdkNutsTutorials/wiseNPC03.zip Example VMF]
*[http://type3studios.com/downloads/tutorials/SdkNutsTutorials/wiseNPC03.zip Example VMF]
*[https://cdn.discordapp.com/attachments/434089157875466242/463979627887591425/wiseNPC03.vmf Example VMF backup]
*[https://cdn.discordapp.com/attachments/434089157875466242/463979627887591425/wiseNPC03.vmf Example VMF backup]

Latest revision as of 07:26, 15 April 2024


This tutorial was originally created by wisemx. It was originally posted on SDKnuts.net.

In this tutorial we are going to transition from a scripted_sequence directly into an ai_goal_actbusy. This project is an extension of WiseNPC01. I started with that vmf and added the ai_goal_actbusy, which will cause Alyx to kneel down. I used info_node entities in this one rather than the more advanced info_node_hint entities so the one info_node_hint in this tutorial will stand out. Both of these are nodes for ground based NPC’s and serve the same basic purpose however info_node_hint has many more features.

There are two series of sequences going on in this project:

  1. A sound is heard, Alyx runs across the screen, walks back then kneels down in front of a grave.
  2. A Nova Prospect soldier is pacing back-and-forth behind the grave.

I added an ai_relationship so Alyx and the Combine Soldier won’t fight.

  • Subject: combine01 (Name of the Combine Soldier)
  • Target: walking (Name of Alyx in this project)
  • Disposition: Neutral
  • Disposition Priority: 100
  • Start Active: Yes
  • Reciprocal: Yes

So we can get Alyx to kneel an ai_goal_actbusy entity was added.

  • Name: actbusy
  • Actor to affect: walking
  • Start Active: Yes
  • Search Type: Entity Name
  • Search range: 1200
  • Visible Busy Hints Only: No

One info_node_hint was placed under the last scripted_sequence.

  • Name: kneelhint
  • Hint: World: Act Busy Hint
  • Hint Activity: D1_C01a_Mary_kneel
  • Node FOV: 360 Degrees
  • Start Hint Disabled: No
  • Ignore Facing: Yes

When Alyx gets to the last scripted_sequence this Output is fired:

  My Output Target Entity Target Input Parameter Delay Only Once
Io11.png OnEndSequence actbusy ForceThisNPCToActBusy walking 0.00 No

The npc_combine_s pacing back-and-forth is done with two scripted_sequences. These Flags are checked on each of them: Repeatable, No Interruptions, Override AI.

The Target NPC for each of these is our npc_combine_s combine01.

Move to Position is Walk for both.

These are the two Outputs that make it work:

  My Output Target Entity Target Input Parameter Delay Only Once
Io11.png OnEndSequence combiness02 BeginSequence 0.00 No
Io11.png OnEndSequence combiness01 BeginSequence   0.00 No

On map spawn our logic_auto adds this Output to start the Soldier pacing:

  My Output Target Entity Target Input Parameter Delay Only Once
Io11.png OnMapSpawn combiness01 BeginSequence 0.00 No

This project was simple to create but has a lot going on now. Compile it and have a look.

See also