Reversed Sniping Script (Request)

Immanent

Member
So you mean: you would hold down the Laser Rifle fire button, and release the left mouse click button temporarily to fire? Odd.
 

OG_Gutta

New Member
Yup. Someone made a script like that in tribes and it makes sniping a little more easier imo. And thanks for the reference Abandoned. Im about to pm him now.
 

Gheist

King of all Goblins

OG_Gutta

New Member
I'd advise against that. Here's why:
http://forums.legionsoverdrive.com/threads/dear-modifying-community-please-read.2479/
http://forums.legionsoverdrive.com/threads/contacting-developers-please-read.2582/

RockeyRex does read the threads in here though, and he usually posts if he's got the time.

But let's have a look at this. Do you still have that script from Tribes? If yes, post it!

Nah, not anymore. But I can find it for you if you really want it. It might take me a little while to find it though because I cant remember exactly where I found it at. Lol and I read that post about not contacting the Devs for help, but I forgot about it. I already sent the message.
 

Gheist

King of all Goblins
Nah, not anymore. But I can find it for you if you really want it. [...]
Well, it's not me who wants it. ;) But it might help to see how it was done in Tribes to then bring it over to Leejunz. There are quite a few users around here who might be able to do that.
 

OG_Gutta

New Member
Well, it's not me who wants it.

Ok :)

But it might help to see how it was done in Tribes to then bring it over to Leejunz. There are quite a few users around here who might be able to do that.


Here they are. And I found the reverse sniper scripts for both T1 and T2. I have attached the T1 script to this post and here is the link to the T2 script: http://www.tribaloutpost.com/tribes2/scripts/category/controls/page:3 (it was a .vl2 file, so I couldn't attach it.)
 

Attachments

  • reverse_sniper.zip
    1.7 KB · Views: 6

Gheist

King of all Goblins
Code:
// ______________________________________________________________________________
// Reverse Sniper 1.1        By: VéKTöR
// ______________________________________________________________________________

if (include("Writer\\Fire.cs") == notfound) {
    bindCommand(mouse0, make, button0, TO, "Reverse::FirePressed();");
    bindCommand(mouse0, break, button0, TO, "Reverse::FireReleased();");
}

include("Writer\\inventory.cs");

function ReverseSniper::Setup() {
    deletevariables("$Reverse::Enabled*");

    // Set up your reverse sniper prefs here... simply copy the provided text below
    // $Reverse::Enabled[ ] = true;
    // remove the comment part (the double-slases, like //) and enter the
    // name of the weapon you would like to fire "backwards" in the square
    // brackets. Some examples would be
    //
    // $Reverse::Enabled[$Inv::Disc_Launcher] = true;
    // $Reverse::Enabled[$Inv::Blaster] = true;
    //
    // For a complete listing of $Inv::* variable names (weapon names), see
    // writer's Favorites0.cs (included with his script pack)

    $Reverse::Enabled[$Inv::Laser_Rifle] = true;
    $Reverse::Enabled[$Inv::IX_2000_Sniper_Rifle] = true;
    $Reverse::Enabled[$Inv::Railgun] = true;
}
Event::Attach(eventInventoryTableReady, ReverseSniper::Setup);

function ReverseSniper::OnFire(%weapon) {
    if ($Reverse::Enabled[%weapon]) {
        return mute;
    }
}
event::attach(eventFirePressed, ReverseSniper::OnFire);

function ReverseSniper::OnRelease(%weapon) {
    if ($Reverse::Enabled[%weapon]) {
        Event::Trigger(eventWeaponFired, %weapon);
    }
}
event::attach(eventFireReleased, ReverseSniper::OnRelease);

// Blatantly ripped from fire.cs just in case ther recipient doesnt have it set up
// -------------------------------------------------------------------------------
function Reverse::FirePressed()
{
    %weapon = getMountedItem(0);

    Event::Trigger(eventFirePressed, %weapon); // %weapon will be -1 if no weapon mounted

    if( !Event::Returned(eventFirePressed, mute) )
    {
        postAction(2048, IDACTION_FIRE1, -0);
        Event::Trigger(eventWeaponFired, %weapon);
    }
}

function Reverse::FireReleased()
{
    %weapon = getMountedItem(0);

    Event::Trigger(eventFireReleased, %weapon); // %weapon will be -1 if no weapon mounted

    if( !Event::Returned(eventFireReleased, mute) )
    {
        postAction(2048, IDACTION_BREAK1, -0);
        Event::Trigger(eventWeaponBreak, %weapon);
    }
}
_____________________________________________________________________________
Reverse Sniper 1.1 By: VéKTöR
_____________________________________________________________________________

Requires:
Writer's Script Pack

This script was written for TF players. For all of you who prefer to have sniper
weapons fire when you release the mouse button (or whatever you use) than when
you press it down, this is for you.

Basically, this script fires when you let go of your fire key instead of when you
press it.

To install this script, simply unzip this .zip file to your Tribes\Config folder.
Make sure you use path info, otherwise things won't into the right folders, and the
script will not work.

Once you unzip it, add the following line to the bottom of your autoexec.cs file:

include("VeKToR\\Reverse_Sniper.cs");

Finally, IF you want to define a custom list of weapons that behave in the "old TF"
style, open the Reverse_sniper.cs file in notepad (or UltraEdit, or whatever you
use) and look near the top for instructions

Make sure you have Writer's latest script pack before running this one, as it relies
on his Fire.cs to operate.
I think if you're able to provide said Fire.cs too, we're on a good way. Get on it, Scriptmonkeys! ;)
 

Gheist

King of all Goblins
Nah, basically everyone who's got more knowledge of TorqueScript than me (which isn't a hard thing to achieve to be honest. I can only just read and modify it, actual scripting is beyond me so far ;)). I'm thinking about guys like Armageddon or NightHawk043 for example.
 

RockeyRex

Legions Developer
RockeyRex is the guy you would wanna ask.
I...

...*sigh*

Code:
package reversesniper
{
   function fire(%val)
   {
      if(%val && ($ActiveWeapon $!= "Rifle"))
      {
         $mvTriggerCount0++;
      }
      else if (!%val && ($ActiveWeapon $= "Rifle"))
      {
         $mvTriggerCount0++;
      }
   }
};
activatepackage(reversesniper);
...Didn't test...
 

OG_Gutta

New Member
I...

...*sigh*

Code:
package reversesniper
{
  function fire(%val)
  {
      if(%val && ($ActiveWeapon $!= "Rifle"))
      {
        $mvTriggerCount0++;
      }
      else if (!%val && ($ActiveWeapon $= "Rifle"))
      {
        $mvTriggerCount0++;
      }
  }
};
activatepackage(reversesniper);
...Didn't test...
Im really sorry about the whole situation RockyRex. I should have took the time that you had available into consideration before I asked you to make the script. Thanks for taking the time to make the script anyway though. I really appreciate it. But, one question. What file do I copy the script into?
 

Synista

Member
Im really sorry about the whole situation RockyRex. I should have took the time that you had available into consideration before I asked you to make the script. Thanks for taking the time to make the script anyway though. I really appreciate it. But, one question. What file do I copy the script into?
Notepad it, then save it in autoexec... C:\Users\Jason\Desktop\live\mods\autoexec
 

Arch

Legions Developer
Make sure it is a .cs file.

I tried it and got an error about executing "Main.cs".
 

RockeyRex

Legions Developer
Code:
package reversesniper
{
  function fire(%val)
  {
      if(%val && ($ActiveWeapon !$= "Rifle"))
      {
        $mvTriggerCount0++;
      }
      else if (!%val && ($ActiveWeapon $= "Rifle"))
      {
        $mvTriggerCount0++;
      }
  }
};
activatepackage(reversesniper);

"oops"
Should compile now. Still, didn't test.
 

OG_Gutta

New Member
Code:
package reversesniper
{
  function fire(%val)
  {
      if(%val && ($ActiveWeapon !$= "Rifle"))
      {
        $mvTriggerCount0++;
      }
      else if (!%val && ($ActiveWeapon $= "Rifle"))
      {
        $mvTriggerCount0++;
      }
  }
};
activatepackage(reversesniper);

"oops"
Should compile now. Still, didn't test.
Do I still put this in a "autoexec.cs" file? Or does it go into the "main.cs" file?
 

Armageddon

Teapot
no, neither.

Make a new .cs file and paste the script into it.
Save as ReverseSnipe.cs or something.
Then place the .cs file in mods/autoexec folder.

or make the new .cs file into a zip and slap it in your live folder, but i would go for the autoexec folder method if you're use to how tribes ran scripts.
 
Top