path_corner: Documentation improvements, PC_FIREONCE.
This commit is contained in:
parent
2278daf727
commit
004f87dacc
2 changed files with 46 additions and 16 deletions
|
@ -29,6 +29,10 @@ See the entity definition for path_corner to find out more.
|
||||||
Upon level entry, the func_train will spawn right where its first path_corner
|
Upon level entry, the func_train will spawn right where its first path_corner
|
||||||
node is. This is so you can light the func_train somewhere else - like a lonely
|
node is. This is so you can light the func_train somewhere else - like a lonely
|
||||||
box somewhere outside the playable area.
|
box somewhere outside the playable area.
|
||||||
|
|
||||||
|
Marking the func_train with the flag TRAIN_NOTSOLID will make entities not
|
||||||
|
collide with the train. This is best used for things in the distance or for
|
||||||
|
when lasers are following this train as a sort of guide.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define TRAIN_NOTSOLID 8
|
#define TRAIN_NOTSOLID 8
|
||||||
|
|
|
@ -14,12 +14,24 @@
|
||||||
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*QUAKED path_corner (1 0 0) (-8 -8 -8) (8 8 8)
|
/*QUAKED path_corner (1 0 0) (-8 -8 -8) (8 8 8) PC_WAIT PC_TELEPORT PC_FIREONCE
|
||||||
"targetname" Name
|
"targetname" Name
|
||||||
"target" Target when triggered.
|
"target" Next node.
|
||||||
"killtarget" Target to kill when triggered.
|
"message" Target to trigger when a train passes this node.
|
||||||
|
"speed" New speed for passing train.
|
||||||
|
"yaw_speed" New yaw rotation for passing train. Currently unused.
|
||||||
|
"wait" Waiting time until we go to the next node.
|
||||||
|
|
||||||
STUB!
|
Node entities used for func_trains and func_guntargets.
|
||||||
|
|
||||||
|
When the PC_WAIT flag is set, the train will stop moving once it's passed this
|
||||||
|
node. The train will have to be triggered again for it to continue moving.
|
||||||
|
This is useful for elevators.
|
||||||
|
|
||||||
|
When the PC_TELEPORT flag is set, the train passing this node will immediately
|
||||||
|
teleport to the position of the next node (target).
|
||||||
|
|
||||||
|
With the PC_FIREONCE flag set, it'll only fire its target (message) once.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
enumflags {
|
enumflags {
|
||||||
|
@ -30,49 +42,63 @@ enumflags {
|
||||||
|
|
||||||
class path_corner:CBaseTrigger
|
class path_corner:CBaseTrigger
|
||||||
{
|
{
|
||||||
|
int m_iFired;
|
||||||
float m_flSpeed;
|
float m_flSpeed;
|
||||||
float m_flYawSpeed;
|
float m_flYawSpeed;
|
||||||
float m_flWait;
|
float m_flWait;
|
||||||
|
|
||||||
void() path_corner;
|
void() path_corner;
|
||||||
virtual void() Trigger;
|
virtual void() Trigger;
|
||||||
|
virtual void() Respawn;
|
||||||
};
|
};
|
||||||
|
|
||||||
void path_corner::Trigger(void)
|
void path_corner::Trigger(void)
|
||||||
{
|
{
|
||||||
for ( entity eFind = world; ( eFind = find( eFind, CBaseTrigger::m_strTargetName, m_strMessage));) {
|
entity a;
|
||||||
CBaseTrigger trigger = (CBaseTrigger) eFind;
|
|
||||||
trigger.Trigger();
|
if ((spawnflags & PC_FIREONCE) && (m_iFired)) {
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (a = world; (a = find(a, CBaseTrigger::m_strTargetName, m_strMessage));) {
|
||||||
|
CBaseTrigger trigger = (CBaseTrigger)a;
|
||||||
|
trigger.Trigger();
|
||||||
|
m_iFired = TRUE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void path_corner::Respawn(void)
|
||||||
|
{
|
||||||
|
m_iFired = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void path_corner::path_corner(void)
|
void path_corner::path_corner(void)
|
||||||
{
|
{
|
||||||
CBaseTrigger::CBaseTrigger();
|
CBaseTrigger::CBaseTrigger();
|
||||||
|
|
||||||
for ( int i = 1; i < ( tokenize( __fullspawndata ) - 1 ); i += 2 ) {
|
for (int i = 1; i < (tokenize(__fullspawndata) - 1); i += 2) {
|
||||||
switch ( argv( i ) ) {
|
switch (argv(i)) {
|
||||||
case "speed":
|
case "speed":
|
||||||
m_flSpeed = stof(argv( i + 1 ));
|
m_flSpeed = stof(argv(i+1));
|
||||||
break;
|
break;
|
||||||
case "yaw_speed":
|
case "yaw_speed":
|
||||||
m_flYawSpeed = stof(argv(i+1));
|
m_flYawSpeed = stof(argv(i+1));
|
||||||
break;
|
break;
|
||||||
case "wait":
|
case "wait":
|
||||||
m_flWait = stof(argv( i + 1 ));
|
m_flWait = stof(argv(i+1));
|
||||||
break;
|
break;
|
||||||
case "message":
|
case "message":
|
||||||
m_strMessage = argv( i + 1);
|
m_strMessage = argv(i+1);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!m_flSpeed)
|
if (!m_flSpeed) {
|
||||||
m_flSpeed = 100;
|
m_flSpeed = 100;
|
||||||
|
}
|
||||||
if (!m_flWait)
|
if (!m_flWait) {
|
||||||
m_flWait = 1.0f;
|
m_flWait = 1.0f;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue