Home   Help Search Login Register  

Author Topic: better machine gunners  (Read 1982 times)

0 Members and 1 Guest are viewing this topic.

Offline paddy

  • Contributing Member
  • **
  • Llama whipping good
Re:better machine gunners
« Reply #15 on: 11 Sep 2005, 15:46:03 »
I dont think anyone ever found a solution to that problem.  I use dowatch/dotarget and the unit still seems to shoot in the air.  Try these commands and c if they work 4 u.

If not I assume you are using the fire command with a multiple string i.e.

Code: [Select]
soldierOne fire ["throw","SmokeShell","SmokeShell"]
If you are I would suggest you try instead using the fire command the other way

Code: [Select]
soldierOne fire "HandGrenade"
For me this doesn't make the unit fire up in the air.  If I can i'll dig up a script  as an example for u, but remember if you want sustained fire to set up a small loop that will repeat so many times before ending.

Hope some of that works for you.  :P

- Paddy

Offline 456820

  • Contributing Member
  • **
Re:better machine gunners
« Reply #16 on: 11 Sep 2005, 20:15:49 »
erm no its the second fire command this is the script wich Kyle Sarnik posted

_gun = _this select 0

_ammo = nearestobject [_gun,_this select 4]

_x = (velocity _ammo select 0)+(random(20)-random(20))
_y = (velocity _ammo select 1)+(random(20)-random(20))
_z = (velocity _ammo select 2)+(random(20)-random(20))

_ammo setvelocity [_x,_y,_z]

? (gunner _gun) == player : exit

? skill (gunner _gun) <= 0.5 : (gunner _gun) setskill 1; exit
(gunner _gun) setskill (skill (gunner _gun) - 0.1)
_gun fire (_this select 2)
exit

its ran through an Event handler
it says _gun fire (_this select 2) where _gun is the soldier who fired it and _this select 2 is the gun thats being fired the fire with a string canot use dotarget and dowatch but with teh second one you can but i cant find out hwat soldier is getting fire at since an Event handler doesnt return the soldier who is getting fired at
unless you know a way of finding out who is getting fired at then im going to have to do a very long way of this like grab the bullet find out where it lands then create a game logic or something that a unit fires at and then get the soldier to fire at it but even then its not firing at the soldier

any ideas would be great

also
Quote
For me this doesn't make the unit fire up in the air.
well thats whats happening for me they fire a burst then shoot up in the air a few times you can use dotarget with this command and they will fire at what there targetting but thats not working here

Kyle Sarnik

  • Guest
Re:better machine gunners
« Reply #17 on: 11 Sep 2005, 23:18:38 »
Try changing where it says (_this select 2) to (_this select 1)...  ::)
« Last Edit: 12 Sep 2005, 20:36:22 by Kyle Sarnik »

Offline paddy

  • Contributing Member
  • **
  • Llama whipping good
Re:better machine gunners
« Reply #18 on: 12 Sep 2005, 15:51:18 »
Ah Kyle, leave us alone.  We may not have achieved your scripting brilliance yet but we're getting there.  My avatar sure does drink alot of coffee ...  :P

Offline 456820

  • Contributing Member
  • **
Re:better machine gunners
« Reply #19 on: 15 Sep 2005, 20:29:50 »
nope just got round to trying it again and doesnt work they seem to fire a lot more wich is good but still directly in the air.
Is there anyway i can find out what position the units targetting like height the units aiming then the Dir ?

Kyle Sarnik

  • Guest
Re:better machine gunners
« Reply #20 on: 15 Sep 2005, 20:52:48 »
Is there anyway i can find out what position the units targetting like height the units aiming then the Dir ?

 :'( No, but I alot of people agree with me I say I wish there was :-\