Compare commits
6 Commits
a9b6f9a428
...
d9d579478a
Author | SHA1 | Date |
---|---|---|
Marco Cawthorne | d9d579478a | |
Marco Cawthorne | 3a1a5d66f5 | |
Marco Cawthorne | 09839aa198 | |
Marco Cawthorne | efe079bdf7 | |
Marco Cawthorne | f11a10d343 | |
Marco Cawthorne | a3268ef65b |
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
diffusemap textures/editor/ambient_generic.tga
|
||||
|
||||
{
|
||||
map $diffuse
|
||||
alphaFunc GE128
|
||||
}
|
||||
}
|
Binary file not shown.
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
diffusemap textures/editor/env_cubemap.tga
|
||||
|
||||
{
|
||||
map $diffuse
|
||||
alphaFunc GE128
|
||||
}
|
||||
}
|
Binary file not shown.
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
diffusemap textures/editor/env_explosion.tga
|
||||
|
||||
{
|
||||
map $diffuse
|
||||
alphaFunc GE128
|
||||
}
|
||||
}
|
Binary file not shown.
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
diffusemap textures/editor/env_global.tga
|
||||
|
||||
{
|
||||
map $diffuse
|
||||
alphaFunc GE128
|
||||
}
|
||||
}
|
Binary file not shown.
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
diffusemap textures/editor/env_shake.tga
|
||||
|
||||
{
|
||||
map $diffuse
|
||||
alphaFunc GE128
|
||||
}
|
||||
}
|
Binary file not shown.
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
diffusemap textures/editor/game_counter.tga
|
||||
|
||||
{
|
||||
map $diffuse
|
||||
alphaFunc GE128
|
||||
}
|
||||
}
|
Binary file not shown.
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
diffusemap textures/editor/info_intermission.tga
|
||||
|
||||
{
|
||||
map $diffuse
|
||||
alphaFunc GE128
|
||||
}
|
||||
}
|
Binary file not shown.
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
diffusemap textures/editor/info_landmark.tga
|
||||
|
||||
{
|
||||
map $diffuse
|
||||
alphaFunc GE128
|
||||
}
|
||||
}
|
Binary file not shown.
|
@ -3,6 +3,6 @@
|
|||
|
||||
{
|
||||
map $diffuse
|
||||
blendFunc blend
|
||||
alphaFunc GE128
|
||||
}
|
||||
}
|
||||
|
|
Binary file not shown.
|
@ -3,6 +3,6 @@
|
|||
|
||||
{
|
||||
map $diffuse
|
||||
blendFunc blend
|
||||
alphaFunc GE128
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
diffusemap textures/editor/info_notnull.tga
|
||||
|
||||
{
|
||||
map $diffuse
|
||||
alphaFunc GE128
|
||||
}
|
||||
}
|
Binary file not shown.
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
diffusemap textures/editor/info_null.tga
|
||||
|
||||
{
|
||||
map $diffuse
|
||||
alphaFunc GE128
|
||||
}
|
||||
}
|
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
diffusemap textures/editor/info_player_deathmatch.tga
|
||||
|
||||
{
|
||||
map $diffuse
|
||||
alphaFunc GE128
|
||||
}
|
||||
}
|
Binary file not shown.
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
diffusemap textures/editor/info_player_spectator.tga
|
||||
|
||||
{
|
||||
map $diffuse
|
||||
alphaFunc GE128
|
||||
}
|
||||
}
|
Binary file not shown.
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
diffusemap textures/editor/info_player_start.tga
|
||||
|
||||
{
|
||||
map $diffuse
|
||||
alphaFunc GE128
|
||||
}
|
||||
}
|
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
diffusemap textures/editor/info_target.tga
|
||||
|
||||
{
|
||||
map $diffuse
|
||||
alphaFunc GE128
|
||||
}
|
||||
}
|
Binary file not shown.
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
diffusemap textures/editor/light.tga
|
||||
|
||||
{
|
||||
map $diffuse
|
||||
rgbGen vertex
|
||||
alphaFunc GE128
|
||||
}
|
||||
}
|
Binary file not shown.
|
@ -3,7 +3,7 @@
|
|||
|
||||
{
|
||||
map $diffuse
|
||||
blendFunc blend
|
||||
alphaFunc GE128
|
||||
rgbGen vertex
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
diffusemap textures/editor/light.tga
|
||||
|
||||
{
|
||||
map $diffuse
|
||||
rgbGen vertex
|
||||
alphaFunc GE128
|
||||
}
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
diffusemap textures/editor/light.tga
|
||||
|
||||
{
|
||||
map $diffuse
|
||||
rgbGen vertex
|
||||
alphaFunc GE128
|
||||
}
|
||||
}
|
|
@ -3,6 +3,6 @@
|
|||
|
||||
{
|
||||
map $diffuse
|
||||
blendFunc blend
|
||||
alphaFunc GE128
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
diffusemap textures/editor/multi_manager.tga
|
||||
|
||||
{
|
||||
map $diffuse
|
||||
alphaFunc GE128
|
||||
}
|
||||
}
|
Binary file not shown.
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
diffusemap textures/editor/multisource.tga
|
||||
|
||||
{
|
||||
map $diffuse
|
||||
alphaFunc GE128
|
||||
}
|
||||
}
|
Binary file not shown.
|
@ -3,6 +3,6 @@
|
|||
|
||||
{
|
||||
map $diffuse
|
||||
blendFunc blend
|
||||
alphaFunc GE128
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
diffusemap textures/editor/point_message.tga
|
||||
|
||||
{
|
||||
map $diffuse
|
||||
alphaFunc GE128
|
||||
}
|
||||
}
|
Binary file not shown.
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
diffusemap textures/editor/prop_door_rotating.tga
|
||||
|
||||
{
|
||||
map $diffuse
|
||||
alphaFunc GE128
|
||||
}
|
||||
}
|
Binary file not shown.
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
diffusemap textures/editor/scripted_sentence.tga
|
||||
|
||||
{
|
||||
map $diffuse
|
||||
alphaFunc GE128
|
||||
}
|
||||
}
|
Binary file not shown.
|
@ -3,6 +3,6 @@
|
|||
|
||||
{
|
||||
map $diffuse
|
||||
blendFunc blend
|
||||
alphaFunc GE128
|
||||
}
|
||||
}
|
||||
|
|
Binary file not shown.
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
diffusemap textures/editor/trigger_auto.tga
|
||||
|
||||
{
|
||||
map $diffuse
|
||||
alphaFunc GE128
|
||||
}
|
||||
}
|
Binary file not shown.
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
diffusemap textures/editor/trigger_changetarget.tga
|
||||
|
||||
{
|
||||
map $diffuse
|
||||
alphaFunc GE128
|
||||
}
|
||||
}
|
Binary file not shown.
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
diffusemap textures/editor/trigger_relay.tga
|
||||
|
||||
{
|
||||
map $diffuse
|
||||
alphaFunc GE128
|
||||
}
|
||||
}
|
Binary file not shown.
|
@ -46,6 +46,8 @@ public:
|
|||
virtual void SpawnKey(string,string);
|
||||
virtual void Trigger(entity, triggermode_t);
|
||||
|
||||
virtual void OnRemoveEntity(void);
|
||||
|
||||
private:
|
||||
float m_flRadius;
|
||||
float m_flAmplitude;
|
||||
|
@ -62,6 +64,19 @@ env_shake::env_shake(void)
|
|||
m_flFrequency = 0.0f;
|
||||
}
|
||||
|
||||
void
|
||||
env_shake::OnRemoveEntity(void)
|
||||
{
|
||||
if (HasSpawnFlags(1)) {
|
||||
WriteByte(MSG_MULTICAST, SVC_CGAMEPACKET);
|
||||
WriteByte(MSG_MULTICAST, EV_SHAKE);
|
||||
WriteFloat(MSG_MULTICAST, 1.0);
|
||||
WriteFloat(MSG_MULTICAST, m_flAmplitude);
|
||||
WriteFloat(MSG_MULTICAST, m_flFrequency);
|
||||
multicast([0,0,0], MULTICAST_ALL_R);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
env_shake::Save(float handle)
|
||||
{
|
||||
|
@ -117,5 +132,14 @@ env_shake::SpawnKey(string strKey, string strValue)
|
|||
void
|
||||
env_shake::Trigger(entity act, triggermode_t state)
|
||||
{
|
||||
Client_ShakeOnce(origin, m_flRadius, m_flDuration, m_flFrequency, m_flAmplitude);
|
||||
if (HasSpawnFlags(1)) {
|
||||
WriteByte(MSG_MULTICAST, SVC_CGAMEPACKET);
|
||||
WriteByte(MSG_MULTICAST, EV_SHAKE);
|
||||
WriteFloat(MSG_MULTICAST, m_flDuration);
|
||||
WriteFloat(MSG_MULTICAST, m_flAmplitude);
|
||||
WriteFloat(MSG_MULTICAST, m_flFrequency);
|
||||
multicast([0,0,0], MULTICAST_ALL_R);
|
||||
} else {
|
||||
Client_ShakeOnce(origin, m_flRadius, m_flDuration, m_flFrequency, m_flAmplitude);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -186,7 +186,7 @@ func_plat::MoverFinishesMoving(void)
|
|||
{
|
||||
/* cancel out any moving sfx */
|
||||
if (m_strSndMove) {
|
||||
StartSound("common/null.wav", CHAN_VOICE, 0, true);
|
||||
StopSound(CHAN_VOICE, true);
|
||||
}
|
||||
|
||||
if (m_strSndStop) {
|
||||
|
|
|
@ -146,7 +146,6 @@ private:
|
|||
int m_iOldInputDirection;
|
||||
int m_iInputLevel;
|
||||
int m_iOldInputLevel;
|
||||
float m_flStartSpeed;
|
||||
NSTimer m_timerAngled;
|
||||
float m_flTrainLength;
|
||||
bool _m_bDriving;
|
||||
|
@ -169,10 +168,17 @@ func_tracktrain::func_tracktrain(void)
|
|||
m_flDamage = 0.0f;
|
||||
m_flHeight = 0.0f;
|
||||
m_flStartSpeed = 0.0f;
|
||||
m_flCurrentSpeed = 0.0f;
|
||||
m_flBank = 0.0f;
|
||||
m_strMoveSnd = __NULL__;
|
||||
m_strStopSnd = __NULL__;
|
||||
m_flStartSpeed = 0.0f;
|
||||
m_vecRelationTarget = g_vec_null;
|
||||
m_flUseTime = 0.0f;
|
||||
m_iInputDirection = 0i;
|
||||
m_iOldInputDirection = 0i;
|
||||
m_iInputLevel = 0i;
|
||||
m_iOldInputLevel = 0i;
|
||||
m_timerAngled = __NULL__;
|
||||
m_flTrainLength = 0.0f;
|
||||
_m_bDriving = false;
|
||||
#endif
|
||||
|
@ -378,8 +384,17 @@ func_tracktrain::Save(float handle)
|
|||
SaveFloat(handle, "m_flDamage", m_flDamage);
|
||||
SaveFloat(handle, "m_flHeight", m_flHeight);
|
||||
SaveFloat(handle, "m_flStartSpeed", m_flStartSpeed);
|
||||
SaveFloat(handle, "m_flCurrentSpeed", m_flCurrentSpeed);
|
||||
SaveFloat(handle, "m_flBank", m_flBank);
|
||||
SaveString(handle, "m_strMoveSnd", m_strMoveSnd);
|
||||
SaveString(handle, "m_strStopSnd", m_strStopSnd);
|
||||
SaveFloat(handle, "m_flUseTime", m_flUseTime);
|
||||
SaveInt(handle, "m_iInputDirection", m_iInputDirection);
|
||||
SaveInt(handle, "m_iOldInputDirection", m_iOldInputDirection);
|
||||
SaveInt(handle, "m_iInputLevel", m_iInputLevel);
|
||||
SaveEntity(handle, "m_timerAngled", m_timerAngled);
|
||||
SaveFloat(handle, "m_flTrainLength", m_flTrainLength);
|
||||
SaveBool(handle, "_m_bDriving", _m_bDriving);
|
||||
|
||||
/* if we are on a track, take the difference in offset so we can smoothly transition */
|
||||
if (target) {
|
||||
|
@ -411,12 +426,39 @@ func_tracktrain::Restore(string strKey, string strValue)
|
|||
case "m_flStartSpeed":
|
||||
m_flStartSpeed = ReadFloat(strValue);
|
||||
break;
|
||||
case "m_flCurrentSpeed":
|
||||
m_flCurrentSpeed = ReadFloat(strValue);
|
||||
break;
|
||||
case "m_flBank":
|
||||
m_flBank = ReadFloat(strValue);
|
||||
break;
|
||||
case "m_strMoveSnd":
|
||||
m_strMoveSnd = ReadString(strValue);
|
||||
break;
|
||||
case "m_strStopSnd":
|
||||
m_strStopSnd = ReadString(strValue);
|
||||
break;
|
||||
case "m_flUseTime":
|
||||
m_flUseTime = ReadFloat(strValue);
|
||||
break;
|
||||
case "m_iInputDirection":
|
||||
m_iInputDirection = ReadInt(strValue);
|
||||
break;
|
||||
case "m_iOldInputDirection":
|
||||
m_iOldInputDirection = ReadInt(strValue);
|
||||
break;
|
||||
case "m_iInputLevel":
|
||||
m_iInputLevel = ReadInt(strValue);
|
||||
break;
|
||||
case "m_timerAngled":
|
||||
m_timerAngled = (NSTimer)ReadEntity(strValue);
|
||||
break;
|
||||
case "m_flTrainLength":
|
||||
m_flTrainLength = ReadFloat(strValue);
|
||||
break;
|
||||
case "_m_bDriving":
|
||||
_m_bDriving = ReadBool(strValue);
|
||||
break;
|
||||
case "m_vecRelationTarget":
|
||||
m_vecRelationTarget = ReadVector(strValue);
|
||||
break;
|
||||
|
@ -535,7 +577,7 @@ void
|
|||
func_tracktrain::_SoundMove(void)
|
||||
{
|
||||
if (m_strMoveSnd) {
|
||||
Sound_Play(this, CHAN_VOICE, m_strMoveSnd);
|
||||
StartSoundDef(m_strMoveSnd, CHAN_VOICE, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -543,14 +585,14 @@ void
|
|||
func_tracktrain::_SoundStop(void)
|
||||
{
|
||||
if (m_strStopSnd) {
|
||||
Sound_Play(this, CHAN_BODY, m_strStopSnd);
|
||||
StartSoundDef(m_strStopSnd, CHAN_BODY, true);
|
||||
}
|
||||
|
||||
if (m_strMoveSnd) {
|
||||
if (!m_strStopSnd) {
|
||||
Sound_Play(this, CHAN_BODY, "func_tracktrain.stop_1");
|
||||
StartSoundDef("func_tracktrain.stop_1", CHAN_BODY, true);
|
||||
}
|
||||
sound(this, CHAN_VOICE, "common/null.wav", 1.0, ATTN_NORM);
|
||||
StopSound(CHAN_VOICE, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -597,7 +639,10 @@ func_tracktrain::PathMoveForward(void)
|
|||
|
||||
NSVehicle_Log("^1func_tracktrain::^3PathMoveForward^7: Changing velocity from '%v' to '%v'", GetVelocity(), vecVelocity);
|
||||
SetVelocity(vecVelocity * (1 / flTravelTime));
|
||||
_SoundMove();
|
||||
|
||||
if (_m_bDriving == false) {
|
||||
_SoundMove();
|
||||
}
|
||||
|
||||
/* the direction we're aiming for */
|
||||
vecDiff = GetOrigin() - (eNode.GetOrigin() + [0, 0, m_flHeight]);
|
||||
|
@ -788,6 +833,7 @@ func_tracktrain::_PathArrivedForward(void)
|
|||
/* first clear velocity, in case our trigger targets our train */
|
||||
PathClear();
|
||||
eNode.PathEndTrigger(this, TRIG_TOGGLE);
|
||||
return;
|
||||
}
|
||||
|
||||
/* warp */
|
||||
|
@ -880,6 +926,7 @@ func_tracktrain::Trigger(entity act, triggermode_t state)
|
|||
break;
|
||||
case TRIG_OFF:
|
||||
PathClear();
|
||||
break;
|
||||
case TRIG_TOGGLE:
|
||||
default:
|
||||
if (_m_bDriving == false)
|
||||
|
|
|
@ -102,6 +102,7 @@ func_train::Save(float handle)
|
|||
SaveFloat(handle, "m_flWait", m_flWait);
|
||||
SaveFloat(handle, "m_flSpeed", m_flSpeed);
|
||||
SaveFloat(handle, "m_flDamage", m_flDamage);
|
||||
SaveFloat(handle, "m_flCurrentSpeed", m_flCurrentSpeed);
|
||||
SaveString(handle, "m_strMoveSnd", m_strMoveSnd);
|
||||
SaveString(handle, "m_strStopSnd", m_strStopSnd);
|
||||
}
|
||||
|
@ -119,6 +120,9 @@ func_train::Restore(string strKey, string strValue)
|
|||
case "m_flDamage":
|
||||
m_flDamage = ReadFloat(strValue);
|
||||
break;
|
||||
case "m_flCurrentSpeed":
|
||||
m_flCurrentSpeed = ReadFloat(strValue);
|
||||
break;
|
||||
case "m_strMoveSnd":
|
||||
m_strMoveSnd = ReadString(strValue);
|
||||
break;
|
||||
|
|
|
@ -43,6 +43,8 @@ info_node::info_node(void)
|
|||
void
|
||||
info_node::Respawn(void)
|
||||
{
|
||||
InitPointTrigger();
|
||||
|
||||
SetSize([0,0,0], [0,0,0]);
|
||||
SetSolid(SOLID_NOT);
|
||||
SetMovetype(MOVETYPE_NONE);
|
||||
|
|
|
@ -79,6 +79,7 @@ public:
|
|||
virtual void Respawn(void);
|
||||
virtual void RestoreComplete(void);
|
||||
virtual void Trigger(entity, triggermode_t);
|
||||
virtual void DebugDraw(void);
|
||||
|
||||
private:
|
||||
int m_iEnabled;
|
||||
|
@ -86,6 +87,8 @@ private:
|
|||
float m_flStyle;
|
||||
float m_flSwitchStyle;
|
||||
string m_strPattern;
|
||||
|
||||
vector _lightColor;
|
||||
};
|
||||
|
||||
void
|
||||
|
@ -96,6 +99,7 @@ light::light(void)
|
|||
m_strPattern = "m";
|
||||
m_flStyle = 0;
|
||||
m_flSwitchStyle = 0;
|
||||
_lightColor = [1,1,1];
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -168,8 +172,6 @@ light::SpawnKey(string strKey, string strValue)
|
|||
case "_cone":
|
||||
case "_cone2":
|
||||
case "_sky":
|
||||
case "_light":
|
||||
break;
|
||||
/* mostly for light_environment */
|
||||
case "pitch":
|
||||
angles[0] = ReadFloat(strValue);
|
||||
|
@ -177,6 +179,13 @@ light::SpawnKey(string strKey, string strValue)
|
|||
case "sunangle":
|
||||
angles[1] = ReadFloat(strValue);
|
||||
break;
|
||||
case "color":
|
||||
_lightColor = ReadVector(strValue);
|
||||
break;
|
||||
case "_light":
|
||||
case "color255":
|
||||
_lightColor = ReadVector(strValue) / 255;
|
||||
break;
|
||||
default:
|
||||
super::SpawnKey(strKey, strValue);
|
||||
}
|
||||
|
@ -243,6 +252,19 @@ light::Trigger(entity act, triggermode_t state)
|
|||
RestoreComplete();
|
||||
}
|
||||
|
||||
void
|
||||
light::DebugDraw(void)
|
||||
{
|
||||
#ifdef SERVER
|
||||
R_BeginPolygon(m_strDebugTexture, 0, 0);
|
||||
R_PolygonVertex(GetOrigin() + v_right * 16 - v_up * 16, [1,1], _lightColor, 1.0f);
|
||||
R_PolygonVertex(GetOrigin() - v_right * 16 - v_up * 16, [0,1], _lightColor, 1.0f);
|
||||
R_PolygonVertex(GetOrigin() - v_right * 16 + v_up * 16, [0,0], _lightColor, 1.0f);
|
||||
R_PolygonVertex(GetOrigin() + v_right * 16 + v_up * 16, [1,0], _lightColor, 1.0f);
|
||||
R_EndPolygon();
|
||||
#endif
|
||||
}
|
||||
|
||||
CLASSEXPORT(light_spot, light)
|
||||
|
||||
class
|
||||
|
|
|
@ -149,6 +149,8 @@ monstermaker::SpawnKey(string strKey, string strValue)
|
|||
void
|
||||
monstermaker::Respawn(void)
|
||||
{
|
||||
InitPointTrigger();
|
||||
|
||||
if (HasSpawnFlags(MMF_STARTON)) {
|
||||
TurnOn();
|
||||
} else {
|
||||
|
@ -215,6 +217,7 @@ monstermaker::Spawner(void)
|
|||
unit.m_oldOrigin = GetOrigin();
|
||||
unit.m_oldAngle = GetAngles();
|
||||
unit.targetname = m_strChildName;
|
||||
unit.ReleaseThink();
|
||||
|
||||
m_iMonsterSpawned++;
|
||||
|
||||
|
|
|
@ -41,6 +41,7 @@ public:
|
|||
/* overrides */
|
||||
virtual void Save(float);
|
||||
virtual void Restore(string,string);
|
||||
nonvirtual void ActivateSub(void);
|
||||
|
||||
private:
|
||||
entity m_eActivator;
|
||||
|
@ -83,6 +84,13 @@ multi_manager_sub::Restore(string strKey, string strValue)
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
multi_manager_sub::ActivateSub(void)
|
||||
{
|
||||
m_iValue = TRUE;
|
||||
UseTargets(m_eActivator, TRIG_TOGGLE, 0.0f);
|
||||
}
|
||||
|
||||
class
|
||||
multi_manager:NSPointTrigger
|
||||
{
|
||||
|
@ -278,6 +286,8 @@ multi_manager::Spawned(void)
|
|||
void
|
||||
multi_manager::Respawn(void)
|
||||
{
|
||||
InitPointTrigger();
|
||||
|
||||
m_iValue = FALSE;
|
||||
|
||||
/* Mark them inactive */
|
||||
|
@ -289,18 +299,6 @@ multi_manager::Respawn(void)
|
|||
void
|
||||
multi_manager::Trigger(entity act, triggermode_t state)
|
||||
{
|
||||
static void mm_enttrigger (void) {
|
||||
multi_manager_sub wow = (multi_manager_sub)self;
|
||||
|
||||
entity eFind = find(world, ::targetname, wow.target);
|
||||
|
||||
EntLog("Triggering %S (%S)",
|
||||
wow.target, eFind.classname);
|
||||
|
||||
wow.m_iValue = TRUE;
|
||||
UseTargets(wow.m_eActivator, TRIG_TOGGLE, 0.0f);
|
||||
}
|
||||
|
||||
if (GetMaster(act) == FALSE)
|
||||
return;
|
||||
|
||||
|
@ -322,6 +320,6 @@ multi_manager::Trigger(entity act, triggermode_t state)
|
|||
|
||||
m_eTriggers[i].m_iValue = FALSE;
|
||||
m_eTriggers[i].m_eActivator = act;
|
||||
m_eTriggers[i].ScheduleThink(mm_enttrigger, m_eTriggers[i].m_flUntilTriggered);
|
||||
m_eTriggers[i].ScheduleThink(multi_manager_sub::ActivateSub, m_eTriggers[i].m_flUntilTriggered);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -50,6 +50,8 @@ multisource::multisource(void)
|
|||
void
|
||||
multisource::Respawn(void)
|
||||
{
|
||||
InitPointTrigger();
|
||||
|
||||
m_iValue = FALSE;
|
||||
}
|
||||
|
||||
|
|
|
@ -209,6 +209,8 @@ path_corner::SpawnKey(string strKey, string strValue)
|
|||
void
|
||||
path_corner::Respawn(void)
|
||||
{
|
||||
InitPointTrigger();
|
||||
|
||||
#ifdef DEVELOPER
|
||||
if (autocvar_dev_cornerspeed != 0) {
|
||||
m_flSpeed = autocvar_dev_cornerspeed;
|
||||
|
|
|
@ -96,10 +96,10 @@ path_track::DebugDraw(void)
|
|||
vector pos = GetOrigin();
|
||||
pos[2] += 32;
|
||||
R_BeginPolygon("textures/editor/path_track", 0, 0);
|
||||
R_PolygonVertex(pos + v_right * 24 - v_up * 24, [1,1], [1,1,1], 1.0f);
|
||||
R_PolygonVertex(pos - v_right * 24 - v_up * 24, [0,1], [1,1,1], 1.0f);
|
||||
R_PolygonVertex(pos - v_right * 24 + v_up * 24, [0,0], [1,1,1], 1.0f);
|
||||
R_PolygonVertex(pos + v_right * 24 + v_up * 24, [1,0], [1,1,1], 1.0f);
|
||||
R_PolygonVertex(pos + v_right * 16 - v_up * 16, [1,1], [1,1,1], 1.0f);
|
||||
R_PolygonVertex(pos - v_right * 16 - v_up * 16, [0,1], [1,1,1], 1.0f);
|
||||
R_PolygonVertex(pos - v_right * 16 + v_up * 16, [0,0], [1,1,1], 1.0f);
|
||||
R_PolygonVertex(pos + v_right * 16 + v_up * 16, [1,0], [1,1,1], 1.0f);
|
||||
R_EndPolygon();
|
||||
|
||||
R_BeginPolygon("", 0, 0);
|
||||
|
|
|
@ -26,9 +26,10 @@ world. It'll enable mouth flapping and all sorts of other cool effects.
|
|||
- "entity" : Name of the entity that'll speak the sentence.
|
||||
- "sentence" : Name of sentence from titles.txt.
|
||||
- "pitch" : Desired sound pitch. May be overridden in the titles.txt entry.
|
||||
- "delay" : Delay before it'll be triggered? UNUSED RIGHT NOW.
|
||||
- "delay" : Delay before it'll be triggered.
|
||||
- "wait" : Delay before it can be triggered again? UNUSED RIGHT NOW.
|
||||
- "listener" : The name of the entity we'll look at when speaking. Can be "player".
|
||||
- "refire" : Additional time in seconds before the entity can be triggered again.
|
||||
|
||||
# INPUTS
|
||||
- "BeginSentence" : Starts the sentence.
|
||||
|
@ -54,6 +55,7 @@ public:
|
|||
virtual void Trigger(entity, triggermode_t);
|
||||
virtual void Input(entity, string, string);
|
||||
|
||||
nonvirtual void AllowRefire(void);
|
||||
nonvirtual void SentenceEnded(void);
|
||||
|
||||
private:
|
||||
|
@ -67,6 +69,7 @@ private:
|
|||
string m_strListener;
|
||||
string m_strOnBeginSentence;
|
||||
string m_strOnEndSentence;
|
||||
float m_flRefire;
|
||||
};
|
||||
|
||||
void
|
||||
|
@ -82,6 +85,7 @@ scripted_sentence::scripted_sentence(void)
|
|||
m_strOnBeginSentence = __NULL__;
|
||||
m_strOnEndSentence = __NULL__;
|
||||
m_iSentenceID = 0i;
|
||||
m_flRefire = 0.0f;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -111,6 +115,7 @@ scripted_sentence::Save(float handle)
|
|||
SaveString(handle, "m_strOnBeginSentence", m_strOnBeginSentence);
|
||||
SaveString(handle, "m_strOnEndSentence", m_strOnEndSentence);
|
||||
SaveInt(handle, "m_iSentenceID", m_iSentenceID);
|
||||
SaveFloat(handle, "m_flRefire", m_flRefire);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -147,6 +152,9 @@ scripted_sentence::Restore(string strKey, string strValue)
|
|||
case "m_iSentenceID":
|
||||
m_iSentenceID = ReadInt(strValue);
|
||||
break;
|
||||
case "m_flRefire":
|
||||
m_flRefire = ReadFloat(strValue);
|
||||
break;
|
||||
default:
|
||||
super::Restore(strKey, strValue);
|
||||
}
|
||||
|
@ -174,6 +182,12 @@ scripted_sentence::SpawnKey(string keyName, string setValue)
|
|||
case "listener":
|
||||
m_strListener = ReadString(setValue);
|
||||
break;
|
||||
case "delay":
|
||||
m_flDelay = ReadFloat(setValue);
|
||||
break;
|
||||
case "refire":
|
||||
m_flRefire = ReadFloat(setValue);
|
||||
break;
|
||||
case "OnBeginSentence":
|
||||
m_strOnBeginSentence = ReadString(setValue);
|
||||
break;
|
||||
|
@ -197,10 +211,24 @@ scripted_sentence::Input(entity entityActivator, string inputName, string dataFi
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
scripted_sentence::AllowRefire(void)
|
||||
{
|
||||
m_iValue = 0;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
scripted_sentence::SentenceEnded(void)
|
||||
{
|
||||
StopSound(CHAN_VOICE, true);
|
||||
UseOutput(this, m_strOnEndSentence);
|
||||
|
||||
if (m_flRefire > 0.0f) {
|
||||
ScheduleThink(AllowRefire, m_flRefire);
|
||||
} else {
|
||||
AllowRefire();
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -209,6 +237,10 @@ scripted_sentence::Trigger(entity act, triggermode_t unused)
|
|||
entity spe;
|
||||
spe = find(world, ::targetname, m_strSpeaker);
|
||||
|
||||
if (m_iValue == 1) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!spe) {
|
||||
/* time to look for a classname instead */
|
||||
float closest = 9999999;
|
||||
|
@ -239,13 +271,14 @@ scripted_sentence::Trigger(entity act, triggermode_t unused)
|
|||
WriteInt(MSG_MULTICAST, m_iSentenceID);
|
||||
msg_entity = npc;
|
||||
multicast(npc.origin, MULTICAST_PVS);
|
||||
npc.m_flNextSentence = time + m_flDuration;
|
||||
npc.m_flNextSentence = time + m_flDuration + m_flRefire;
|
||||
UseTargets(act, TRIG_TOGGLE, m_flDelay);
|
||||
|
||||
/* I/O */
|
||||
/* Uncertain: Are we triggering the output on behalf of someone maybe? */
|
||||
UseOutput(this, m_strOnBeginSentence);
|
||||
ScheduleThink(SentenceEnded, m_flDuration);
|
||||
m_iValue = 1;
|
||||
|
||||
if (m_strListener) {
|
||||
if (m_strListener == "player") {
|
||||
|
|
|
@ -136,10 +136,10 @@ scripted_sequence::DebugDraw(void)
|
|||
pos[2] += 32;
|
||||
|
||||
R_BeginPolygon("textures/editor/scripted_sequence", 0, 0);
|
||||
R_PolygonVertex(pos + v_right * 24 - v_up * 24, [1,1], [1,1,1], 1.0f);
|
||||
R_PolygonVertex(pos - v_right * 24 - v_up * 24, [0,1], [1,1,1], 1.0f);
|
||||
R_PolygonVertex(pos - v_right * 24 + v_up * 24, [0,0], [1,1,1], 1.0f);
|
||||
R_PolygonVertex(pos + v_right * 24 + v_up * 24, [1,0], [1,1,1], 1.0f);
|
||||
R_PolygonVertex(pos + v_right * 16 - v_up * 16, [1,1], [1,1,1], 1.0f);
|
||||
R_PolygonVertex(pos - v_right * 16 - v_up * 16, [0,1], [1,1,1], 1.0f);
|
||||
R_PolygonVertex(pos - v_right * 16 + v_up * 16, [0,0], [1,1,1], 1.0f);
|
||||
R_PolygonVertex(pos + v_right * 16 + v_up * 16, [1,0], [1,1,1], 1.0f);
|
||||
R_EndPolygon();
|
||||
|
||||
R_BeginPolygon("", 0, 0);
|
||||
|
|
|
@ -78,6 +78,7 @@ public:
|
|||
virtual void UseNormal(entity,triggermode_t);
|
||||
virtual void UseLoop(entity, triggermode_t);
|
||||
virtual void Input(entity, string, string);
|
||||
virtual void DebugDraw(void);
|
||||
#else
|
||||
virtual void ReceiveEntity(float,float);
|
||||
virtual float predraw(void);
|
||||
|
@ -270,6 +271,17 @@ ambient_generic::Respawn(void)
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
ambient_generic::DebugDraw(void)
|
||||
{
|
||||
R_BeginPolygon("textures/editor/ambient_generic", 0, 0);
|
||||
R_PolygonVertex(GetOrigin() + v_right * 16 - v_up * 16, [1,1], [1,1,1], 1.0f);
|
||||
R_PolygonVertex(GetOrigin() - v_right * 16 - v_up * 16, [0,1], [1,1,1], 1.0f);
|
||||
R_PolygonVertex(GetOrigin() - v_right * 16 + v_up * 16, [0,0], [1,1,1], 1.0f);
|
||||
R_PolygonVertex(GetOrigin() + v_right * 16 + v_up * 16, [1,0], [1,1,1], 1.0f);
|
||||
R_EndPolygon();
|
||||
}
|
||||
|
||||
void
|
||||
ambient_generic::UseNormal(entity act, triggermode_t state)
|
||||
{
|
||||
|
|
|
@ -200,7 +200,8 @@ Updates_Refresh(void)
|
|||
|
||||
updates[c].size = (int)stof(getpackagemanagerinfo(id, GPMI_FILESIZE));
|
||||
updates[c].uid = i;
|
||||
updates[c].preview_image = sprintf(FN_UPDATE_IMGURL, updates[c].name);
|
||||
tokenizebyseparator(getpackagemanagerinfo(id, GPMI_NAME), "=");
|
||||
updates[c].preview_image = sprintf(FN_UPDATE_IMGURL, argv(0));
|
||||
Updates_RefreshStateValues(c);
|
||||
|
||||
c++;
|
||||
|
|
|
@ -451,11 +451,14 @@ EntityDef_PrepareEntity(entity target, int id)
|
|||
}
|
||||
|
||||
targetEnt.m_strModelEventCB = g_entDefTable[id].eventList; /* pass over the event listing */
|
||||
|
||||
/* now we rename the classname for better visibility,
|
||||
but also because some classes need to know. */
|
||||
targetEnt.classname = g_entDefTable[id].entClass;
|
||||
|
||||
targetEnt.Spawned();
|
||||
targetEnt.Respawn();
|
||||
|
||||
/* now we rename the classname for better visibility */
|
||||
targetEnt.classname = g_entDefTable[id].entClass;
|
||||
g_lastSpawnData = "";
|
||||
return targetEnt;
|
||||
}
|
||||
|
|
|
@ -203,9 +203,6 @@ NSMoverEntity::GetMoverRotation2(void)
|
|||
void
|
||||
NSMoverEntity::MoveToPosition(vector vecDest, float flSpeed)
|
||||
{
|
||||
if (vecDest == origin)
|
||||
return;
|
||||
|
||||
MoveAndRotateToPosition(vecDest, GetAngles(), flSpeed);
|
||||
}
|
||||
|
||||
|
|
|
@ -25,11 +25,13 @@ class NSPointTrigger:NSEntity
|
|||
public:
|
||||
void NSPointTrigger(void);
|
||||
|
||||
/* overrides */
|
||||
virtual void Respawn(void);
|
||||
virtual void DebugDraw(void);
|
||||
|
||||
/** Sets up a point entity trigger with no size. */
|
||||
nonvirtual void InitPointTrigger(void);
|
||||
|
||||
virtual void DebugDraw(void);
|
||||
|
||||
#ifdef SERVER
|
||||
private:
|
||||
string m_strDebugTexture;
|
||||
|
|
|
@ -22,11 +22,17 @@ NSPointTrigger::NSPointTrigger(void)
|
|||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
NSPointTrigger::Respawn(void)
|
||||
{
|
||||
InitPointTrigger();
|
||||
}
|
||||
|
||||
void
|
||||
NSPointTrigger::InitPointTrigger(void)
|
||||
{
|
||||
SetSize(VEC_HULL_MIN, VEC_HULL_MAX);
|
||||
SetSolid(SOLID_TRIGGER);
|
||||
SetSolid(SOLID_NOT);
|
||||
|
||||
#ifdef SERVER
|
||||
m_bEnabled = (m_bStartDisabled) ? false : true;
|
||||
|
|
|
@ -359,7 +359,7 @@ NSRenderableEntity::RenderFXPass(void)
|
|||
|
||||
break;
|
||||
case RM_GLOW:
|
||||
colormod = [1,1,1];
|
||||
colormod = m_vecRenderColor;
|
||||
alpha = m_flRenderAmt == 0.0 ? 0.0f : 1.0f;
|
||||
case RM_WORLDGLOW: /* TODO: Figure out what this does differently */
|
||||
if (checkpvs(vecPlayer, this) == FALSE)
|
||||
|
|
|
@ -84,7 +84,7 @@ NSTrigger::CanBeTriggeredBy(entity testEnt)
|
|||
void
|
||||
NSTrigger::Trigger(entity act, triggermode_t state)
|
||||
{
|
||||
EntWarning("Triggered by %S with no consequence", act.classname);
|
||||
EntWarning("%S triggered by %S with no consequence", targetname, act.classname);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -118,7 +118,7 @@ NSTrigger::UseTargets(entity act, int state, float triggerDelay)
|
|||
env_message_single(act, m_strMessage);
|
||||
}
|
||||
|
||||
if (HasTriggerTarget() == true)
|
||||
if (target && target != "" && target != targetname)
|
||||
for (entity f = world; (f = find(f, ::targetname, target));) {
|
||||
NSTrigger trigger = (NSTrigger)f;
|
||||
|
||||
|
|
|
@ -114,6 +114,7 @@ VGUI3DView::Draw(void)
|
|||
setproperty(VF_AFOV, 90);
|
||||
setproperty(VF_ORIGIN, m_vec3DPos);
|
||||
setproperty(VF_ANGLES, m_vec3DAngles);
|
||||
setproperty(VF_DRAWWORLD, false);
|
||||
tmpVGUI3DView1();
|
||||
renderscene();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue