Author Topic: AoT Hook Code  (Read 3103 times)

I've been tinkering around with Badspot's AoT hook code, which he's posted here.

I've gotten it working completely, but I need to know how you'd actually break the hook midair, like when you press C in AoT.

Is there a way to do it, and if so, what is it? Or is it not possible with the version of the code posted there? (I'm directing this at anyone who's used the code before, which I believe is three people: Badspot, Jookia and Rudyman.)

You'd set the hook length to -1.

Oh, I see. Thanks for the quick reply Ephi :)

Nice avatar Ephialtes, reminds me of that RTB map 'The Islands'

I've been tinkering around with Badspot's AoT hook code, which he's posted here.

I've gotten it working completely, but I need to know how you'd actually break the hook midair, like when you press C in AoT.

Is there a way to do it, and if so, what is it? Or is it not possible with the version of the code posted there? (I'm directing this at anyone who's used the code before, which I believe is three people: Badspot, Jookia and Rudyman.)
Hmm, that hook code requires .cc files, how are they used? Would it work if a .cc or something like that was put into Blockland?

DO WANT BLOCKLAND HOOK :D

You'd need the source code of Badspot's version of the Torque Game Engine, and then recompile it with the changes shown in that GarageGames topic for the .cc side of things.

I has something like this, except it's got no visible wire. Oh, and it has a set 'length' for the rope.


It's working perfectly, but now I'm having sound function crashing.

%client.player.playAudio(0, hookDisable);

That crashes the game, for some reason. Yes, I do have the right audio profile called "hookDisable".

datablock AudioProfile(hookDisable)
{
   filename    = "~/data/sound/click.wav";
   description = AudioClosest3d;
   preload = true;
};

Take out the sound datablock and command. It's not needed for it to function.

Also, make sure it's pointing to the right .wav.

I has something like this, except it's got no visible wire. Oh, and it has a set 'length' for the rope.
And it lags like hell.
<3 Aloshi :cookieMonster:

Nevermind. I moved the hookDisable datablock elsewhere in the scripts and it stopped crashing.

I'm making a gravity-gun like carrying function (Like Portal's weighted cube carrying).

I probably have absolutely no idea what I'm doing here.

Code: [Select]
function pushModeProjectile::onCollision(%this,%obj,%col,%fade,%pos,%normal)
{
   if(%col.getClassName() $= "WheeledVehicle")
   {
      %pos1 = getWord(%pos, 0);
      %pos2 = getWord(%pos, 1);
      %pos3 = getWord(%pos, 2);
      %pos1 = %pos1 + 0.5;
      %pos2 = %pos2 + 0.5;
      %pos3 = %pos3 + 0.5;
      %col.setTransform(%pos1 SPC %pos2 SPC %pos3);
   }
}

It does work, although only for a while before the crate bounces off completely (The pushMode weapon is rapidfire). It's quite buggy. Yes, I'm using vehicles for the crate physics.

Anyone think of a better way to do this?

When you fire, shoot one 'crate check' projectile, set image ammo to "1" and a player "carry" variable to the crate ID when it hits and use the state system to execute a script every 100ms which moves the crate to the nearest free position in a raycast 4-5 studs away. When you release the trigger, set ammo to 0 and stop the crate being moved.

If you're unsure what I mean (pretty confusing stuff) I could try and make a "gravity gun" weapon using the printer model and a scaled Ball. (I can't model)

When you fire, shoot one 'crate check' projectile, set image ammo to "1" and a player "carry" variable to the crate ID when it hits and use the state system to execute a script every 100ms which moves the crate to the nearest free position in a raycast 4-5 studs away. When you release the trigger, set ammo to 0 and stop the crate being moved.

If you're unsure what I mean (pretty confusing stuff) I could try and make a "gravity gun" weapon using the printer model and a scaled Ball. (I can't model)
Thanks man, I set out reading up on RTB's E command and discovered how raycasts work, now it's working nicely. I might even port it to Blockland.

It's rather shaky though, so I want to ask, how do you make it stop moving/start moving?

I finished the code (I was testing earlier), I'll be posting it in a bit.