Forum Jump :

Author Message


Posts: 40
Rank:


Level: Member

Country: dk
Location:
Occupation: Trucker
Age:
In-game name:

 
#1 Posted at 2017-03-22 20:28        
     
i want to make some action around my base and the idea is to make a V-44 X Blackfish VTOL make a gunrun at a Opfor car, so it looks like it is doing some target training.

i have tried DoFire and DoTarget found at Bi Wiki and also ForceWeaponFire but i do not understand where to put the text,

https://community.bistudio.com/wiki/forceWeaponFire

https://community.bistudio.com/wiki/doFire

https://community.bistudio.com/wiki/doTarget

is the pages i have been looking at but i do not understand it..

It is better to burn out than fade away.

Author Message


Posts: 1589
Rank:


Level: Member

Country: pf
Location: Tahiti
Occupation: too many Arma
Age: 57
In-game name: Kobayashi Maru

 
#2 Posted at 2017-03-23 21:20        
     
Making a unit firing at something, even an enemy, is some of the most difficult things on Arma because your script will always be "overridden" by Arma's engine.
Anyway, let's say you have a waypoint ("move" is the simplest and OK) to fly by the enemy car.
Let's say also, this car has a "careless" behavior just to avoid it hiding somewhere! Yes Arma engine does that!

As your blackfish has no centered gun but only fitted on side of the aircraft, it will be a pain in the b.. to obtain a clear aiming for the gunner.

What I did, and it works sometimes but not 100%, is to script something like:
0 = [] spawn {
  while {alive gunship1 && alive car1} do {
    group gunship1 reveal [car1,4];
    gunner gunship1 lookAt car1;
    gunship1 doWatch car1;
    gunner gunship1 doTarget car1;
    if (gunship1 aimedAtTarget [car1] > 0) then {
     gunship1 fireAtTarget [car1]
    };
  };
};

PLEASE CONTACT ME ON BI FORUMS FOR ANY SCRIPT / MOD QUESTION. TKS

Advertisement


Author Message


Posts: 40
Rank:


Level: Member

Country: dk
Location:
Occupation: Trucker
Age:
In-game name:

 
#3 Posted at 2017-03-24 12:07        
     
Hey pierre

Glad you did take some time to help me, but how do i get it to work.

Do i have to type it in my init file or the waypoints init field ???

Or shall i write it inside the heli Init field

It is better to burn out than fade away.

Author Message


Posts: 1589
Rank:


Level: Member

Country: pf
Location: Tahiti
Occupation: too many Arma
Age: 57
In-game name: Kobayashi Maru

 
#4 Posted at 2017-03-24 16:18        
     
Where you want in fact. The aim is to make this script run (once in MP).
So, a trigger (without any condition, server only) does the job,
or in initServer.sqf (to be created in mission root if not yet created),
or in init field of any AI unit/object, but it's preferable to place it in gunship for better understanding,
or in a waypoint completion before you need it, of course...
For MP, just add if (isServer) then { while {alive.... }}}} (an extra } at the end), just to avoid script duplication at each player joining game.

But as I said, the result can be poor due to the position of the guns on gunship. I'm not sure you can do better. That's the reason why I decided to answer you after some days.

PLEASE CONTACT ME ON BI FORUMS FOR ANY SCRIPT / MOD QUESTION. TKS

Author Message


Posts: 40
Rank:


Level: Member

Country: dk
Location:
Occupation: Trucker
Age:
In-game name:

 
#5 Posted at 2017-03-24 20:59        
     
hey Pierre

You are right about the gunship is a bad choice, it flies around for 5 min and it has it guns the other way, it goes round with the target (car1) on the side with no guns.. :-| so no chance for a shot at the target..

I have change the gunship to another heli and it does the job.

It is better to burn out than fade away.