From 166aa1db946afc233d835c3686176c5bf05e23ee Mon Sep 17 00:00:00 2001 From: Walter Julius Hennecke Date: Sat, 10 Dec 2011 00:03:03 +0100 Subject: [PATCH] Have rewritten the spawn function of func_stasis_door. Changed the complete setup so areaportal states can be adjusted now. This entity still needs a lot of work but we are on a good way now. You don't mind if I work a bit more on this entity do you Harry? --- game/g_mover.c | 40 +++++++++++++++------------------------- game/lua_entity.c | 6 +++--- stefgame.suo | Bin 209920 -> 211968 bytes 3 files changed, 18 insertions(+), 28 deletions(-) diff --git a/game/g_mover.c b/game/g_mover.c index 8aa8eae..e50e9fa 100644 --- a/game/g_mover.c +++ b/game/g_mover.c @@ -3368,6 +3368,7 @@ void close2_stasis_door( gentity_t *ent ) // Now would be a good time to close the area portal. trap_AdjustAreaPortalState( ent, qfalse ); + trap_UnlinkEntity(ent); ent->nextthink = -1; return; G_Printf( "^1Entity closed\n", 0 ); @@ -3448,6 +3449,10 @@ void open2_stasis_door( gentity_t *ent ) ent->flags |= SVF_NOCLIENT; ent->r.contents = 0; ent->flags |= EF_NODRAW; + + // Now would be a good time to open up the area portal..heh heh. + trap_AdjustAreaPortalState( ent, qtrue ); + trap_LinkEntity(ent); if ( ent->wait >= 0 ) { @@ -3481,9 +3486,6 @@ void open1_stasis_door( gentity_t *ent ) G_AddEvent( ent, EV_GENERAL_SOUND, G_SoundIndex( "sound/movers/doors/stasisdoor.wav" )); - // Now would be a good time to open up the area portal..heh heh. - trap_AdjustAreaPortalState( ent, qtrue ); - ent->think = open2_stasis_door; ent->nextthink = level.time + 1000; G_Printf( "^1Entity opening\n", 0 ); @@ -3680,37 +3682,24 @@ START_LOCKED: door is locked at spawn */ void SP_func_stasis_door( gentity_t *ent ) { + /* set the brush model */ trap_SetBrushModel( ent, ent->model ); - G_SoundIndex( "sound/movers/doors/stasisdoor.wav" ); - G_SoundIndex( "sound/movers/switches/stasisneg.wav" ); + /* set the orgin */ + G_SetOrigin(ent, ent->s.origin); - // Stasis doors have a model2, so precache me now - G_ModelIndex( "models/mapobjects/stasis/door2.md3" ); - ent->model2 = G_NewString("models/mapobjects/stasis/door.md3"); - - // Now that we have the model precached, clear this out so it doesn't draw the model - // until we are ready to do the actual fade. - ent->s.modelindex2 = 0; - - // sigh...ent->s.origin seems to be some kind of translational offset for the brush....so don't try and set - // the "correct" door origin because it should actually be <0 0 0>..hence the stashing of the origin in pos1. - VectorAdd( ent->r.absmax, ent->r.absmin, ent->pos1 ); - VectorScale( ent->pos1, 0.5f, ent->pos1 ); - VectorCopy( ent->pos1, ent->pos2 ); - - G_SetOrigin( ent, ent->s.origin ); - - // Auto create a door trigger so the designers don't have to - ent->think = spawn_trigger_stasis_door; + VectorCopy(ent->s.origin, ent->pos1); InitMover(ent); + //G_SoundIndex( "sound/movers/doors/stasisdoor.wav" ); + //G_SoundIndex( "sound/movers/switches/stasisneg.wav" ); + + // Auto create a door trigger so the designers don't have to + ent->think = spawn_trigger_stasis_door; ent->nextthink = level.time + 50 * 5; // give the target a chance to spawn in - //ent->trigger_formation = qfalse; ent->use = use_stasis_door; - //ent->flags |= SVF_STASIS_DOOR; ent->count = 1; if (!ent->wait) { @@ -3724,5 +3713,6 @@ void SP_func_stasis_door( gentity_t *ent ) } trap_LinkEntity (ent); + G_Printf( "^1Spawnage in progress\n", 0 ); } diff --git a/game/lua_entity.c b/game/lua_entity.c index 167eab4..eef6279 100644 --- a/game/lua_entity.c +++ b/game/lua_entity.c @@ -2630,8 +2630,8 @@ static const luaL_Reg Entity_meta[] = { {"GetNumber", Entity_GetNumber}, {"IsClient", Entity_IsClient}, {"GetClientname", Entity_GetClientName}, - {"Print", Entity_Print}, - {"CenterPrint", Entity_CenterPrint}, + //{"Print", Entity_Print}, // why are these deleted? + //{"CenterPrint", Entity_CenterPrint},// why are these deleted? {"GetClassname", Entity_GetClassName}, // args: none; return: string {"SetClassname", Entity_SetClassName}, // args: string; return: nothing @@ -2639,7 +2639,7 @@ static const luaL_Reg Entity_meta[] = { {"GetTargetname", Entity_GetTargetName}, // args: none; return: string {"SetTargetname", Entity_SetTargetName}, // args: string; return: nothing - {"Rotate", Entity_Rotate}, + //{"Rotate", Entity_Rotate},// why are these deleted? {"IsRocket", Entity_IsRocket}, {"IsGrenade", Entity_IsGrenade}, diff --git a/stefgame.suo b/stefgame.suo index fe1ab7f2b78b34f221b3d01486263c6bfa06a49c..6e17f668c32ea5fafce631c42d5be73ee8d1c781 100644 GIT binary patch delta 1698 zcmb`Ge@s(X6vy8=uPq3rX|Ys>iWRFMR90IxjwuvDHz6U_Ie&~zsUpgTv{45`s+Q>n z;tzys5B|uKO_v$tjLODMmJQ2RonyuyQ8SfAQI|M3Hf5qXb+Y@~D#rQeUUG82_r1?O z=bm%VbN{Mz-%}naktv*Qx4nm(o0iJnS1Ia25USNp_oG)0L_>PhiqsYJ)D50byT2J$ z{mN(O_8uAFHc#;!-+gIHUN$@*aNOX z>f1e~SIXw*oG9ECJ8Nr+Yb0q}A%^DmKm^<8hqW=XN4>qhH0B~4H%jVTxgbd1AM!^- z{#eMjg*+MCAv?Htc{|LgFC6bZ3khU+fP*~gN(IaQ8C(jozK3~Cbq#vLH75VQYc&u5 z-1ASI#yR>OG3T^rbC;GScft^n&dh@0RC*JpX}0NaOnqTy%ayD*+VAAA=(;w8ow^AQ z(5%jFJl8*~>&rAeT(|3HP5m5Z>w;1J)Rr5`S#O5zctwP4QM>63ur(EWApsjbNtKW1ypTW@IpdGCROT z2QpBpKG^w3`Ncf{Ul;y<@UZ*5smP=GJ%$qe5D)3pdIZdai-l65NN@tgQKe=2ySSpgb27rfR9R5{J`>s}RS0V{n9wx+8H6 zm34v&+UT?vCo=s@=$4V}1V79E3{=C9R27Q@s3QUs=%fCqV!uqphDdJ?`n;9+HeJ08 zI!Gh1p^0k8V+5=U$wSN~)^B z4CXruR*_jhL^m+^NpQ3~wd#H|(?c~1! zX;CzdYT(MlZ40-p+`QbjacksO$89^e9o(dWeRR-X2cCjkakRMyozxMF$+U7XM6(Gp zF)gfFDQ0OE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