Cooler Force Field Doors

Suggestions you have for the Annihilation mod.

Moderator: Moderators

Post Reply
Risker259
1st Lieutenant
1st Lieutenant
Posts: 315
Joined: Sun Aug 29, 2004 2:02 am

Cooler Force Field Doors

Post by Risker259 » Sat Aug 16, 2008 1:52 am

I think this would look cooler. No biggy.

Code: Select all

StaticShapeData LargeForceField    { shapeFile = "ForceField_4x8"; debrisId = defaultDebrisSmall; maxDamage = 7.0; isTranslucent = true; description = "Large Force Field"; };
StaticShapeData LargeForceFieldFake    { shapeFile = "ForceField_4x8"; debrisId = defaultDebrisSmall; maxDamage = 1000.0; isTranslucent = true; description = "Large Force Field"; disableCollision = true; };
function LargeForceField::onCollision(%this, %object)
{
   //echo("ok got this far");
   %thisteam = GameBase::getTeam(%this);
   %objectteam = GameBase::getTeam(%object);
        %objtype = getObjectType(%object);

   if(%thisteam == %objectteam && %objtype == "Player")
   {   
      %originalpos = GameBase::getPosition(%this);
      %originalrot = GameBase::getRotation(%this);
      %turret = newObject("largeforcefieldfake","StaticShape",largeforcefieldfake,true);
           addToSet("MissionCleanup", %turret);
      GameBase::setPosition(%this,"0 0 -999");
      GameBase::setPosition(%turret,%originalpos);
      GameBase::setRotation(%turret,%originalrot);
      Gamebase::setMapName(%turret,"Large Force Field");
      schedule("deleteobject("@%turret@");",1);
      schedule("GameBase::setPosition('" @ %this @ "', '" @ %originalpos @ "');",1);
      schedule("GameBase::setRotation('" @ %this @ "', '" @ %originalrot @ "');",1);
   }
}


basically instead of the force field disappearing when you collide with it, the force field stays there but you can walk through it. It goes back to normal after 1 second.

Perrinoia
Suggestion bot 10,000
Posts: 11185
Joined: Sat May 04, 2002 11:00 pm
Location: Rhode Island

Re: Cooler Force Field Doors

Post by Perrinoia » Sun Nov 16, 2008 4:14 pm

I like this idea, except, I think it can be done better...

My problem with the force field is where it goes when it is opened.
Currently, the code sends it to position "0 0 0" and then back when it closes, and your code does the same but spawns a fake door in it's place while it's gone, which is cool, but still has this extra force field spawning at this seemingly random position below the terrain, which can cause problems in situations where players can walk through that point, like an underground base or something. The force field door might block a hallway when repositioned or something, and what if someone touches it there? Will it move back to the "open" position after it's scheduled closed from the first collision event?

So my suggestion, is as follows, in the order listed:

Open Door:
Step 1: Spawn Fake FF of matching size to the Real FF.
Step 2: Match Fake FF to Real FF in all important ways (position, rotation, grouping, damage level).
Step 3: Delete Real FF (not just move out of the way).
Step 4: Schedule Close Door.

Close Door:
Step 1: Spawn Real FF of matching size to the Fake FF.
Step 2: Match Real FF to Fake FF in all important ways (position, rotation, grouping, damage level).
Step 3: Delete Fake FF (not just move out of the way).

User avatar
Freelancer
ɹǝɔuɐןǝǝɹɟ
Posts: 2045
Joined: Wed Jun 07, 2006 8:41 pm

Re: Cooler Force Field Doors

Post by Freelancer » Sun Nov 16, 2008 9:11 pm

It would be cool if the swung open and closed garage-door style.

unbanmid2
^ prime
Posts: 1376
Joined: Sat Dec 29, 2007 9:55 pm

Re: Cooler Force Field Doors

Post by unbanmid2 » Thu Jan 01, 2009 11:03 pm

the problem with the first idea is you cant shoot projectiles though it when its *open* you can only shoot morters.

garage door swing open is easy.

robindegen
I ril pr0 men
Posts: 6698
Joined: Thu Jul 10, 2003 3:20 pm

Re: Cooler Force Field Doors

Post by robindegen » Fri Jan 02, 2009 6:17 am

unbanmid2 wrote:the problem with the first idea is you cant shoot projectiles though it when its *open* you can only shoot morters.


well that kinda makes sense as a forcefield really. It only lets through the wanted.. and a morter is an unwanted sideeffect.

User avatar
C--
Sorry....
Posts: 3299
Joined: Thu Apr 06, 2006 2:32 pm

Re: Cooler Force Field Doors

Post by C-- » Fri Jan 02, 2009 3:31 pm

unbanmid2 wrote:the problem with the first idea is you cant shoot projectiles though it when its *open* you can only shoot morters.

garage door swing open is easy.



Not really. Assuming that the fake forcefield is that same forcefield but with .disablecollisions = true; , ANY projectile goes through it. I use ghost static-shapes a lot and I know what I'm saying - they let all projectiles through :)

Perrinoia
Suggestion bot 10,000
Posts: 11185
Joined: Sat May 04, 2002 11:00 pm
Location: Rhode Island

Re: Cooler Force Field Doors

Post by Perrinoia » Wed Feb 11, 2009 2:16 pm

Thats OK... It's not a side effect of ghosting, it's a side effect of the door being open. When it's closed, your projectiles collide with it, when it's open, your projectiles travel threw it... either way, it gets damaged by explosions that occur in range and unobstructed. That is the only physical difference between this idea and the current method besides the current method's stray door at "0 0 0". The door appears to be closed when it is not, which is a possible deterant for people who didn't hear the open/close noises.

Post Reply