Home   Help Search Login Register  

Author Topic: Firemode  (Read 657 times)

0 Members and 1 Guest are viewing this topic.

Offline The-Architect

  • Former Staff
  • ****
  • Bite my shiny metal...
    • Bob's Un-official Flashpoint Page
Firemode
« on: 06 Sep 2005, 23:45:56 »
I've been searching but I think I'm not looking right because I can't find it.

How do I set a gun to fire on automatic?

James Andrew Wilkinson 1977 - 2005 R.I.P.
"If it ain't the friggin' incoming it's the friggin' outgoing. Only difference is who gets the friggin' grease, and that ain't no friggin' difference at all."

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:Firemode
« Reply #1 on: 06 Sep 2005, 23:47:49 »
I don't know.  But could you give the player a {fired} EH to report out on what mode has been used and then just fire a weapon on automatic?  That should at least give you the mode.
« Last Edit: 06 Sep 2005, 23:48:10 by THobson »

Offline The-Architect

  • Former Staff
  • ****
  • Bite my shiny metal...
    • Bob's Un-official Flashpoint Page
Re:Firemode
« Reply #2 on: 06 Sep 2005, 23:51:04 »
Nah, I have a ZU23 which the stupid AI fires like a woman. I want a steady stream of fire from it.
I know there's burst and semi or something. I've read about this that's why it's frustrating that I can't find it.
James Andrew Wilkinson 1977 - 2005 R.I.P.
"If it ain't the friggin' incoming it's the friggin' outgoing. Only difference is who gets the friggin' grease, and that ain't no friggin' difference at all."

Offline Morglor9

  • Members
  • *
Re:Firemode
« Reply #3 on: 07 Sep 2005, 00:43:56 »
It's in the way that AI work in games. Rather than firing a bunch of shots and having maybe 1/5 hit, they would rather fire one computer-calculated shot that is almost garunteed to hit you. This is also why it seems like the AI have an advantage and kill you right away. You never know, they may have been trying to draw a good enough bead on you for a while.
Cymbaline

Offline Sui

  • Former Staff
  • ****
    • OFPEC
Re:Firemode
« Reply #4 on: 07 Sep 2005, 02:46:44 »
The fire mode for automatic (as found by eventhandler format hint) is "fullauto"

However I've never been able to get the AI to fire using it... the best I ever came up with was:
Quote
#loop
~0.5
unit fire [ muzzle, mode, magazine ]
goto "loop"

Not an idea solution unfortunately... :P
« Last Edit: 07 Sep 2005, 02:47:24 by Sui »

Offline The-Architect

  • Former Staff
  • ****
  • Bite my shiny metal...
    • Bob's Un-official Flashpoint Page
Re:Firemode
« Reply #5 on: 07 Sep 2005, 06:19:13 »
I understand. I can get away with it. Cheers guys.
James Andrew Wilkinson 1977 - 2005 R.I.P.
"If it ain't the friggin' incoming it's the friggin' outgoing. Only difference is who gets the friggin' grease, and that ain't no friggin' difference at all."

Offline paddy

  • Contributing Member
  • **
  • Llama whipping good
Re:Firemode
« Reply #6 on: 08 Sep 2005, 14:09:22 »
I dont want to go against the advice of almighty sui  :thumbsup: but there is a way to do this.

First of all add a fired eventhandler to the unit in question, whether vehicle or unit (i havn't tested with vehicle yet).

Next add a script that looks like this

Code: [Select]
;            keepfiring.sqs
;   By Paddy for NIMOD (www.nimod.net) (paddy@nimod.net)
;   All scripts are property of Paddy and available freely for editing ON REQUEST only
;   
;   Any modified versions must recognise and name Paddy and NIMOD as original creators
;   
;   A script designed to keep a unit firing (sustained)
;   Called by event handlers in coverfire
;   
;NB: Script will be part of URBAN AI pack by NIMOD available from www.nimod.net
;   
;   
;-------------- Define some variables ---------------------   

private ["_unit","_weapon","_muzzle","_mode","_ammo","_fire","_rocket"]

_unit = _this select 0
_weapon = _this select 1
_muzzle = _this select 2
_mode = _this select 3
_ammo = _this select 4
_rocket = nearestobject [_unit,_ammo]
_fire = 0

;-------------- Remove EH to prevent repeated detection ---------------------

_unit removeAllEventHandlers "fired"

;-------------- Set a fire pattern, check weapontype ---------------------

? speed _rocket > 3500 : goto "machinegun"
? speed _rocket < 2000 : goto "end"

#riflefire
~1
_unit fire [_weapon]
_fire = _fire+1
? _fire < 10 : goto "riflefire"
goto "end"

#machinegun
~1
_unit fire [_weapon]
_fire = _fire+1
? _fire < 50 : goto "machinegun"
goto "end"

#end
;-------------- End script (EH re-added in coverfire, not here) --------------------
_unit domove getpos _unit
_unit removeAllEventHandlers "fired"
~0.3

Exit

Or something like that

This will make a unit fire more , multiple rouns on the target instead of just one.
I am in the process of making an advanced AI script that will do all this and more, including

- decreasing AI accuracy and making them give coverfire to comrades
- Making AI behave properly in urban enviroments
- Making weapons fire more accuratly

As you may have noticed the above script is part of that AI script so if you want more u'll have to wait til i release it!!!

P.S. have a look at bored_onion's RPG path deviation script to decrease unit accuracy

Hope this helps

Peace out!

Offline 456820

  • Contributing Member
  • **
Re:Firemode
« Reply #7 on: 08 Sep 2005, 19:10:48 »
thats not that much different compared to what Sui said there both loops with fire in it
it will work but would occur lag if theres a big fire fight going on
also a small note ive tested and have found out that the
unit fire "weapon name" command makes the unit fire once in burst mode so he shoots 3 rounds even with a machine gunner its 3 rounds

Quote
unit fire array

Operand types:
unit: Object
array: Array
Type of returned value:
Nothing
Description:
Unit will fire from given weapon. Argument has format [muzzle, mode, magazine] or [muzzle, mode].

Example:
soldierOne fire ["throw","SmokeShell","SmokeShell"]

ive just checked the comred and it says that by mode does it mean full auto semi or whatever but in the example it shows the weapon so maybe this could come in use if it can be used with fire mode since you could use "Fullauto"