Forum Jump :

Author Message


Posts: 1
Rank:


Level: Member

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

 
#1 Posted at 2018-03-31 19:17        
     
I'm trying to do this without a script and thought it should be really easy but apparently not.

I am just trying to get a unit to walk up to a civilian unit and kill them.

The unit with the gun is "en1" and the civilian is "cv1".
I've tried putting these codes in a variety of waypoint activations, proximity triggers and radio triggers that I "call-in" all without success.

en1 doFire cv1; - this does absolutely nothing.

en1 commandFire cv1; - this also does absolutely nothing.


I have about a 30% success rate if put the following in radio triggers that I call in:
TRIGGER 1 - RADIO ALPHA
en1 doTarget cv1;

TRIGGER 2 - RADIO BRAVO:
en1 forceWeaponFire ["hgun_Rook40_F", "single"];

I have noticed that "dotarget" only works for about a half second before the "en1" unit moves off target and starts daydreaming... And If I call in the "dotarget" command multiple times then the unit just goes into la-la land and starts looking around for targets in every direction except where "cv1" is located...

I've tried a variety of awareness levels.etc - it does not matter if "en1" is "aware" or "safe", it makes no difference.

I've also tried using an opposing force dressed like a civilian thinking that maybe the AI will never shoot civilians or something? Nope, no difference.

I've also adjusted skill levels but it made no difference.

What am I doing wrong here? Every thread I've been to says "dofire" is the right command but it does not seem to work for me?


Author Message


Posts: 1513
Rank:


Level: Member

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

 
#2 Posted at 2018-04-01 01:32        
     
This should work, it changes the unit side to that of the enemy in this case East.
cvgrp= createGroup EAST; [cv1] joinsilent cvgrp;en1 dotarget cv1

This just gives the unit a negative rating so AI will engage it.
cv1 addRating -50000;en1 dotarget cv1

The problem with those is that all AI will attack the Civ unit as they now see it as a threat.

Other methods just aren't reliable as they don't target and aim correctly at none threats.
It's always been a pain trying to force weapon fire at anything other than an enemy unit.

I think lookat combined with dotarget gives the best aim, then have the weapon fire and also kill the unit just in case it misses.
en1 lookat cv1;en1 dotarget cv1;null=[] spawn {sleep 2; en1 forceweaponfire ["hgun_Rook40_F", "single"];sleep 0.1 ; cv1 setdamage 1}

"Dofire" just seems to be another way to get a unit to aim at a target it doesn't seem to have any effect on actual weapon fire.

"Fire" does make a unit fire the weapon but also seems aimless and slow.

This post was edited by F2kSel (2018-04-01 01:46, 84 days ago)


Advertisement


Author Message


Posts: 135
Rank:


Level: Member

Country: us
Location: Pennsylvania
Occupation:
Age:
In-game name: Xian

 
#3 Posted at 2018-04-01 04:58        
     
Here's a script I've found a little while ago for a firing squad. It's NOT my work but I can't remember who did it:

_firingSquad = [fs_1,fs_2,fs_3,fs_4,fs_5];
{
	_fsWep = currentWeapon _x;
	_x setBehaviour "COMBAT";
	_x setUnitPos "UP";

} forEach _firingSquad;
sleep 1.5;
{
	_fsWep = currentWeapon _x;
	_x forceWeaponFire [_fsWep, "FullAuto"];
	sleep 0.1;
	_x forceWeaponFire [_fsWep, "FullAuto"];
	sleep 0.1;
	_x forceWeaponFire [_fsWep, "FullAuto"];
	sleep 0.1;
	_x forceWeaponFire [_fsWep, "FullAuto"];
	sleep 0.1;
	_x forceWeaponFire [_fsWep, "FullAuto"];
	sleep 0.1;
	_x forceWeaponFire [_fsWep, "FullAuto"];

} forEach _firingSquad;


I simply named all firing squad AI, fs_1,fs_2 etc etc.
Hope it helps!

Also, to get it working, I simply did a lot of tweaks in the editor to position the sights at the AI I wanted killed. You could also had a death part to the end with setDamage.


Author Message


Posts: 8
Rank:


Level: Member

Country: ca
Location:
Occupation: Student
Age: 37
In-game name: 3lockad3

 
#4 Posted at 2018-06-09 20:03        
     
Try the addRating command >here< It used to work for me.