Forum Jump :

Author Message


Posts: 31
Rank:


Level: Member

Country: be
Location: Flanders
Occupation: student
Age:
In-game name:

 
#1 Posted at 2018-03-10 13:44        
     
So I'm making something for a mission and I'd like to have the rounds fired from the praetorian explode when they are close to a certain object. This is what I'm currently doing:


I get the "C-ram fired" text after the praetorian stops firing. I'm thus assuming that the fired eventhandler only triggers after the current burst is completed and not on every round. Anyone have an idea on how to make it that every round it fires is an explosive round? (preferably without a while loop or something like that.)

(It's still WIP so don't mind the horrible naming)

If you're going through hell,
keep going! -W. Churchill

Author Message


Posts: 1513
Rank:


Level: Member

Country: uk
Location:
Occupation:
Age:
In-game name:

 
#2 Posted at 2018-03-10 20:13        
     
You have a few things wrong in the code..

    CRAM addEventHandler ["Fired", { 
          _this spawn { 
             _projectile = (_this select 6);
           
         if (!isnil '_projectile') then { 
               waitUntil { (_projectile distance player) < 15}; 
                 _exp = "SmallSecondary" createVehicle  (position _projectile); 
                deleteVehicle _projectile; 
            }; 
        }; 
    }];


Although it only seems to work if your close to the target or better still if your inside it..

You could have it work all the time by replacing the player reference with the name of the vehicle/target


Advertisement


Author Message


Posts: 31
Rank:


Level: Member

Country: be
Location: Flanders
Occupation: student
Age:
In-game name:

 
#3 Posted at 2018-03-10 21:54        
     
Yea I did a wacky copy paste job, I noticed that a while ago.

This is what I have now:

The thing is that it doesn't give me the hint while the projectile (a titan missile fired over the C-RAM) is flying at or over the C-RAM. And 15 meters is still a pretty big target to hit.

If you're going through hell,
keep going! -W. Churchill

Author Message


Posts: 1513
Rank:


Level: Member

Country: uk
Location:
Occupation:
Age:
In-game name:

 
#4 Posted at 2018-03-11 00:20        
     
OK I didn't realize 'projectile' was the target previously.

if !((_pos select 2) > 2) then { this line seems to be saying if the height of the bullet is greater than 2 meters no explosion but bullets will still fire and not be deleted. If I adjust the Height to 200 then I see secondary and the hint.

Hint"explo"; should read Hint "explo";


Author Message


Posts: 31
Rank:


Level: Member

Country: be
Location: Flanders
Occupation: student
Age:
In-game name:

 
#5 Posted at 2018-03-11 10:07        
     
Yea, i'm an idiot. That line of code is supposed to prevent that rounds explode when bellow 2 meters. I made it do the exact opposite :)

Yea projectile is the missile/rocket that gets fired at or near the CRAM, the CRAM is then trying to take it out before that missile/rocket hits the ground. I tried it with a normal praetorian but it's too inaccurate to actually hit the flying missile/rocket, hence the explosive rounds.

If you're going through hell,
keep going! -W. Churchill





Tags: Praetorian