[T2] Vengeance mod

Oh, you can wait for that... somehow, applying the same calculation to reeling in does not only not work, but it also seems to have messed up plain swinging. The interesting thing is that the two aren't (at least shouldn't be) connected. I'm looking into it. Meanwhile, feel free to update, as I might scrap this version too and try something else.

btw which one do you use now?
 
I think Beta 3 is on there, which is still using the grapple code form Beta 2. The one that pulls you in the direction your pointing, but doesn't drastically alter your direction. Nice smooth use of the grapple. I changed the REEL in to a lower value, but haven't tried it yet (at 3 instead of 5).

I'd like to get the mod at a point where a pickup could occur for some good quality play testing.
 
I would like to know if anyone else is having the same issue with base turrets and vehicles that I am. It may just be me, but if it isnt we are wasting a great deal of time. Tomorrow is friday. No one is going to want to work on this over the weekend although I'm certain no one will want to play T2 over the weekend either. :)
 
I'm so glad you did that Killer, thanks. :) On your server, AA ignores shrikes and plasma takes it out.

It looks like chain and mortar track vehicles also.
 
Last edited:
I am making good progress with the missile launcher btw. I have them tracking a laser atm but still some bugs to work out.
 
ZOD said:
I am making good progress with the missile launcher btw. I have them tracking a laser atm but still some bugs to work out.
That's good, I'm eager to try out the rocket pod. In the mean time, let me please you with this piece of code here:

Code:
// We cancel schedules when player switches to another weapon - 
// WeaponImage::onUnmount and DefaultGame::onClientKilled

datablock TargetProjectileData(GrappleBeam)
{
   directDamage = 0.0;
   hasDamageRadius = false;
   indirectDamage = 0.0;
   damageRadius = 0.0;
   velInheritFactor = 1.0;

   maxRifleRange = 250;
   beamColor = "0.1 1.0 0.1";
								
   startBeamWidth = 0.30;
   pulseBeamWidth = 0.20;
   beamFlareAngle = 3.0;
   minFlareSize = 0.0;
   maxFlareSize = 400.0;
   pulseSpeed = 6.0;
   pulseLength  = 0.150;

   textureName[0] = "special/nonlingradient";
   textureName[1] = "special/flare";
   textureName[2] = "special/pulse";
   textureName[3] = "special/expFlare";
   beacon = false;
};

datablock ItemData(GrapplingHook) : TargetingLaser
{
   image = GrapplingHookImage;
   pickUpName = "a grappling hook";
   computeCRC = false;
};

datablock ShapeBaseImageData(GrapplingHookImage) : TargetingLaserImage
{
   item = GrapplingHook;
   projectile = GrappleBeam;
   usesEnergy = true;
   minEnergy = 5;
   cutOffEnergy = 10;

   stateName[3] = "Fire";
   stateEnergyDrain[3] = 3;
   stateFire[3] = true;
   stateAllowImageChange[3] = false;
   stateScript[3] = "onFire";
   stateTransitionOnTriggerUp[3] = "ReelIn";
   stateTransitionOnNoAmmo[3] = "ReelIn";
   stateSound[3] = TargetingLaserPaintSound;
   //stateTimeoutValue[3] = 2.0;
   //stateTransitionOnTimeout[3] = "Deconstruction";

   stateTimeoutValue[5] = 1.5;

   stateName[6] = "ReelIn";
   stateFire[6] = true;
   stateSound[6] = TargetingLaserPaintSound;
   stateAllowImageChange[6] = false;
   stateScript[6] = "onReelIn";
   stateTransitionOnTriggerDown[6] = "Deconstruction";
   //stateTimeoutValue[6] = 2.0;
   //stateTransitionOnTimeout[6] = "Deconstruction";
};

function GrapplingHookImage::onFire(%data, %obj, %slot)
{
   //error("GrapplingHookImage::onFire(" SPC %data.getName() SPC %obj.client.nameBase SPC %slot SPC ")");
   %p = Parent::onFire(%data, %obj, %slot);
   if(isObject(%p))
   {
      %obj.grapplePos = %p.getTargetPoint();
	$GrapplePoint = %obj.grapplePos;
      %dist = vectorDist(%obj.grapplePos , %obj.getPosition());
      if(%dist > 250)
      {
         %p.delete();
         %obj.lastProjectile = "";
         %obj.grapplePos = "";
         return;
      }
	$ropeLength = %dist;
      %obj.grappleObject();
      %p.schedule(300, "delete");
   }
}

function Player::grappleObject(%obj)
{
   if(isObject(%obj))
   {
      if(isEventPending(%obj.grappleSchedule)) 
         cancel(%obj.grappleSchedule);

      if(%obj.getState() !$= "Dead")
      {
	%pos = %obj.getWorldBoxCenter();
	%dist = VectorLen(VectorSub(%pos, $GrapplePoint));
	%vel = %obj.getVelocity();
	%rad = VectorSub($GrapplePoint, %pos);
	%radx = getWord(%rad, 0); %velx = getWord(%vel, 0);
	%rady = getWord(%rad, 1); %vely = getWord(%vel, 1);
	%radz = getWord(%rad, 2); %velz = getWord(%vel, 2);
	if (VectorLen(VectorSub(VectorAdd(%pos, %vel), $GrapplePoint)) > $RopeLength) {
		%radVel = ((%radx * velx) + (%rady * %vely) + (%radz * %velz)) / %dist;
		%force = VectorScale(VectorNormalize(%rad), %radVel);
		
		%obj.SetVelocity(VectorSub(%vel, %force));

	}


         %obj.grappleSchedule = %obj.schedule(250, "grappleObject");
      }
   }
}

function GrapplingHookImage::onReelIn(%data, %obj, %slot)
{
   if(isObject(%obj))
   {
    //  if(isEventPending(%obj.grappleSchedule)) 
         cancel(%obj.grappleSchedule);

      %dist = vectorDist(%obj.grapplePos , %obj.getPosition());
      if(%dist > 250)
      {
         %data.deconstruct(%obj, %slot);
         return;
      }
      %obj.reelIn();
   }
}

$TractorPower = 10;
function Player::reelIn(%obj)
{
   if(isObject(%obj))
   {
      if(isEventPending(%obj.reelSchedule)) 
         cancel(%obj.reelSchedule);

      if(%obj.getState() !$= "Dead")
      {
	$RopeLength = $RopeLength - $TractorPower;
	%pos = %obj.getWorldBoxCenter();
	%dist = VectorLen(VectorSub(%pos, $GrapplePoint));
	%vel = %obj.getVelocity();
	%rad = VectorSub($GrapplePoint, %pos);
	%radx = getWord(%rad, 0); %velx = getWord(%vel, 0);
	%rady = getWord(%rad, 1); %vely = getWord(%vel, 1);
	%radz = getWord(%rad, 2); %velz = getWord(%vel, 2);
	if (VectorLen(VectorSub(VectorAdd(%pos, %vel), $GrapplePoint)) > $RopeLength) {
		%radVel = ((%radx * velx) + (%rady * %vely) + (%radz * %velz)) / %dist;
		%force = VectorScale(VectorNormalize(%rad), %radVel);
		%force = VectorAdd(%force, VectorScale(VectorNormalize(%rad), -$TractorPower));

		%obj.SetVelocity(VectorSub(%vel, %force));

	}


         %obj.reelSchedule = %obj.schedule(250, "reelIn");
      }
   }
}

function GrapplingHookImage::deconstruct(%data, %obj, %slot)
{
   if (isObject(%obj.lastProjectile))
   {
      %obj.lastProjectile.delete();
      %obj.lastProjectile = "";
   }
   %obj.grapplePos = "";
   if(isEventPending(%obj.grappleSchedule)) 
      cancel(%obj.grappleSchedule);

   if(isEventPending(%obj.reelSchedule)) 
      cancel(%obj.reelSchedule);

   %obj.use(%obj.prevWeapon);
}


function mSgn(%value) {

	if (%value == 0) return "0";
	else return %value / mAbs(%value);
}

Currently the line is quite easy to stretch either by jetting or gravity, but the movement itself is probably the closest I can get to T:V's for a time.

Reeling in is a bit weak imo, but setting it higher caused buggy performance for reasons yet unknown. It's not that bad though, it just takes forever. :)


Sorry about the latency, hope KillerONE isn't tired of updating his server. I'd really like to know how this is functioning in a real game, 'cause I'd hate to leave you guys with some lame buggy crap for a week. :heart:
 
ZOD said:
I am making good progress with the missile launcher btw. I have them tracking a laser atm but still some bugs to work out.


Great. Then I propose the following.

1) Hook - I just looked at the latest hook. Very slightly different from the current hook. Perhaps a little less energetic. Perhaps let's decide by this evening about the hooks. At this point I could use either. I like the extra energy of the current hook, but the new hook's subtlety is interesting.

2) Rocket Pod - Maybe have ZOD finish (if possible) the Pod this evening. Good to hear it's coming along. :)

3) Turret Barrels - Maybe take a look at the AA barrel. Should it track vehicles? It doesnt. (I remember the AA being different than the others in some way. In terms of the target detection mechanism).

4) Friday Pack - Perhaps do a pack on Friday for a pickup test on KillerONES server sometime between Friday and Sunday evening.



Comments?
 
Last edited:
Hook Comments

Beta hook
-------------

I had a nice capping (I'm not a capper) route that used the hook on Titan. The hook made for an interesting exit.

I had a nice 'launch' technique on several maps - kata, titan for example.

Easy (energy) Tarzan swings are not that easy. However, there arent any/many maps in T2 that are similar to the T:V maps that were used to demo the T:V hook. (Lots of overhanging hook points with freespace underneath).


Amadeus hook
--------------

The new hook easy swings well. There arent that many places in T2 to do that.

The 'launch' technique doesnt really work with this hook.

The Titan cap route with hook no longer works.


conclusions
-----------

Beta hook is better as a source of 'speed' and change of direction etc.

The Amadeus hook is better for 'easy' Tarzaning where that is available.



Update
-------

The Amadeus hook can be used in swing cap routes on Titan. The angles are different, the exit speed is lower and the 'launch' range is shorter. But it does work. :)




I will probably update this post.
 
Last edited:
Well, the T:V hook shouldn't allow you to gain speed either, only to change directions. Unfortunately that gravity thing is really disturbing when it comes to vertical swings, I'll do my best to get around it. Just keep in mind that grappling something at x speed and slingshotting yourself in the other direction at 2x speed is not supposed to happen, ever.
 
The code for this new hook has problems. It won;t work properly on a dedicated server because of the use of these two global varibles:

$ropeLength
$GrapplePoint

They affect everyone on the server, not just the player using the grapple. I suggest putting these varibles on the player obj. I have done this but it is not working, and I cannot see why it is not :confused:
 
I see... maybe something like $ropeLength[%obj] would help? I.e. a separated array with the clients' ID's as indices. Might want to delete them in deconstruct() after the grappling event...
 
Amadeu5 said:
Well, the T:V hook shouldn't allow you to gain speed either, only to change directions. Unfortunately that gravity thing is really disturbing when it comes to vertical swings, I'll do my best to get around it. Just keep in mind that grappling something at x speed and slingshotting yourself in the other direction at 2x speed is not supposed to happen, ever.

Excuse me? Even without reel acceleration (fixed length), if you hook and jet it will increase in speed as it pivots. (Which is what I do - or one thing I do with the 'current' hook). Also with reel, even at fixed reel speed, it will shorten the moment arm and increase the tangential speed. (Otherwise you dont conserve energy). With reel acceleration it will accelerate even faster.

I understand you cant do any of this in a passive system. That is, Tarzan couldnt do any of this. :) But Tarzan didnt have a source of 'energy' or big motors on his 'vine' that change the vine length. :)
 
the problem with amadeus' hook is that it takes too long to take effect. this may just be a perception issue due to not being able to see it, but its quite annoying. as for not being able to gain speed with it (t:v hook).. im pretty sure you can. its elastic, with a weak reel in, which means that it should be possible to use the elasticity to gain a bit of speed.

also, why were the physics destroyed? its impossible to maintain skiing over 200-250. vengeance isnt t2 base..
 
DEbig3 said:
the problem with amadeus' hook is that it takes too long to take effect. this may just be a perception issue due to not being able to see it, but its quite annoying. as for not being able to gain speed with it (t:v hook).. im pretty sure you can. its elastic, with a weak reel in, which means that it should be possible to use the elasticity to gain a bit of speed.

also, why were the physics destroyed? its impossible to maintain skiing over 200-250. vengeance isnt t2 base..

The Amadeus hook actually works best with a 'tap' of the fire key and jet. (As I recall). The more you 'fire' the more you interfere with the hook somehow. (So far I like the beta hook a little more even if it probably is a little more energetic than the T:V hook. I can use the Amadeus one). I think people complained about the physics in T:V also. (I think someone mentioned around 300 kph or so in T:V). I read some rationalization about that from KP.
 
Last edited:
JimBodkins said:
The Amadeus hook actually works best with a 'tap' of the fire key and jet. (As I recall). The more you 'fire' the more you interfere with the hook somehow. (So far I like the beta hook a little more even if it probably is a little more energetic than the T:V hook. I can use the Amadeus one). I think people complained about the physics in T:V also. (I think someone mentioned around 300 kph or so in T:V). I read some rationalization about that from KP.
numbers between t:v and t2 mean nothing.. i hit a wall when skiing in this, and when i exploit the hook to get back up around 400, i slow down pretty damn quick (without touching ground). thats not cool.

[edit] oh, also, as far as i can tell, holding the fire key is pointless, since you have to press again to release anyways..

[edit #2] that reminds me, take out the switch to the previous weapon, its extremely annoying (and doesnt fit t:v behavior)
 
Last edited:
DEbig3 said:
numbers between t:v and t2 mean nothing.. i hit a wall when skiing in this, and when i exploit the hook to get back up around 400, i slow down pretty damn quick (without touching ground). thats not cool.

[edit] oh, also, as far as i can tell, holding the fire key is pointless, since you have to press again to release anyways..

[edit #2] that reminds me, take out the switch to the previous weapon, its extremely annoying (and doesnt fit t:v behavior)

With the beta 4 hook, if you hold the fire key you accelerate faster (as I recall). The Beta 4 hook is more energetic and results in MUCH higher speeds.

I was just commenting that others have commented on apparent 'speed' caps in T:V to which KP responded. I believe that is what motivated ZOD to make physics changes. In fact he 'whined' about having to make it 'floaty'.
 
Last edited:
Back
Top