Jump to content

Recommended Posts

Hello arma community,

I have a little question concerning the DoTarget command.

Now before you start bashing me with comments like 'look in the forums', or , 'google is your friend'.

I've been there and done that..litterally.

I've searched the arma forums and all of google.

Now for the question:

I want to make a person (barbie) with a rifle aim at another person (ken).

Now I've tried to do the following in a trigger in the on act field:

barbie doTarget ken;

now Barbie does aim at Ken for a second or so but then lowers her I want her to keep aiming at Ken.

Is there a way to do this?

Thanks in advance.

(ps: names are used as an example..feel free to use your own names ;) )

Share this post


Link to post
Share on other sites

Make Ken an enemy but make Barbie hold her fire.

Share this post


Link to post
Share on other sites

well..the reason I didn't make ken an enemy is that my barbies who are approacing Ken shouldn't run away to cover because they think it's the enemy.

(Ken is actually friendly)

Share this post


Link to post
Share on other sites

Use this disableAI "FSM" on the barbies to prevent them from running away. Requires beta patch.

Share this post


Link to post
Share on other sites
Use this disableAI "FSM" on the barbies to prevent them from running away. Requires beta patch.

I don't think you got it:

Ken is actually friendly

so let's say we have a couple of blufor guys and one civilian.

The civilian isn't an enemy to the blufor guys but still I want them to target the civilian without firing.

Sorry if i'm being difficult..

Share this post


Link to post
Share on other sites

its basically the same reason why my AI tank stops for the wittle wabbit crossing the road, they love all life that is not directly shooting at them ;)

you will not get your effect without using enemy sides, you can for example just addrating alot of -90000 then the unit will be enemy to all so you can time the actual "enemy" part, also turn it back off again with giving positive addrating.

Edit: or just screw the AI, and use animations instead and coreograph your own apprehention part.

use animation viewer from armaholic to view and find all kinds of animations.

Edited by Demonized

Share this post


Link to post
Share on other sites
its basically the same reason why my AI tank stops for the wittle wabbit crossing the road, they love all life that is not directly shooting at them ;)

you will not get your effect without using enemy sides, you can for example just addrating alot of -90000 then the unit will be enemy to all so you can time the actual "enemy" part, also turn it back off again with giving positive addrating.

Edit: or just screw the AI, and use animations instead and coreograph your own apprehention part.

use animation viewer from armaholic to view and find all kinds of animations.

ok I understand, but wouldn't giving it positive rating just turn everything back to like it was before (as in the soldiers not aiming at the target)?

anyway demonized and celery thanks already for the info

Share this post


Link to post
Share on other sites

yeah positive rating, well ( above -2000) is considered normal(whatever side relations in your mission).

less than -2000 is enemy (to all - important)

Share this post


Link to post
Share on other sites

uhu been playing around with it and it has the desired effect.

Now you've already answered my question but do you happen to know the following:

I enable the lasers of my men who are targeting the civilian by using triggers, each with a different timeout.

Now when I activate the trigger they still turn on together (no matter if I choose timeout or countdown.

You don't have to answer it you've already helped me alot.

Thanks :)

Share this post


Link to post
Share on other sites

There's a bug or something for doTarget and it doesn't hold the weapon up anymore. It's freaking annoying and it used to

.

Share this post


Link to post
Share on other sites

Barbie setUnitPos "UP";
Barbie setBehaviour "COMBAT";
Barbie lookAt Ken;
Barbie doTarget Ken;

This would be my suggestion.

I enable the lasers of my men who are targeting the civilian by using triggers, each with a different timeout.

Now when I activate the trigger they still turn on together (no matter if I choose timeout or countdown.

Put this in your trigger activation:

{_x spawn {sleep (random 10); _this enableIRLasers true}} forEach [barbie, Midge, Christine, Steffi];

Change the random 10 to whatever delay you want, and alter the names of Barbie's girlfriends if needed. ;)

Edited by Clayman

Share this post


Link to post
Share on other sites

dotarget was messed up the last time I tested it. its like it aims but then does not stay aimed.

I havent tested the aimedattarget command but it should be possible to give the dotarget and use the aimedattarget value to determine how well the weapon is aimed at the target. At the instant it is aimed perfectly a disableAI "Anim" command can be given and the weapon should hold in place as the unit has no ability to do any animations at all. It will take playmove and switchmove animations (at least the last time I checked) so the unit could be told to move forward or back and should hold the weapon in place. Then enableAI "anim" will put it back to normal. Its probably a little too complex for your idea OP but I thought it was useful information anyway.

Share this post


Link to post
Share on other sites
There's a bug or something for doTarget and it doesn't hold the weapon up anymore. It's freaking annoying and it used to work just fine.

looks like it worked indeed..do you know if they have a ticket for this?

I don't know how to make a ticket/bugtracker so that's why i'm asking.

Code:

Barbie setUnitPos "UP";

Barbie setBehaviour "COMBAT";

Barbie lookAt Ken;

Barbie doTarget Ken;

This would be my suggestion.

Well you still end with using "doTarget Ken"--> same issue; the rifle is lowered

thanks anyway :)

dotarget was messed up the last time I tested it. its like it aims but then does not stay aimed.

I havent tested the aimedattarget command but it should be possible to give the dotarget and use the aimedattarget value to determine how well the weapon is aimed at the target. At the instant it is aimed perfectly a disableAI "Anim" command can be given and the weapon should hold in place as the unit has no ability to do any animations at all. It will take playmove and switchmove animations (at least the last time I checked) so the unit could be told to move forward or back and should hold the weapon in place. Then enableAI "anim" will put it back to normal. Its probably a little too complex for your idea OP but I thought it was useful information anyway.

Well I tried this code before:

barbie dotarget ken;disableAI "Anim"

somehow it didn't work, I guess it only works when you actually say playmove...

Its probably a little too complex for your idea OP
uhu but thanks for the info anyway ;)

Share this post


Link to post
Share on other sites

There is a little bug in the dofire command that you could use.

shootername dofire targetname;

Just make sure the unit you give the dofire command to carn't see the target unit when it's issued. He will now turn and raise his weapon and track the target but won't fire.

Currently broken target and fire commands seem to be

dofire

dotarget

useweapon

Does anyone have anymore?

Edited by F2k Sel

Share this post


Link to post
Share on other sites

i think that the laser thing is just a group thing same as setBeheaviour.

Share this post


Link to post
Share on other sites

If you're having trouble with the AI lowering their weapon, try this (make sure barbie starts facing ken):

barbie disableAI "ANIM";
barbie playMove "AmovPercMstpSrasWrflDnon"; // assuming it's a rifle barbie is aiming, if not replace Wrfl with Wpst for a pistol
barbie doTarget ken;

Just remember to enableAI "ANIM" barbie if he(she?) needs to move afterwards.

Share this post


Link to post
Share on other sites
There is a little bug in the dofire command that you could use.

shootername dofire targetname;

Just make sure the unit you give the dofire command to carn't see the target unit when it's issued. He will now turn and raise his weapon and track the target but won't fire.

Currently broken target and fire commands seem to be

dofire

dotarget

useweapon

Does anyone have anymore?

can't use the dofire command as it isn't certain that will work because it's a bug

Thanks anyway

i think that the laser thing is just a group thing same as setBeheaviour.

will have to work around it.

If you're having trouble with the AI lowering their weapon, try this (make sure barbie starts facing ken):

barbie disableAI "ANIM";
barbie playMove "AmovPercMstpSrasWrflDnon"; // assuming it's a rifle barbie is aiming, if not replace Wrfl with Wpst for a pistol
barbie doTarget ken;

Just remember to enableAI "ANIM" barbie if he(she?) needs to move afterwards.

Put this in your trigger activation:

{_x spawn {sleep (random 10); _this enableIRLasers true}} forEach [barbie, Midge, Christine, Steffi];

thanks will try it :)

Edited by sarge4267

Share this post


Link to post
Share on other sites

ok so far the best result I got was by placing a hold waypoint with never fire.

After the waypoint I used a trigger with addrating -9000.

This makes the characters target the supposed target.

The laser bit:

{_x spawn {sleep (random 10); _this enableIRLasers true}} forEach [barbie, Midge, Christine, Steffi];

works perfectly thanks for that!

then this one:

shootername disableAI "ANIM";  
shootername playMove "AmovPercMstpSrasWrflDnon"; 
shootername doTarget targetname;

since you disable the anim, the character isn't ableto move anymore.

Therefore dotarget doesn't work anymore--> tested this by turning the shooter away from the target.

Thanks everyone for all your help! much appreciated!

(and thanks for the fast replies)

Edited by sarge4267

Share this post


Link to post
Share on other sites

shootername disableAI "ANIM";  
shootername playMove "AmovPercMstpSrasWrflDnon"; 
shootername doTarget targetname;

since you disable the anim, the character isn't ableto move anymore.

Therefore dotarget doesn't work anymore--> tested this by turning the shooter away from the target.

Of course. You never mentioned the target was moving. It's also why I said to make sure the shooter is facing the target first.

Share this post


Link to post
Share on other sites
Of course. You never mentioned the target was moving. It's also why I said to make sure the shooter is facing the target first.

I indeed forgot to say it was moving.

 It's also why I said to make sure the shooter is facing the target first.

I read it but had forgotten about it :)

thanks mate ;)

Share this post


Link to post
Share on other sites

This is a whole heap of workarounds instead of BIS just changing doTarget to leaving the damn gun aimed at the target like it used to...

Share this post


Link to post
Share on other sites
This is a whole heap of workarounds instead of BIS just changing doTarget to leaving the damn gun aimed at the target like it used to...

indeed..this can't be used if you want for example 4 men to target 4 other men who are moving

When I use addrating -9000 then they all pick one target, when it's dead the second one and so on...not each one target.

With dotarget this would be possible.

Do you know how the ticketing system works to post bugs?/do you know if it's already been reported?

Share this post


Link to post
Share on other sites

I've put up a ticket feel free to add to it and correct me if I have it wrong.

I've actually put a few tickets up but without support nothing will happen.

Dotarget only works for a second

http://dev-heaven.net/issues/22724

DoFire doesn't fire

http://dev-heaven.net/issues/22725

Useweapon action causes unit to place weapon on the ground

http://dev-heaven.net/issues/20459

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×