Home   Help Search Login Register  

Author Topic: Getting a unit to fire upon command everytime!  (Read 753 times)

0 Members and 1 Guest are viewing this topic.

teeBore

  • Guest
Getting a unit to fire upon command everytime!
« on: 06 Feb 2003, 16:16:34 »
Basically what I am trying to do is make a cutscene where the cam is focussed upon a target, and a sniper in the distance fires when told to and kills the target, or at least make it seem like this is happening. :)

Below are the commands I have tried to use to get the sniper to fire upon his target. I have tried them but they do not whether in any order or combination work correctly everytime, ie sometimes he doesn't fire, sometimes he fores a few seconds aftewr and usually misses :P

Code: [Select]
sniper doWatch man
sniper doTarget man
aniper doFire man
sniper fire ["SVDDragunov", "SVDDragunov"]
sniper setCombatMode "YELLOW"

If there is no way around this, I would like to have a sniperrifle firing sound play and do a 'man setDammage 1' on the target to kill him at the right time. I am unsure how to play sounds that are already in the game, so is there a list of in-game strings that correspond to sounds that I would have to load into my map to use, or is there any other way?

Oh yeah, what would be nice is to implement a sniper crosshair view as seen in the first level of resistance, if anyone coule help me there too.  ;D

Oh yeah another thing :), how do I get my officer with binoculars to take them out and hold them out while lying down?? Ive tried the 'officer playmove LyingToBinocsLying' command, but he puts them away as soon as he takes them out.....

phew :-\
Cheers,
teeBore

cpt.Hawkeyez

  • Guest
Re:Getting a unit to fire upon command everytime!
« Reply #1 on: 07 Feb 2003, 03:29:20 »
try this

Code: [Select]
sniper dofire man
~0.05
man setdammage 1
there that way even if your sniper misses the guy will still drop dead as if he was shot. also about the sniper crosshair view check out the official ComRef for info on switchcamera the code is
Code: [Select]
sniper switchCamera "gunner"
that will make the camera go to the sniper view of the sniper and then use
Code: [Select]
sniper dotarget man
before you call up the switch camera command so he is already targeted the man than make him fire and kill ht eguy just incase he misses. Hope that helps if it doesnt post the problem here.

cpt.Hawkeyez

  • Guest
Re:Getting a unit to fire upon command everytime!
« Reply #2 on: 07 Feb 2003, 03:30:33 »
mess around with the
~0.05 to get the right timing so it looks like hes dieng right when he get shot thats not the right timing i know it.

CymPaTheeY

teeBore

  • Guest
Re:Getting a unit to fire upon command everytime!
« Reply #3 on: 07 Feb 2003, 06:03:57 »
:thumbsup:

Orright, sounds good fellas, I think I solved the problem of the sniper not firing when and exactly when I wanted him to, I used 'sniper disableAI true', which helped, but what I think the problem may be is that he is not 'aware' of the targets even if you give him the 'sniper doTarget man' command.

For my mission I have two targets, which the sniper didnt fire at everytime.
To combat this, at the beginning of the script i used

'sniper doTarget man1'
then later
'sniper doTarget man2'
~1
'sniper doFire man2'
'sniper doTarget man1'
~1
'sniper doFire man1'

(the ~1 second is to allow for the targeting)

The main difference here is I have targetted both men before firing upon any of them, and now the sniper fires everytime for me! (Just something to try)

teeBore

  • Guest
Re:Getting a unit to fire upon command everytime!
« Reply #4 on: 07 Feb 2003, 06:12:30 »
Yeah, the sniper usually hits the pilot first time, but may not kill him, so this code kills him when he's shot, (run in the man's init field)
Code: [Select]
_man = _this select 0

#getdamage

? (getDammage _man) > 0 : goto "kill"
goto "getdamage"

#kill
_man setDammage 1

exit