mirror of
https://github.com/UberGames/RPG-X2.git
synced 2025-01-22 00:11:20 +00:00
fx_borg_bolt
*basically finished it, but I need the current origin of my targets, not the original. Don't know how to get that. *added a new folder 'testingstuff' for anything we generate for testing various things and put the folder 'maps in there' *also in there is a test-version of borg2 with a hardcoded fx_borg_bolt at the binary lift (somehow lua will class it as noclass...) *minor mod to game-makefile that prevented me from compiling Signed-off-by: Harry Young <hendrik.gerritzen@googlemail.com>
This commit is contained in:
parent
4bc8f3f4d1
commit
19dc95e05d
12 changed files with 47081 additions and 44 deletions
|
@ -2080,38 +2080,41 @@ Yellow bolts that spark when the endpoints get close together
|
|||
----------------------
|
||||
*/
|
||||
|
||||
/*void CG_Borg_Bolt( centity_t *cent )
|
||||
void CG_Borg_Bolt_static( centity_t *cent )
|
||||
{
|
||||
vec3_t diff, neworg, start, end;
|
||||
vec3_t diff;
|
||||
float len;
|
||||
|
||||
// Get the midpoint of the seg
|
||||
VectorSubtract( cent->currentState.origin2, cent->currentState.origin, diff );
|
||||
len = VectorNormalize( diff );
|
||||
|
||||
// Use this to scale down the width of the bolts. Otherwise, they will look pretty fairly nasty when they
|
||||
// get too short.
|
||||
len = len / 32;
|
||||
|
||||
FX_AddElectricity( cent->currentState.origin, cent->currentState.origin2, 1.0, len, 5.0, 1.0, 0.0, 200, cgs.media.phaserShader, 0 );
|
||||
}
|
||||
|
||||
void CG_Borg_Bolt_dynamic( centity_t *cent )
|
||||
{
|
||||
vec3_t diff, neworg;
|
||||
float len;
|
||||
|
||||
if (!cent->gent->enemy){ // need sth to trace target
|
||||
return;//we lost him
|
||||
}
|
||||
VectorCopy( cent->gent->enemy->currentOrigin, end );
|
||||
|
||||
if ( cent->gent->target2 )
|
||||
{
|
||||
VectorCopy( cent->gent->chain->currentOrigin, start );
|
||||
}
|
||||
else
|
||||
{
|
||||
VectorCopy( cent->lerpOrigin, start );
|
||||
}
|
||||
|
||||
// Get the midpoint of the seg
|
||||
VectorSubtract( end, start, diff );
|
||||
VectorSubtract( cent->currentState.origin2, cent->currentState.origin, diff );
|
||||
len = VectorNormalize( diff );
|
||||
VectorMA( start, len * 0.5, diff, neworg );
|
||||
VectorMA( cent->currentState.origin, len * 0.5, diff, neworg );
|
||||
|
||||
// If the length is pretty short, then spawn a glow spark
|
||||
if ( len > 0 && len < 12 )
|
||||
{
|
||||
int ct;
|
||||
vec3_t angles, dir;
|
||||
FXTrail *particle;
|
||||
int ct, t;
|
||||
vec3_t angles, dir, vel;
|
||||
localEntity_t *particle;
|
||||
|
||||
FX_AddSprite( neworg, NULL, NULL, random() * (128 / len) + 12, 16.0, 0.6f, 0.0, 0.0, 0.0, 300,
|
||||
FX_AddSprite( neworg, NULL, qfalse, random() * (128 / len) + 12, 16.0, 0.6f, 0.0, 0.0, 0.0, 50,
|
||||
cgs.media.yellowParticleShader );
|
||||
|
||||
vectoangles( dir, angles );
|
||||
|
@ -2119,26 +2122,27 @@ Yellow bolts that spark when the endpoints get close together
|
|||
ct = 12 - len;
|
||||
|
||||
// fun sparks
|
||||
for ( int t=0; t < ct; t++ )
|
||||
for ( t=0; t < ct; t++ )
|
||||
{
|
||||
angles[1] = random() * 360;
|
||||
AngleVectors( angles, dir, NULL, NULL );
|
||||
dir[2] = random() * 0.3f;
|
||||
VectorScale( dir, 300, vel );
|
||||
|
||||
particle = FX_AddTrail( neworg, NULL, NULL, 8.0f + random() * 6, -16.0f, 1, -1,
|
||||
1.0f, 0.0f, 0.25f, 700.0f, cgs.media.yellowParticleShader );
|
||||
particle = FX_AddTrail( neworg, NULL, qfalse, 8.0f + random() * 6, -16.0f, 1, -1,
|
||||
1.0f, 0.0f, 0.25f, 50, cgs.media.yellowParticleShader );
|
||||
|
||||
if ( particle == NULL )
|
||||
return;
|
||||
|
||||
FXE_Spray( dir, 100, 150, 0.5f, 300 + (rand() & 300), (FXPrimitive *) particle );
|
||||
FXE_Spray( dir, 100, 150, 0.5f, vel );
|
||||
}
|
||||
|
||||
// If it's really short, spark and make a noise. Tried this without the if (len>0... and it was way
|
||||
// too obnoxious
|
||||
if ( len <= 5 )
|
||||
{
|
||||
cgi_S_StartSound( neworg, 0, 0, cgi_S_RegisterSound( "sound/enemies/borg/borgtaser.wav") );
|
||||
trap_S_StartSound( neworg, 0, 0, trap_S_RegisterSound( "sound/enemies/borg/borgtaser.wav") );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2146,13 +2150,16 @@ Yellow bolts that spark when the endpoints get close together
|
|||
// get too short.
|
||||
len = len / 32;
|
||||
|
||||
FX_AddElectricity( start, end, 1.0, len, 5.0, 1.0, 0.0, 200, cgs.media.yellowBoltShader );
|
||||
FX_AddElectricity( cent->currentState.origin, cent->currentState.origin2, 1.0, len, 5.0, 1.0, 0.0, 50, cgs.media.phaserShader, 0 );
|
||||
}
|
||||
|
||||
if ( rand() & 1 )
|
||||
{
|
||||
FX_AddElectricity( end, start, 1.0, len, 5.0, 1.0, 0.0, 200, cgs.media.yellowBoltShader );
|
||||
}
|
||||
}*/
|
||||
/*
|
||||
----------------------
|
||||
CG_StasisDoor
|
||||
|
||||
Does Fade-Effect for func_stasis_door
|
||||
----------------------
|
||||
*/
|
||||
|
||||
void CG_StasisDoor(centity_t *cent, qboolean close) {
|
||||
localEntity_t *le;
|
||||
|
|
|
@ -1832,7 +1832,10 @@ case EV_SHAKE_SOUND:
|
|||
|
||||
case EV_FX_BORG_BOLT:
|
||||
DEBUGNAME("EV_FX_BORG_BOLT");
|
||||
//CG_Borg_Bolt( cent );
|
||||
if ( cent->currentState.eventParm != 2 ) //we don't want the extra stuff?
|
||||
CG_Borg_Bolt_dynamic( cent );
|
||||
else
|
||||
CG_Borg_Bolt_static( cent );
|
||||
break;
|
||||
|
||||
// Default
|
||||
|
|
|
@ -2072,7 +2072,8 @@ void CG_BorgEnergyBeam( centity_t *cent );
|
|||
void CG_ShimmeryThing( vec3_t start, vec3_t end, vec3_t content );
|
||||
void CG_Shimmer( vec3_t position, vec3_t dest, vec3_t dir, vec3_t other );
|
||||
void CG_ShimmeryThing_Spawner( vec3_t start, vec3_t end, float radius, qboolean taper, int duration );
|
||||
void CG_Borg_Bolt( centity_t *cent );
|
||||
void CG_Borg_Bolt_static( centity_t *cent );
|
||||
void CG_Borg_Bolt_dynamic( centity_t *cent );
|
||||
|
||||
//
|
||||
// cg_weapons.c
|
||||
|
|
|
@ -85,7 +85,7 @@ OBJ = \
|
|||
lua_weapons.o \
|
||||
lua_trace.o \
|
||||
lua_cvar.o \
|
||||
sqlite3.o \
|
||||
#sqlite3.o \
|
||||
md5.o
|
||||
|
||||
# game object for syscalls to the engine
|
||||
|
@ -196,7 +196,7 @@ lua_sound.o: lua_sound.c; $(DO_CC)
|
|||
lua_weapons.o: lua_weapons.c; $(DO_CC)
|
||||
lua_trace.o: lua_trace.c; $(DO_CC)
|
||||
lua_cvar.o: lua_cvar.c; $(DO_CC)
|
||||
sqlite3.o: sqlite3.c; $(DO_CC)
|
||||
#sqlite3.o: sqlite3.c; $(DO_CC)
|
||||
md5.o: md5.c; $(DO_CC)
|
||||
|
||||
# game syscalls
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
// because games can change separately from the main system version, we need a
|
||||
// second version that must match between game and cgame
|
||||
#define RPGX_VERSION "RPG-X v2.2 wc161211a"
|
||||
#define RPGX_VERSION "RPG-X v2.2 wc171211a"
|
||||
#define RPGX_COMPILEDATE "20/05/11"
|
||||
#define RPGX_COMPILEDBY "GSIO01"
|
||||
//const char GAME_VERSION[] = strcat("RPG-X v",RPGX_VERSION);
|
||||
|
|
37
game/g_fx.c
37
game/g_fx.c
|
@ -2014,21 +2014,32 @@ void SP_fx_shimmery_thing( gentity_t *ent )
|
|||
trap_LinkEntity( ent );
|
||||
}
|
||||
|
||||
/*QUAKED fx_borg_bolt (0 0 1) (-8 -8 -8) (8 8 8) STARTOFF
|
||||
/*QUAKED fx_borg_bolt (0 0 1) (-8 -8 -8) (8 8 8) STARTOFF NO_PROXIMITY_FX
|
||||
Emits yellow electric bolts from the specified point to the specified point.
|
||||
Emits showers of sparks if the endpoints are sufficiently close.
|
||||
Has an Ugly FT-Think, so don't use unless needed
|
||||
|
||||
STARTOFF - effect is initially off
|
||||
NO_PROXIMITY_FX - Will deactivate proximity-fx associated with this. Check it if you don't use movers as else the entity thinks EVERY frame (like on borg2)
|
||||
|
||||
"target" (required) end point of the beam. Can be a func_train, info_notnull, etc.
|
||||
"target" (required) end point of the beam. Can be a func_train, info_notnull, etc.
|
||||
"message" - moves start point of the beam to this ent's origin. Only useful if the beam connects 2 movers.
|
||||
"targetname" - toggles effect on/off each time it's used
|
||||
*/
|
||||
|
||||
//------------------------------------------
|
||||
void borg_bolt_think( gentity_t *ent )
|
||||
{
|
||||
G_AddEvent( ent, EV_FX_BORG_BOLT, 0 );
|
||||
ent->nextthink = level.time + 100 + random() * 25;
|
||||
if (ent->spawnflags & 2)
|
||||
{
|
||||
G_AddEvent( ent, EV_FX_BORG_BOLT, 0 );
|
||||
ent->nextthink = level.time + 100 + random() * 25;
|
||||
}
|
||||
else
|
||||
{
|
||||
G_AddEvent( ent, EV_FX_BORG_BOLT, 1 );
|
||||
ent->nextthink = level.time + 50;
|
||||
}
|
||||
}
|
||||
|
||||
//------------------------------------------
|
||||
|
@ -2053,6 +2064,7 @@ void borg_bolt_use( gentity_t *self, gentity_t *other, gentity_t *activator )
|
|||
void borg_bolt_link( gentity_t *ent )
|
||||
{
|
||||
gentity_t *target = NULL;
|
||||
gentity_t *target2 = NULL;
|
||||
|
||||
target = G_Find (target, FOFS(targetname), ent->target);
|
||||
|
||||
|
@ -2065,11 +2077,24 @@ void borg_bolt_link( gentity_t *ent )
|
|||
|
||||
return;
|
||||
}
|
||||
VectorCopy( target->s.origin, ent->s.origin2 );
|
||||
|
||||
if (ent->message)
|
||||
{
|
||||
target2 = G_Find (target2, FOFS(targetname), ent->message);
|
||||
|
||||
if (!target2)
|
||||
{
|
||||
Com_Printf("borg_bolt_link: unable to find target2 %s falling back to using ent's origin\n", ent->parent );
|
||||
}
|
||||
else
|
||||
{
|
||||
VectorCopy( target2->s.origin, ent->s.origin );
|
||||
}
|
||||
}
|
||||
|
||||
// ent->svFlags |= SVF_BROADCAST;// Broadcast to all clients
|
||||
|
||||
VectorCopy( target->s.origin, ent->s.origin2 );
|
||||
|
||||
if ( ent->targetname )
|
||||
{
|
||||
ent->use = borg_bolt_use;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
// Current version of holomatch game
|
||||
|
||||
#define Q3_VERSION "RPG-X v2.2 wc161211a"
|
||||
#define Q3_VERSION "RPG-X v2.2 wc171211a"
|
||||
|
||||
// end
|
||||
|
|
BIN
testingstuff/maps/borg2test.bsp
Normal file
BIN
testingstuff/maps/borg2test.bsp
Normal file
Binary file not shown.
46879
testingstuff/maps/borg2test.map
Normal file
46879
testingstuff/maps/borg2test.map
Normal file
File diff suppressed because it is too large
Load diff
122
testingstuff/scripts/lua/borg2test/borg2test.lua
Normal file
122
testingstuff/scripts/lua/borg2test/borg2test.lua
Normal file
|
@ -0,0 +1,122 @@
|
|||
-- Startup
|
||||
function InitGame(levelTime, randomSeed, restart)
|
||||
game.Print("--Lift D...");
|
||||
game.Print("---Segment reclassification ...");
|
||||
ent = entity.FindBModel(52)
|
||||
ent:SetClassname("func_static");
|
||||
--ent:SetTargetname("dual_lift_upper");
|
||||
ent:SetLuaReached("liftdreachedsound");
|
||||
entity.CallSpawn(ent);
|
||||
|
||||
ent = entity.FindBModel(54)
|
||||
ent:SetClassname("func_static");
|
||||
--ent:SetTargetname("dual_lift_lower");
|
||||
ent:SetLuaReached("liftdreachedsound");
|
||||
entity.CallSpawn(ent);
|
||||
|
||||
game.Print("---Metascripts ...");
|
||||
game.Print("---down1 ...");
|
||||
ent = entity.Spawn();
|
||||
ent:SetClassname("target_relay");
|
||||
ent:SetTargetname("down1");
|
||||
ent:SetLuaUse("liftddown1");
|
||||
entity.CallSpawn(ent);
|
||||
|
||||
ent = entity.Spawn();
|
||||
ent:SetClassname("target_delay");
|
||||
ent:SetTargetname("down1");
|
||||
ent:SetTarget("down2");
|
||||
ent:SetWait(5);
|
||||
entity.CallSpawn(ent);
|
||||
|
||||
game.Print("---down2 ...");
|
||||
ent = entity.Spawn();
|
||||
ent:SetClassname("target_relay");
|
||||
ent:SetTargetname("down2");
|
||||
ent:SetLuaUse("liftddown2");
|
||||
entity.CallSpawn(ent);
|
||||
|
||||
ent = entity.Spawn();
|
||||
ent:SetClassname("target_delay");
|
||||
ent:SetTargetname("down2");
|
||||
ent:SetTarget("up2");
|
||||
ent:SetWait(5);
|
||||
entity.CallSpawn(ent);
|
||||
|
||||
game.Print("---up2 ...");
|
||||
ent = entity.Spawn();
|
||||
ent:SetClassname("target_relay");
|
||||
ent:SetTargetname("up2");
|
||||
ent:SetLuaUse("liftdup2");
|
||||
entity.CallSpawn(ent);
|
||||
|
||||
ent = entity.Spawn();
|
||||
ent:SetClassname("target_delay");
|
||||
ent:SetTargetname("up2");
|
||||
ent:SetTarget("up1");
|
||||
ent:SetWait(5);
|
||||
entity.CallSpawn(ent);
|
||||
|
||||
game.Print("---up1 ...");
|
||||
ent = entity.Spawn();
|
||||
ent:SetClassname("target_relay");
|
||||
ent:SetTargetname("up1");
|
||||
ent:SetLuaUse("liftdup1");
|
||||
entity.CallSpawn(ent);
|
||||
|
||||
ent = entity.Spawn();
|
||||
ent:SetClassname("target_delay");
|
||||
ent:SetTargetname("up1");
|
||||
ent:SetTarget("down1");
|
||||
ent:SetWait(5);
|
||||
entity.CallSpawn(ent);
|
||||
|
||||
game.Print("---init ...");
|
||||
ent = entity.Spawn();
|
||||
ent:SetClassname("target_relay");
|
||||
ent:SetTarget("down1");
|
||||
entity.CallSpawn(ent);
|
||||
entity.Use(ent)
|
||||
|
||||
game.Print("---fx-startspawn ...");
|
||||
--ent = entity.Spawn();
|
||||
--ent:SetClassname("fx_borg_bolt");
|
||||
--ent:SetMessage("dual_lift_upper");
|
||||
--ent:SetTarget("dual_lift_lower");
|
||||
--entity.CallSpawn(ent);
|
||||
end
|
||||
-- Functions Lift D
|
||||
|
||||
function liftddown1(ent, other, activator)
|
||||
ent = entity.FindBModel(52);
|
||||
mover.ToPosition(ent, 12, 768, -1984, 224);
|
||||
sound.PlaySound(ent, "sound/movers/doors/largedoorstart.mp3", 0);
|
||||
end
|
||||
|
||||
function liftddown2(ent, other, activator)
|
||||
ent = entity.FindBModel(52);
|
||||
mover.ToPosition(ent, 30, 768, -1984, 104);
|
||||
sound.PlaySound(ent, "sound/movers/doors/largedoorstart.mp3", 0);
|
||||
ent = entity.FindBModel(54);
|
||||
mover.ToPosition(ent, 30, 768, -1984, 104);
|
||||
sound.PlaySound(ent, "sound/movers/doors/largedoorstart.mp3", 0);
|
||||
end
|
||||
|
||||
function liftdup2(ent, other, activator)
|
||||
ent = entity.FindBModel(52);
|
||||
mover.ToPosition(ent, 30, 768, -1984, 224);
|
||||
sound.PlaySound(ent, "sound/movers/doors/largedoorstart.mp3", 0);
|
||||
ent = entity.FindBModel(54);
|
||||
mover.ToPosition(ent, 30, 768, -1984, 224);
|
||||
sound.PlaySound(ent, "sound/movers/doors/largedoorstart.mp3", 0);
|
||||
end
|
||||
|
||||
function liftdup1(ent, other, activator)
|
||||
ent = entity.FindBModel(52);
|
||||
mover.ToPosition(ent, 12, 768, -1984, 272);
|
||||
sound.PlaySound(ent, "sound/movers/doors/largedoorstart.mp3", 0);
|
||||
end
|
||||
|
||||
function liftdreachedsound(ent, other, activator)
|
||||
sound.PlaySound(entity.FindBModel(52), "sound/movers/doors/largedoorstop.mp3", 0);
|
||||
end
|
Loading…
Reference in a new issue