Jump to content

sttosin

Member
  • Content Count

    844
  • Joined

  • Last visited

  • Medals

  • Medals

Posts posted by sttosin


  1. If you use a "killed" event handler, it will only activate when the unit it is assigned to dies. The problem with that is that there's no bullet to attach a camera to, however. Using a "fired" event handler like you have will work, but to me it seems like a lot of work because you're going to have to predict the bullet path and time.

    Just to be clear for everyone else, are you trying to do a sniper elite-esque bullet camera?

    This could be pretty difficult for the reason I explained above, but what you could try doing is using the "killed" event handler and then inside the code you have a "replay" kinda thing

    Not really a sniper type cam. More like how movies are shot where the camera shows the view through the scope but cuts to third person view of the enemy when he is hit. Sometimes showing multiple hits to the enemy as he goes down.

    So when the unit dies I don't attach to bullet, I attach to unit but it spams RPT with warnings, "unit....is dead".

    I also don't want bullet cam 100% of the time or even at all.


  2. I found half of this code on a topic explaining Event handlers and started playing with it while adding a bit more.

    What I want is essentially a script that will zoom in and show enemy after the fatal shot hits as they fall down. I do not want this for every bullet or non fatal hits(So not using HitPart EH).

    The code currently includes the bullet camera because without it, it will complain about "No owner" in the RPT and "Generating ST on the fly is very slow" errors.

    I left that in at this point so you guys can at least test this and see the effect I was going for. Just Run it with a trigger. Any help is appreciated.

    See code:

    setDate [1943, 6, 25, 12, 30]; //

    [] spawn

    {

    while {true} do

    {

    {

    if (_x distance player >50 ) then

    {

    _x addeventhandler ["killed",{

    hint format ["Kill Shot! \n%1 is K.I.A \nKill Distance: %2 meters \nTime of kill: %3/%4/%5 %6:%7",name (_this select 0),player distance (_this select 0),(date select 1),(date select 2),(date select 0),(date select 3),(date select 4)];

    //hintSilent ["Hit!"];

    _shooter = _this select 1;

    _victim = _this select 0;

    if (_shooter == _missile) then {

    //player removeEventHandler ["Fired",0];

    //_TimeOfDeath = time;

    //_CameraTime = time+3;

    //hint format ["His name was %1", name (_this select 0)];

    _null = _this spawn {

    _cam = "camera" camCreate (position _victim);

    _cam cameraEffect ["External", "Back"];

    waitUntil {

    if (isNull _victim) exitWith {true};

    _cam camSetTarget _victim;

    _cam camSetRelPos [0,-3,0];

    _cam camCommit 0;

    };

    sleep 1;

    //_cam cameraEffect ["Terminate", "Back"];

    camDestroy _cam;

    //setAccTime 1;

    };

    };

    }];

    };

    } foreach allunits;

    sleep 1;

    //setAccTime 1;

    };

    };

    player addEventHandler ["Fired", {

    //setAccTime 1;

    _null = _this spawn {

    _missile = _this select 6;

    _cam = "camera" camCreate (position player);

    _cam cameraEffect ["External", "Back"];

    waitUntil {

    if (isNull _missile) exitWith {true};

    _cam camSetTarget _missile;

    _cam camSetRelPos [2,-3,2];

    _cam camCommit 0;

    };

    sleep 2;

    _cam cameraEffect ["Terminate", "Back"];

    camDestroy _cam;

    //setAccTime 1;

    };

    }];


  3. @couto

    Sorry, there was a flub on my end and I forgot to include the settings.hpp file. That's what I fixed and re-uploaded in v0.3.1. You NEED this file in your root A3 folder INSIDE a Folder named 'userconfig'. You can open up the file and turn ON/OFF a few things.

    @MannyRecon

    Make sure you're carrying the "Questrel: SniperBuddy" in your Uniform, or Vest. You can't build your Blind without it. 1 Minute Max? Yikes! I think I'll add more options to the Settings File to allow the player to set whatever value they want. Not sure yet. In extensive testing, the system get super unstable if you mess with the timing though. Its running like an engine in the background. I also recommend you Turn ON the DeBug Hints in the Settings File, so you can see how it's "thinking". It might help clear up a few things. I'll see what I can do....

    Thanks guys!

    Play with six still does not include userconfig file.

×