I need smoke to go after the player.
Quote from Samot on August 8, 2018, 6:03 pmI'm creating a Portal 2 level where I'm using env_smokestack to simulate a ghost. I'm using a func_tanktrain to make it move during the story. There is one point in the story where I need the ghost to chase down and kill the player (this happens if the player purposefully does something stupid that stops the story from progressing.) My first instincts on accomplishing this was to turn an invisible brush into an NPC, and have the env_smokestack parented to it. Unfortunately, I cannot find any instructions on creating a custom npc character. If anyone knows of a video or written instructions on how to do this, or if there is an easier way to accomplish this, I'd appreciate the info. Thanks.
I'm creating a Portal 2 level where I'm using env_smokestack to simulate a ghost. I'm using a func_tanktrain to make it move during the story. There is one point in the story where I need the ghost to chase down and kill the player (this happens if the player purposefully does something stupid that stops the story from progressing.) My first instincts on accomplishing this was to turn an invisible brush into an NPC, and have the env_smokestack parented to it. Unfortunately, I cannot find any instructions on creating a custom npc character. If anyone knows of a video or written instructions on how to do this, or if there is an easier way to accomplish this, I'd appreciate the info. Thanks.
Quote from Kwinten on August 12, 2018, 2:42 pmyou can use "EnableAlternatePath" of your path_tracks when the "player does something stupid"
There is no other alternative to create Npc than using path_tracks for the moment
(i have a big project involving scripts to create an AI in p2 )
you can use "EnableAlternatePath" of your path_tracks when the "player does something stupid"
There is no other alternative to create Npc than using path_tracks for the moment
(i have a big project involving scripts to create an AI in p2 )
Quote from ChickenMobile on August 30, 2018, 8:23 pmpath_tracks are a point entity right? They could be parented to the player
path_tracks are a point entity right? They could be parented to the player
Quote from GusHan on January 5, 2019, 6:42 amDid you manage to get this effect, Samot? Seems like a cool idea. I'd love to know how to do this.
Did you manage to get this effect, Samot? Seems like a cool idea. I'd love to know how to do this.
Quote from ChickenMobile on January 6, 2019, 3:24 amIt is possible to implement this idea using a vscript.
You can change the position and rotation of the ghost by working out the vector between itself and the player then moving it 'x' distance. This is called Linear Interpolation (google lerp function). Because it is a 'ghost' you don't need to figure out any pathing logic - though could still be done using functions like TraceLine(Vector, Vector, handle).
Below is code that would make an object follow the player at 10 units per/s. I used a dynamic model with the think function of think for testing.
- Code: Select all
// Speed of movement of the thing
x <- 10// Set the direction of this entity to face the player
function think() {
local p = player.GetOrigin()
local s = self.GetOrigin()
local d = p - s // The difference between this angles and the players
self.SetForwardVector(d) // Set the angles of the object to face the placer
self.SetOrigin(self.GetForwardVector() * x + s) // Move x units forward from original vector
}See https://developer.valvesoftware.com/wik ... _Functions for a full list of Portal 2 scripting functions.
It is possible to implement this idea using a vscript.
You can change the position and rotation of the ghost by working out the vector between itself and the player then moving it 'x' distance. This is called Linear Interpolation (google lerp function). Because it is a 'ghost' you don't need to figure out any pathing logic - though could still be done using functions like TraceLine(Vector, Vector, handle).
Below is code that would make an object follow the player at 10 units per/s. I used a dynamic model with the think function of think for testing.
- Code: Select all
// Speed of movement of the thing
x <- 10// Set the direction of this entity to face the player
function think() {
local p = player.GetOrigin()
local s = self.GetOrigin()
local d = p - s // The difference between this angles and the players
self.SetForwardVector(d) // Set the angles of the object to face the placer
self.SetOrigin(self.GetForwardVector() * x + s) // Move x units forward from original vector
}
See https://developer.valvesoftware.com/wik ... _Functions for a full list of Portal 2 scripting functions.