WiseNodeLink: Navigating Obstacles
This tutorial was originally created by wisemx.
In this project:
- Alyx faces a body of water, has nowhere to go.
- Bridge lowers over water, Alyx can walk across but it’s blocked by a large crate.
- Alyx walks across and pushes crate out of the way.
The entities in this project can be used in a variety of ways. I created this as a general example. Instead of a bridge the obstacle could be a gate, etc. Instead of a crate the obstacle could be a turnstyle, etc. (
I’m using two
scripted_sequence entities to get Alyx to walk. Notice the Move to Position property for both is Walk. Try not to place these too high above the ground where the NPC is walking. Raising them up will cause your NPC to jump as they transition. On the ground where Alyx will be walking I’ve placed
info_node entities. Place these in good locations, don’t burry them in brushwork or displacements. To connect the nodes across the bridge I’ve used an
info_node_link entity. This is a dynamic connection between navigation nodes. These can be turned on and off. In this example it starts Off and we turn it On when the bridge lowers. The crate obstacle in this project is
prop_physics. It uses the World Model
To get Alyx to push the crate out of the way I’m using a
logic_navigation entity. You can use several of these in a map and they are very simple to place. The only property you have to assign is the Navigation Entity, which is the entity you want the NPC to push out of the way. Check the flags for Start on.
When the map starts I’m using a
logic_auto to control all of the actions at once.
|My Output||Target Entity||Target Input||Parameter||Delay||Only Once|
In the 4 outputs above:
- The bridge,
func_rot_button, rises when the map starts.
- Seven seconds later the bridge lowers.
- Next the
info_node_linkis turned on.
- Finally the first
scripted_sequenceis called and Alyx begins her walk.
- As she gets to the crate she will push it out of the way to get to that
- Once she reaches the first
scripted_sequenceit will call the next, and last,
scripted_sequenceand Alyx will walk to it.
As you can see in a matter of minutes you can create methods for your NPCs that will allow them to overcome obstacles. If only it was that easy for us out here in the real world.