Trying to make hitmark script for 1.3 / 1.4

User avatar
S_hift
Posts: 1963
Joined: Fri Dec 23, 2011 1:42 pm

Trying to make hitmark script for 1.3 / 1.4

Post by S_hift »

Code: Select all

function Hitmark::OnSound(%Sound) {
   if (Match::String(%Sound, "~button4")){
      newEvent("Hitmark::OnSound" @ %Sound("Hitmark.bmp", 512, 384, 100, 0.8)
   }
}



Not sure were to go from here Image
Some help would be appreciate also I'm pretty new to this whole scripting deal, but I'm willing to learn.
Image <--Click here to subscribe to S_hift's youtube
Click here for full access to all my tribes downloads
User avatar
S_hift
Posts: 1963
Joined: Fri Dec 23, 2011 1:42 pm

Re: Trying to make hitmark script for 1.3 / 1.4

Post by S_hift »

yeah but i want to make one 1.3 and 1.4

I know its possible to make scripts that work on both client versions. I want the script as a standalone so that it can be hosted somewhere and people can use it on whatever config they want with little editing. The one crow has only works on 1.4 and also requires serverside modification.

The ideal one would just wait for the sound to occur, and then draw the desired image file for x amount of time preferably an 8th of a second.


Here is a standalone script for 1.3 and 1.4 that switches to any sniper weapon while zoomed in.
bindCommand(keyboard0, make, "e", TO, "z0ddzoomsnipe::doSnipe();");
bindCommand(keyboard0, break, "e", TO, "z0ddzoomsnipe::unDoSnipe();");

$z0ddzoomsnipe::switchBackToWpn = 0;
$z0ddzoomsnipe::autoCrouch = 0;
$z0ddzoomsnipe::crouchWithoutRifle = 0;
$z0ddzoomsnipe::alwaysZoom = 1;


function psychozoomsnipe::switchback() {
if(getItemCount("Rocket Launcher")) {
use("Rocket Launcher");
}
else if(getItemCount("Disc Launcher")) {
use("Disc Launcher");
}
}


function z0ddzoomsnipe::doSnipe()
{
if(getItemCount("Particle Beam")) {
$z0ddzoomsnipe::ownsLR = 1;
if($z0ddzoomsnipe::autoCrouch)
postAction(2048, IDACTION_CROUCH, 1);
if($z0ddzoomsnipe::switchBackToWpn)
$z0ddzoomsnipe::prevWpn = z0ddzoomsnipe::getCurrentWpn();
use("Particle Beam");
postAction(2048, IDACTION_SNIPER_FOV, 1.000000);
}
else if(getItemCount("Vulcan")) {
$z0ddzoomsnipe::ownsLR = 1;
if($z0ddzoomsnipe::autoCrouch)
postAction(2048, IDACTION_CROUCH, 1);
if($z0ddzoomsnipe::switchBackToWpn)
$z0ddzoomsnipe::prevWpn = z0ddzoomsnipe::getCurrentWpn();
use("Vulcan");
postAction(2048, IDACTION_SNIPER_FOV, 1.000000);
}
else if(getItemCount("Railgun")) {
$z0ddzoomsnipe::ownsLR = 1;
if($z0ddzoomsnipe::autoCrouch)
postAction(2048, IDACTION_CROUCH, 1);
if($z0ddzoomsnipe::switchBackToWpn)
$z0ddzoomsnipe::prevWpn = z0ddzoomsnipe::getCurrentWpn();
use("Railgun");
postAction(2048, IDACTION_SNIPER_FOV, 1.000000);
}
else if(getItemCount("Laser Rifle")) {
$z0ddzoomsnipe::ownsLR = 1;
if($z0ddzoomsnipe::autoCrouch)
postAction(2048, IDACTION_CROUCH, 1);
if($z0ddzoomsnipe::switchBackToWpn)
$z0ddzoomsnipe::prevWpn = z0ddzoomsnipe::getCurrentWpn();
use("Laser Rifle");
postAction(2048, IDACTION_SNIPER_FOV, 1.000000);
}
else if(getItemCount("Chaingun")) {
$z0ddzoomsnipe::ownsLR = 1;
if($z0ddzoomsnipe::autoCrouch)
postAction(2048, IDACTION_CROUCH, 1);
if($z0ddzoomsnipe::switchBackToWpn)
$z0ddzoomsnipe::prevWpn = z0ddzoomsnipe::getCurrentWpn();
use("Chaingun");
postAction(2048, IDACTION_SNIPER_FOV, 1.000000);
}
else if(getItemCount("Minigun")) {
$z0ddzoomsnipe::ownsLR = 1;
if($z0ddzoomsnipe::autoCrouch)
postAction(2048, IDACTION_CROUCH, 1);
if($z0ddzoomsnipe::switchBackToWpn)
$z0ddzoomsnipe::prevWpn = z0ddzoomsnipe::getCurrentWpn();
use("Minigun");
postAction(2048, IDACTION_SNIPER_FOV, 1.000000);
}
else if(getItemCount("Sniper Rifle")) {
$z0ddzoomsnipe::ownsLR = 1;
if($z0ddzoomsnipe::autoCrouch)
postAction(2048, IDACTION_CROUCH, 1);
if($z0ddzoomsnipe::switchBackToWpn)
$z0ddzoomsnipe::prevWpn = z0ddzoomsnipe::getCurrentWpn();
use("Sniper Rifle");
postAction(2048, IDACTION_SNIPER_FOV, 1.000000);
}
else {
if($z0ddzoomsnipe::alwaysZoom)
postAction(2048, IDACTION_SNIPER_FOV, 1.000000);
if($z0ddzoomsnipe::crouchWithoutRifle)
postAction(2048, IDACTION_CROUCH, 1);
$z0ddzoomsnipe::ownsLR = 0;
}
}

function z0ddzoomsnipe::unDoSnipe()
{
postAction(2048, IDACTION_SNIPER_FOV, 0.000000);
postAction(2048, IDACTION_STAND, 1);
if($z0ddzoomsnipe::ownsLR) {
if($z0ddzoomsnipe::switchBackToWpn)

psychozoomsnipe::switchback();
}
}
Image <--Click here to subscribe to S_hift's youtube
Click here for full access to all my tribes downloads
User avatar
S_hift
Posts: 1963
Joined: Fri Dec 23, 2011 1:42 pm

Re: Trying to make hitmark script for 1.3 / 1.4

Post by S_hift »

Update: I talked to perrin and he posted this.

Code: Select all

function onClientMessage(%client, %msg)
{
   if(%client)
      $lastClientMessage = %client;

   // filter messages here
      if(%msg == "~wButton3.wav")
         echo("Blink crosshair or whatever.");
   return true;
}
this is basically just the first half of the script. instead of "echo" would write something like Draw("hitmark.bmp, 800, 600, idk, 0.8"); return true" }

Code: Select all

    function onClientMessage(%client, %msg)
    {
       if(%client)
          $lastClientMessage = %client;

       // filter messages here
          if(%msg == "~wButton3.wav");
         {
          function SetVisible("hitmark.bmp, 512, 384, idk, 0.8 ");
       return true;
    }  
Last edited by S_hift on Wed Dec 03, 2014 5:40 pm, edited 1 time in total.
Image <--Click here to subscribe to S_hift's youtube
Click here for full access to all my tribes downloads
justR
Posts: 382
Joined: Wed Jul 17, 2013 4:06 pm

Re: Trying to make hitmark script for 1.3 / 1.4

Post by justR »

Crow needs to rename these forums shift.thelandofoz.net :]
User avatar
S_hift
Posts: 1963
Joined: Fri Dec 23, 2011 1:42 pm

Re: Trying to make hitmark script for 1.3 / 1.4

Post by S_hift »

hahahaha You ever notice I only shitpost frequently during the night or wintertime?
Image <--Click here to subscribe to S_hift's youtube
Click here for full access to all my tribes downloads
User avatar
S_hift
Posts: 1963
Joined: Fri Dec 23, 2011 1:42 pm

Re: Trying to make hitmark script for 1.3 / 1.4

Post by S_hift »

crow
Attachments
mhud5.zip
(41.46 KiB) Downloaded 51 times
Image <--Click here to subscribe to S_hift's youtube
Click here for full access to all my tribes downloads
User avatar
S_hift
Posts: 1963
Joined: Fri Dec 23, 2011 1:42 pm

Re: Trying to make hitmark script for 1.3 / 1.4

Post by S_hift »

do you think fwrite would work? something like this

fwrite("hitmark.bmp, 512, 384, idk, 0.8 ");


also I found this on some C# tutorial. Might be of use?

Code: Select all

private void showButton_Click(object sender, EventArgs e)
{
    if (openFileDialog1.ShowDialog() == DialogResult.OK)
    {
        pictureBox1.Load(openFileDialog1.FileName);  
    }
}
Image <--Click here to subscribe to S_hift's youtube
Click here for full access to all my tribes downloads
User avatar
S_hift
Posts: 1963
Joined: Fri Dec 23, 2011 1:42 pm

Re: Trying to make hitmark script for 1.3 / 1.4

Post by S_hift »

then I found the tribes holy grail
http://www.ephemeron.org/~bigby/script2/
Image <--Click here to subscribe to S_hift's youtube
Click here for full access to all my tribes downloads
User avatar
DaRk
Posts: 1001
Joined: Sat Jul 27, 2013 4:22 pm
Location: ID, USA

Re: Trying to make hitmark script for 1.3 / 1.4

Post by DaRk »

Just to make it not look like S_hift is talking to himself.
Post Reply