OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting Resources Beta Testing & Submission => Topic started by: Zayfod on 14 Mar 2003, 04:49:26

Title: More bullets, less hits, more wounded, more real?
Post by: Zayfod on 14 Mar 2003, 04:49:26
Started this in sdvanced scripting forum but thought it be better here so I closed the other thread ;D

ok

Ive thought about the AI and their firing in the game, seems its either way too accurate sometimes or rediculously lame.--EG choppers firing at ground troops--even when the chopper does fire sometimes he can empty his entire browning MAG at a spot one foot away from a stationary careless target  and all the bullets went into the same hole  

So i made this wee script but need help to make it so the AI doing the firing also sprays a bit above and below the target also.

Its works quite well actually, it only activates when an AI fires and deactivates 0.5 seconds after he has fired.

tried it on infantry and a lot more bullets went flying than normal, less hits--I thought with propper tweaking it could resemble more wot real weapons and average soldiers would be really like.

Perhaps more real if it were applied only to certain types of weapons. I dunno too much about ballistic and such but I wonder sometimes about AK accuracy and how AI fire--looking more for the "pray and spray" effect here by AI that is

We all know that when humans in the game apply suppressing fire I SURE as heck get my butt down to cover.

Funny thing is that in some circumstances this lil script actually makes guns MORE effective in killing--eg Machine gun. An old soldier told me once that u dont wanna MG to be too accurate--u want it to scatter fire and blanket an area.

Well the following makes for one HECK of an extended FIRE FIGHT between AI-- and I dont think they are too inaccurate at all. However tweaks will be needed.

Its WAY cool.  

#1The AI dont all kill each other in 5 seconds.

#2 Sporadic firing all over the place

#3 heaps more wounded

#4 the script doesnt alter the accuracy of the first shot--so the first shot always goes where it should. They only spray after the first shot.  ;D So if AI are using single shot (bolt action) or sniper rifle it doesnt affect em.

I mean thats more real aint it? the first shot is the one that counts methinks?




activated by this in INIT: of unit

unit addeventhandler ["fired", {_this exec "spray.sqs"}]

;spray script

Code: [Select]
   _man = _this select 0
   _count = 0
   _start1 = "start1"
   _start2 = "start2"
   _start1_and_start2_array = [_start1, _start2]
   _random = random (count _start1_and_start2_array)
   _random = _random - _random % 1
   _randomstart = _start1_and_start2_array select _random
   _man removealleventhandlers "fired"
   _mandir = getdir _man
   goto _randomstart

#start1
   _man setdir _mandir
   _mandir = _mandir + 0.06
   _count = _count + 1
   ? _count > 50: goto "end"
   ~0.01
   goto "start1"

#start2
   _man setdir _mandir
 Â Â Â _mandir = _mandir - 0.06
   _count = _count + 1
   ? _count > 50: goto "end"
   ~0.01
   goto "start2"
#end
   _man addeventhandler ["fired", {[_this select 0]  exec "spray.sqs"}]
exit



Your thoughts, suggested improvements welcome

Especially for firing above and below target--I dunno if thisll work for a gunner in a chopper cause it uses setdir and when a guy is in a chopper I think his direction is determined the direction of the chopper , not where hes facing. I could be wrong tho.


attached test map, for really extended fire fight. Ive made player immortal so sit amongst the guys and hear all the bullets whizz past around you ;D

Zay out

Title: Re:More bullets, less hits, more wounded, more real?
Post by: red devil on 16 Mar 2003, 15:19:11
THIS SOUNDS SO COOL!! 1 thing tho does it work 4 fixed mgs please say it does I SO NEED IT TO!!!! (please)
Title: Re:More bullets, less hits, more wounded, more real?
Post by: Terame on 17 Mar 2003, 08:24:46
I'll test it tonight will edit this post after the trial with some mates coming over for OFP and beer ;)
Title: Re:More bullets, less hits, more wounded, more real?
Post by: Chris Death on 17 Mar 2003, 14:04:19
Excellent idea, which should have been in the game right
from the release.
Works fine Zayfod, makes assaults more realistic now, as
a squad doesn't get  kiled too early when doing an assault
now.

One thing you could try to implement:

Code: [Select]
_mandir = _mandir + 0.06
Instead of 0.06 you could use a variable, which you alter
in game, to simulate the nervousity of the units.

What i mean is: if let's say two eastern units have to
fight 20 western units, they sure will be very nervous and
wouldn't fire that accurate, as if they only have one enemy
in sight.

One way to check if they are outnumbered could be using
side/present trigger and compare them amongst eachother.

Anyway just a thinking  ;)

~S~ CD
Title: Re:More bullets, less hits, more wounded, more real?
Post by: Fox2 on 17 Mar 2003, 14:49:10
Yet another idea, and I've discussed this a bit with Zay, is to have some sort of AI reaction to suppressive fire beyond the standard "go prone, turn to face threat, shoot threat's head off" routine when you fire at an AI. This is something of a continuation of your variable idea, Chris.

Maybe have a global variable for each soldier (that you'd like) that represents his anxiousness/efficiency rate. This could even bounce off of the skill setting used in the mission editor, so that the more experienced soldiers don't react to suppressive fire as bad as the rooks.

Here's an example scenario. A light US patrol is walking along the treeline of an Everonian forest. It's mostly a novice patrol, the highest ranking officer of the bunch only being in-country for 2 weeks. The rest are fresh replacements. Out of nowhere, RPK fire lunges out at them from the belly of the forest. The gunner is an elite Red Army regular, a veteran of the Afghanistan War of the 70's. He is attached to a squad of long-time comrades, on a recon mission. They've found the light patrol, and decided to seize the opportunity. 3 of the US soldiers are killed instantly. The rest jump for any cover they can find. The relatively low skill level of the soldiers and the fact that half of their patrol was just waxed makes them all nervous, scared, and panicked. The fact that they were surprised brings their morale down even lower. They freeze under the suppressive RPK fire, the fledgling CO without a clue as to what to do. Out of options, the young CO fires a wild spray of bullets in the direction of the machine gunner. The rounds land mere inches from the RPK operator's body, but he is unfazed, only momentarily ceasing his barrage of bullets. The Americans realize all too late that half of the enemy squad had flanked them. Their deaths were quick.

Imagine if that scenario could be played out with the use of scripts. I think it's possible. Every soldier would have a "anxiety level" or "morale" that would be influenced by both skill setting as well as circumstance (whether the enemy surprised them or not, casualties they've suffered).

A good example of something to borrow from is the freeware game America's Army. In the latest build, they include a "Combat Efficiency Meter." It represents your accuracy at the current time. As is typical, stance, speed, etc. affect it, but so do circumstancial factors. If someone is shooting at you, it plummets dramatically. If an explosion goes off next to you, it decreases even further. If you're wounded, it also decreases. You get a small bonus the closer you are to your squad leader (simulating the CO encouraging his troops to fight on).

These and other factors could and should be implemented into OFP. Who's with me?  ;D
Title: Re:More bullets, less hits, more wounded, more real?
Post by: Zayfod on 17 Mar 2003, 15:08:44
EDIT: OK Ive played with the settings a bit and rather than 0.06 try 0.1 --It rocks. I played a soldier this time with only open sights gun and they stilled killed me real quick but boy o boy did the bullets fly all round --WEEEEEEEEE



terame look forward to your feedback

red devil --Im working on it  ;)


Chris Death thanks fer  an awesome report.   ;D


and Fox2



:o Holy COW :o

TOM CLANCY--eat yer heart out. Fox dude u should be a writer.  ;D

Yeah hell yeah that would be way COOL.

um I get the feelin this wee script of mine may turn into a  :wow:MONSTER :wow:

I will def need the help of u guys if thats our goal.

But like they say "if u dont aim high itll never take off" or sumthing like that  ::)

Yup, almost anything is possible with the game engine. We are only limited by our imagination.

Title: Re:More bullets, less hits, more wounded, more real?
Post by: LCD on 17 Mar 2003, 16:11:12
i started workin on AI script long time ago 2 make da AI make tactical desicions (didnt finish em cuz dey were even dumber wen dey were under da scripts opeation  ::)  ;D)

but here is somin dat can b good 4 da mission ;D - use knowsabout 4 each soldier 2 know how meny soldiers he knows  ;) :) do somin like dat

soldiers skill loop  :) (make array of all enemies @ start of da mision

Code: [Select]
_knowsabout3 = []
_knowsabout2 = []
_knowsabout1= []
_knowsabout3f = []
_knowsabout2f = []
_knowsabout1f= []
_skill = (1-(skill _unit))
#loop
"if (_unit knowsabout _X > 3) then "_knowsabout3 = _knowsabout3 + [_X]" foreach enemysoldiersarray
"if (_unit knowsabout _X > 2) then "_knowsabout2 = _knowsabout2+ [_X]" foreach enemysoldiersarray
"if (_unit knowsabout _X > 1) then "_knowsabout1 = _knowsabout1 + [_X]" foreach enemysoldiersarray

"if (_unit knowsabout _X > 3) then "_knowsabout3f = _knowsabout3f + [_X]" foreach friendlysoldiersarray
"if (_unit knowsabout _X > 2) then "_knowsabout2f = _knowsabout2f+ [_X]" foreach friendlysoldiersarray
"if (_unit knowsabout _X > 1) then "_knowsabout1f = _knowsabout1f + [_X]" foreach friendlysoldiersarray
_knowsabout2 = _knowsabout2-_knowsabout3
_knowsabout1 = _knowsabout1-_knowsabout2
_knowsabout1 = _knowsabout1-_knowsabout3
_knowsabout2f = _knowsabout2f-_knowsabout3f
_knowsabout1f = _knowsabout1f-_knowsabout2f
_knowsabout1f = _knowsabout1f-_knowsabout3f
_count3 = (count _knowsabout3)/3
_count2 = (count _knowsabout2)/5
_count1 = (count _knowsabout1)/10
_count3f = (count _knowsabout3f)/3
_count2f = (count _knowsabout2f)/5
_count1f = (count _knowsabout1f)/10

_afraid = (_skill*_count3)+(_skill*(_count2/2))+(_skill*(_count1/3))-(_skill*_count3f)-(_skill*(_count2f/2))+(_skill*(_count1f/3))
~10
goto "loop"

da higer da _affaraid is da more affriad he is ;D (dat is rough example change it 2 b good ;d)

:cheers:

LCD OUT
Title: Re:More bullets, less hits, more wounded, more real?
Post by: red devil on 17 Mar 2003, 17:40:32
This will be gooooooood does any1 else no if it is possible to do this with fixed mgs any help would be great.
Title: Re:More bullets, less hits, more wounded, more real?
Post by: Teryan on 17 Mar 2003, 23:32:54
I liked it alot.
Especialy when you turn it into night and in slow motion.

Slow night of watching the run, when all the sudden an MG opens up, then a huge fire fight persues and you finally find out how many there are when nades go off.  Very cool.
Title: Re:More bullets, less hits, more wounded, more real?
Post by: Terame on 18 Mar 2003, 00:06:12
Excellent!

I'm incorporating into a "Mog" mission - now just need a decent script for ricochets and rappelling from a blackhwak and I am done
Title: Re:More bullets, less hits, more wounded, more real?
Post by: Chris Death on 18 Mar 2003, 01:01:00
Zayfod - wot about implementing following?:

check in the script, wether the unit is using single, o burst/autofire mode (not sure if auto-fire is relevant here)

btw- it's _this select 3, which indicates the firing mode when
passing _this to the script, but i think you already know it.

Code: [Select]
?(_this select 3 == "single"): exit
Code: [Select]
?(_this select 3 == "burst"): spray_value = 0.06
Code: [Select]
?(_this select 3 == "FullAuto"): spray_value = 0.10

And wot about:

implementing tanks or apc's, when firing their secondary weapons (machine-guns)

?(_this select 1 == "machinegun_12-7")

:note - not sure about the weapon name of the mg - i'm at work
and can't check this ingame right now, but i think it shouldn't
be that hard for you to check if i'm correct here  ;)

~S~ CD
Title: Re:More bullets, less hits, more wounded, more real?
Post by: Fox2 on 18 Mar 2003, 03:32:21
The problem with using this with vehicles (fixed MGs, tanks, helicopters) is that the way the current script works is it uses SetDir in a loop.

In the case of a Fixed, MG, the tripod would begin to change directions suddenly, the tank's body would move, and the helicopters fuselage (rather than the gun) would change direction.

Another thing to remember is the reason that these bullets are being dispersed is the fact that the wielder is flesh and blood. He's having a hard time controlling the fully automatic fire from an unsupported weapon (no tripod, stable tank turret, etc) So this script would be little use for vehicles. However, fire suppression and morale could be used...For instance, a helicopter under fire might postpone an extraction because of the enemy resistance.

A thought just occured to me. We need to get toadlife (maker of the AI Group script) in here. In the Group script, the AI compares the enemy forces to their own, and depending upon that, either continue on to attack, retreat, or call for reinforcements. He would be great to talk to about how he got it all to work, and perhaps helping in applying the same concepts to our little "morale/suppressive fire" scripts.
Title: Re:More bullets, less hits, more wounded, more real?
Post by: Chris Death on 18 Mar 2003, 04:52:52
Yep, i've got your point Fox2 - didn't think about the difference
between eye- and turret-facing.

The comparisation like Toadie did in his grouplink script
shouldn't be that hard to implement, as he already did
it (no need to stress him - let 'im continue workin on
'lojack newer version)  ;D

Still the firing mode could be implemented, as single fire
mode shouldn't let the script continue, while bursts or autofire
should (and autofire should beat bursts on the spray effect).

For static mg's, i think the heading could still be used, as
the facing of the mg = equal to the facing of the gun itself.

~S~ CD
Title: Re:More bullets, less hits, more wounded, more real?
Post by: Fox2 on 18 Mar 2003, 08:55:30
Quote
For static mg's, i think the heading could still be used, as
the facing of the mg = equal to the facing of the gun itself.

I believe that is inaccurate. Try dynamically changing the direction of an AI MG mid-game using SetDir. The tripod itself moves.
Title: Re:More bullets, less hits, more wounded, more real?
Post by: Zayfod on 18 Mar 2003, 09:08:18
Yes Fox2 this is correct unfortunately  :-\

However the effect of spraying still seems to work --not quite as good as with AI soldiers but he does fire a lot more.

I guess if u are will to put up with seeing the tripod slowly turn left and right then it aint an issue.

But we are all perfectionists right?

So lets get it right, ;)

Still working on it

Zay out
Title: Re:More bullets, less hits, more wounded, more real?
Post by: Josef on 18 Mar 2003, 11:43:41
Could you make the script activate in the INIT.sqs?

So that all AI players will use it...
Title: Re:More bullets, less hits, more wounded, more real?
Post by: Chris Death on 18 Mar 2003, 13:13:00
As we're talking about an EventHandler, you can't execute
the script from the init.sqs - you need to add the EventHandler
to every single unit.

All what you need is a large trigger (covering all units
on the map) - activation: anybody/present/once

And now you would have a trigger, where you could add
the EventHandler foreach thislist  ;)
Or by a loop through the triggerlist in a script.

~S~ CD
Title: Re:More bullets, less hits, more wounded, more real?
Post by: Zayfod on 18 Mar 2003, 13:38:38
Zayfod - wot about implementing following?:

check in the script, wether the unit is using single, o burst/autofire mode (not sure if auto-fire is relevant here)

btw- it's _this select 3, which indicates the firing mode when
passing _this to the script,

Thats a very good idead Chris Death

Ill give that a try :thumbsup:

Zay out
Title: Re:More bullets, less hits, more wounded, more real?
Post by: Chris Death on 18 Mar 2003, 16:30:09
@Zayfod

Check reply #17 (from me to Zahael) at the link below.
Maybe this can be helpful to enable your spray.sqs for
machineguns/vehicle_mg's

http://www.ofpec.com/yabbse/index.php?board=9;action=display;threadid=6999;start=15

~S~ CD
Title: Re:More bullets, less hits, more wounded, more real?
Post by: Zayfod on 19 Mar 2003, 01:09:02
Thats a great post dude  ;D

reckon that would go well with our idea but not sure about what is the actual dir of a gun in a chopper or on a jeep.

I mean is it the dir the gun is facing or the dir the jeep\chopper is facing? Hmmmm well we can only try.

Shouldnt be an issue with free standing MGs tho ;D

OK RE:

Code:?(_this select 3 == "single"): exit


Code:?(_this select 3 == "burst"): spray_value = 0.06


Code:?(_this select 3 == "FullAuto"): spray_value = 0.10

OK first of all this only works (far as I can tell) if you remove the event handler "fired" after they are checked in the script--which is fine.

Secondly. It seems to work only ONCE then after that I get error zero divisor.

So I guess this mean that when the soldier fires a second time third time and so on that the eventhandler IS executing the script corredtly for the MAN but the above checks dont recognise the MAN as being the same dude or that he even exists.  :-\

So it DOES work but I think the issue is how we reassign the event handler to the soldier again. I think it is sumthing to do with the fact that the event handler is being added by a script perhaps?


On another note:

BTW I tried setting the value from 0.1 to 0.12 --made it night time and HOLY  COW it was very very cool. Like a scene from platoon, tracers every where and the battle went on for ages. ;D

Would like thoughts on how to solve above issue.

Zay out

Title: Re:More bullets, less hits, more wounded, more real?
Post by: Zayfod on 19 Mar 2003, 02:22:41
*****update******

ok ive solved that issue of determining what firing mode the soldier is in....whether single or burst but hmmmmmm how do u check for full auto?

"FullAuto"
"Full-Auto"
"Auto"
"Full"
"AutoFull"
"Auto-Full"

none of the above work. I get no errors but the dont work.

single and burst are fine tho.

Any thoughts?
Title: Re:More bullets, less hits, more wounded, more real?
Post by: Zayfod on 19 Mar 2003, 03:46:35
OK this works well  ;D

wot I do is I set it so that the variable is first set to wot it would be for a MG then if hes firing burst or single it changes ;)

Still like to know if u can cheeck if hes firing full auto but this does exactly same anyways

/
Code: [Select]
   _soldier = _this select 0
   _count = 0
   _start1 = "start1"
   _start2 = "start2"
   _start1_and_start2_array = [_start1, _start2]
   _random = random (count _start1_and_start2_array)
   _random = _random - _random % 1
   _randomstart = _start1_and_start2_array select _random

   ; Sets up the spray value for a MG
   _spray_value = 0.11

   ; If firing single shot it then exits script and no change to soldier
   ? (_this select 3 == "single"): _soldier removealleventhandlers "fired"; goto "end"
   
   ; If soldier is firing a burst this resets the spray value to be less than a MG
   ? (_this select 3 == "burst"): _spray_value = 0.08


   _mandir = getdir _soldier
   _soldier removealleventhandlers "fired"
   goto _randomstart

#start1
   _soldier setdir _mandir
   _mandir = _mandir + _spray_value
   _count = _count + 1
   ? _count > 50: goto "end"
   ~0.01
   goto "start1"

#start2
   _soldier setdir _mandir
 Â Â Â _mandir = _mandir - _spray_value
   _count = _count + 1
   ? _count > 50: goto "end"
   ~0.01
   goto "start2"
#end
   _soldier addeventhandler ["fired", {_this  exec "spray.sqs"}]
exit



Now we need to make it so the spray variable becomes even larger if hes

#1: more dammaged

#2: under heaps of fire ie: lotsa bullets pinging around him

#3: Is wickedly out numbered

#4 balance this up with his skill setting--IE rookie or expert

Zay out
Title: Re:More bullets, less hits, more wounded, more real?
Post by: Chris Death on 19 Mar 2003, 04:10:12
Yeah Zay - the baby gets burning now  ;D

If i remember correctly, the code for AutoFire was "AutoFire"

soz - can't check this right now, 'cause i'm at work and
OFP ain't supported there (bloody no-3D graphics cards there).

btw - as for machineguns in a jeep, when trying the script
i've been linking you to, mg in jeep was handled same way
as the static mg.

~S~ CD
Title: Re:More bullets, less hits, more wounded, more real?
Post by: Chris Death on 20 Mar 2003, 17:43:59
OK Zay, figured the AutoFire out:

?(_this select 3 == "FullAuto"): player sidechat "autofire enabled"

:note - i'm not sure, if AI is using FullAuto in general, as i can't
remember having heard them once shooting in this fire-mode.
But as player, having FullAuto selected the message shows
up when firing.

~S~ CD
Title: Re:More bullets, less hits, more wounded, more real?
Post by: Terame on 20 Mar 2003, 18:49:41

terame look forward to your feedback

red devil --Im working on it  ;)


Couldn't get it to work, will wait until I can get some more (heh ANY) experience applying and editing scripts. Sounds great though ::sigh::
Title: Re:More bullets, less hits, more wounded, more real?
Post by: Fox2 on 24 Mar 2003, 06:07:03
Quote
Now we need to make it so the spray variable becomes even larger if hes

#1: more dammaged

#2: under heaps of fire ie: lotsa bullets pinging around him

#3: Is wickedly out numbered

#4 balance this up with his skill setting--IE rookie or expert

1) You could go about this two ways, I believe. The first is to make a loop like this:

#Hurt

? (GetDammage _unit) < .8 : _sprayvar = _sprayvar + .01

? (GetDammage _unit) < .6 : _sprayvar = _sprayvar + .02

? (GetDammage _unit) < .4 : _sprayvar = _sprayvar + .03

? (GetDammage _unit) < .2 : _sprayvar = _sprayvar + .04

and so on and so on until the bloke is dead

You could otherwise use multiplication for a slightly easier process....

#Hurt

_sprayvar = _sprayvar / (GetDammage _unit)

or

_sprayvar = _sprayvar + (_sprayvar / (GetDammage _unit))

This would effectively make the accuracy get worse as the unit is wounded...So, if you already have a spray value of say, .1, when the first example is executed and that unit is half-dead, that doubles to .2, and when it's 4/5th dead, it's quintupled to .5

In the second example, when it's half dead, with a starting value of .1, the spray value is .3, and when it's 4/5th dead, the value is .6

2) Not the faintest clue...You may be able to use some sort of combination of NearestObject commands to find out if a bullet is close...Otherwise not the faintest.

3) I'd guess toadlife could shed some light on this...Another thing would be if they're significantly outGUNNED. This is also included in his Group Link script...Basically, each group in the array is assigned a number representative of its capabilities and power...When two groups detect each other, the script compares power values...the lesser is "intimidated" and retreats and/or calls for backup from another squad

4) This could be done with the skill command and some fancy mathematics. Something to the tone of...

_sprayvar = _sprayvar - ((skill _unit) *.005)

With that line of code, and a spray value initialized to .5 (we'll just say he's been wounded  ;D ), that would give a unit with 25 skill a spray value of .375, with a skill of 50, that value goes to .25

Of course, all of these values are simply arbitrary, but you get the idea...

Also, another idea is to check whether or not the two groups new about each other before the fight broke out...Can't really think of a solution...but it'd be something to do with the knowsabout command and some REALLY careful timing in the script
Title: Re:More bullets, less hits, more wounded, more real?
Post by: Chris Death on 24 Mar 2003, 13:19:38
Quote
#Hurt

? (GetDammage _unit) < .8 : _sprayvar = _sprayvar + .01

? (GetDammage _unit) < .6 : _sprayvar = _sprayvar + .02

? (GetDammage _unit) < .4 : _sprayvar = _sprayvar + .03

? (GetDammage _unit) < .2 : _sprayvar = _sprayvar + .04

and so on and so on until the bloke is dead

sounds good Fox, altough you've healed him  ;D
dammage <.2 could be dammage .1 or .0 = full health  ;)

But i think the script will not ran as long as it's necessary to
do the check you've suggested.
As _sprayvar is a local variable inside the script, it doesn't
make sense to increase or decrease it, because it can be
definded directly:
? (GetDammage _unit) < .4 : _sprayvar = 0.2

Quote
#3: Is wickedly out numbered

Zay - at this point you will need to use e.g: two large
triggers: one with west/present
and the other one with east/present

Now you have a referback to all eastern and western units
inside the trigger areas (list trigger).

Toadlife's grouplink script did work in another way:

You had to pass the groups to check and to be checked into
the script, so that they could have been put into arrays.
Look here:

Code: [Select]
_eastgroups = [ge1,ge2,ge3,ge4,ge5,ge6]
_eaststaticgroups = [ge1]
_westgroups = [gw1,gw2,gw3,gw4,gw5,gw6]
_weststaticgroups = []
"[_eastgroups,_eaststaticgroups,_x,3,0.5] exec {grouplink.sqs}" foreach _westgroups
"[_westgroups,_weststaticgroups,_x,3,0.5] exec {grouplink.sqs}" foreach _eastgroups

I think this cannot be implemented into your spray script,
as it's called by eventhandlers given to single units.
Also it would make your script way harder to include into
a mission, while i think it's fine the way it is now (unit init
field).

But you can use the two arrays i suggested above (list trigger)
two check that.

e.g:
Code: [Select]
TriggerA: west/present/once
size: the whole battlefield
name: triggerA

TriggerB: east/present/once
size: the whole battlefield
name: triggerB

Now you can use those two triggers inside your script.

list triggerA = all west units
list triggerB = all east units

If you would check: "_soldier knowsabout _x > 1" count (list triggerA) > 10

You could find out wether there are more than 10 west soldiers
detected by _soldier (knowsabout value decreases after a while, so you can consider it as his actual knowledge).

 :o I've got to go to work now - anyway you should be busy for a while with my few lines above   ;D

~S~ CD
Title: Re:More bullets, less hits, more wounded, more real?
Post by: Fox2 on 24 Mar 2003, 16:27:18
Quote

sounds good Fox, altough you've healed him  
dammage <.2 could be dammage .1 or .0 = full health  

But i think the script will not ran as long as it's necessary to
do the check you've suggested.
As _sprayvar is a local variable inside the script, it doesn't
make sense to increase or decrease it, because it can be
definded directly:
? (GetDammage _unit) < .4 : _sprayvar = 0.2


DANGIT! Yet I again I make my if statements BACKWARDS! AAAAAAAAAAAARRGH!

Let me be alone and sulk in my idiocy....

Anyway, you could switch the numbers 'round and get the right effect....

HOWEVER, I think that this code is slightly easier, dare I say, even better....

Quote

_sprayvar = _sprayvar / (GetDammage _unit)

or

_sprayvar = _sprayvar + (_sprayvar / (GetDammage _unit))


Lots less code, lots less thinking, lots less chance for me to screw it up.
Title: Re:More bullets, less hits, more wounded, more real?
Post by: Yahoo on 11 Apr 2003, 16:43:23
Any news/Progress  ??? ???
Title: Re:More bullets, less hits, more wounded, more real?
Post by: esti_the_big on 12 Apr 2003, 19:40:10
yeah, this thing sounds extremely interesting. COnsidering the increase on atmosphere for the overall game this addon could deliver. Sone news would be great. i really hope the project isnÂ't dead!
Title: Re:More bullets, less hits, more wounded, more real?
Post by: hurlothrumbo on 19 Apr 2003, 20:37:11
I cant test this myself but isn't the way the MG (Not the tripod) is facing set with Setfacedir instead of setdir?

Title: Re:More bullets, less hits, more wounded, more real?
Post by: hurlothrumbo on 02 May 2003, 02:56:39
Status report?  This is a really cool idea
Title: Re:More bullets, less hits, more wounded, more real?
Post by: @cero on 03 May 2003, 03:01:29
This sounds amazing. :o
I'm looking for scripts to make my AI more of a chalenge to the player, I found some great ones, plus some others I allready had, but this one... I really fancy that one ;D
I just downloaded the demo mission from the first page to check it out, but I can't wayt for the updated script.
Title: Re:More bullets, less hits, more wounded, more real?
Post by: Ace on 04 May 2003, 20:26:22
Quality.
I'll test it when I get back but it sounds real cool
Title: Re:More bullets, less hits, more wounded, more real?
Post by: hurlothrumbo on 05 May 2003, 11:52:22
I've used the preliminary version in one of my missions (given Zayfod credit of course)
Works great :)
Title: Re:More bullets, less hits, more wounded, more real?
Post by: hurlothrumbo on 23 May 2003, 16:13:12
update plz??
Title: Re:More bullets, less hits, more wounded, more real?
Post by: R3dF0x on 21 Jun 2003, 23:41:30
Can't you position a gamelogic right in front of the barrel, make the machinegunner target it, and then move the gamelogic from side to side?
Title: Re:More bullets, less hits, more wounded, more real?
Post by: Chris Death on 23 Jun 2003, 09:39:12
Code: [Select]
Can't you position a gamelogic right in front of the barrel, make the machinegunner target it, and then move the gamelogic from side to side?
errm why  ???

Yeah for sure you can do something like that, but to avoid
doing such unconventional work around, Zayfod has made
this excellent script here.

btw - for those who are bumping for updates here:

this is fully functional, and the discussion about enhancing
it shouldn't prevent of using it like it is right now.

If you read this thread carefully, you may even find enought
explanations/analysis to modify this script upon your wishes.
If you aren't "scripter" enough, use it as it is, be happy, and
when there's an updated version available be even more happy.  ;)

~S~ CD
Title: Re:More bullets, less hits, more wounded, more real?
Post by: CptBravo on 25 Jul 2003, 21:27:37
I have a question. If I want to add a script in the init field of the created units .. how do I do that? I added one between the quotes and I kept getting an error.

Its the spray script that I am trying to add to each individual created unit.

Here is what I have:


;begin script

_pos = _this select 0
_grp = _this select 1

"sdoc_uce_russianOfficer" createunit [getpos _pos,_grp,"",1,"LIEUTENANT"]
"sdoc_uce_russianMedic" createunit [getpos _pos,_grp,"this addeventhandler ["fired", {_this exec "spray.sqs"}]",0.5,"SERGEANT"]
"sdoc_russianMachinegunnerRPK74" createunit [getpos _pos,_grp,"this addeventhandler ["fired", {_this exec "spray.sqs"}]",0.2,"CORPORAL"]
~1
_units = units _grp
_grp setformation "LINE"
_grp setbehaviour "AWARE"
_grp setcombatmode "GREEN"
"_x allowfleeing 0" foreach _units

#loop
?(("Alive _x" count _units) == 0): "deletevehicle _x" foreach _units; exit
~random(10) + 10
goto "loop"


Any help is grrrrrrrreatly appreciated!
Title: Re:More bullets, less hits, more wounded, more real?
Post by: TrackenHit on 07 Aug 2003, 05:21:47
We need more updates in this thread! I really wanted to see this in action, even though I'm trying to make it work in 1.46.
Title: Re:More bullets, less hits, more wounded, more real?
Post by: General Barron on 02 Oct 2003, 08:37:25
Try the SEB Nam pack if you want to see how weapons should work in this game. I just started playing with it, and I LOVE it! The weapons aren't perfectly accurate, and firefights are really extended. I wish all addon makers would emulate that pack. But in the meantime, this type of script works alright with other units. I'm still working on a much better script similar to this, but I'll post it when its ready to be tested.
Title: Re:More bullets, less hits, more wounded, more real?
Post by: DBR_ONIX on 22 Oct 2003, 21:50:56
First post... :)

Just thinking for applications of this script..

I am making a map (Mainly for me, as it's my first proper mission, and it prob won't be that good..), but anyway - I am going to try this script out in a Black Hawk Down (Not based on the real events, a, how can I descibe, "If you could go back to the begning with lessons learned from the errors of the first [mission]")

The main prob, firstly is that the enemy (West units, for now, but I will download a few enemys that look more SomolianSpelling..?) - Are FAR to accutate - Most of the time (According to the book, film, and if you think about it) the Skinnies (Somonlians) have basicly no training, they just jamp out, randomly fired, and ran away... There were basicly no trained soldiors (Only a few ex-assasin type people, who belong to other clans, but even they are not stong enough to put up a long first with 15+ highly trained  special forces soldiors..).. So this scipt is a good starting point for the random fire :)
The other prob (Which is similar to the main prob) is that only 18 americans were killed (And a couple og them had severe injuries, but died later, after they couldn't get a medivac to them, and one( ?) died in hospital) - Only a few were shot dead then and there - Most were injured -- Another thing this script would help achive

Other apps. In close quater, with some units with very low accurcy..

Crouched behind some ruble that used to belong to a house, but the bommings blew them apart like a paper model - Bullets hitting the remains of the wall - Making dust fall on your dusty, bloody face - It stings your eyes, red as you've not slept for 2 days, you were to excited and scared - You move along the wall, the shooting continues in your previous location - You jump out, dropping the gun man, who firing like a maniac at the bit of wall - The rest of the group relieses you've moved, but also noticed the rest of the partol - your partol - comming up the steet - Some fire at the partol - One at you - Lead flys about you - A bullet just narowly avoids you - But since you've been taking aim at the gun man - You pull the trigger - A single shot in the head sends him down like a bag of stones -  Your partol has hit one of the remaing two in the group.. - The other one, young, with an AK runs of - You take aim, but hes screaming - Scared - Drops his weapon and runs round a corner - Seconds later an enemy runs out and graps the weapon  - Your partol - Who have just reached you - Fire at him - Droping him - His hand twitches... - You move out - Looking for the RZ..

Sorry - Got a bit carried away ;) Sorry if anything doesn't make sense - I'm too tired to go over it again :P

You should get the idea...

Erm - Simply - Random firing and low accurcy - With a few more accurate (These would take longer to fire, as they take aim) - But may be able to get a single shot death in - But rarely

- Ben
Title: Re:More bullets, less hits, more wounded, more real?
Post by: DBR_ONIX on 22 Oct 2003, 21:57:55
BTW - SOrry if anything I have just posted has been suggested/talked about before.. Just noticed there are another two pages... ::)

Sorry
- Ben
Title: Re:More bullets, less hits, more wounded, more real?
Post by: Johan_D on 11 Nov 2003, 00:15:50
This works well, and is awesome!
Thanks a lot!

Is the script at the first post the latest script?

Johan
Title: Re:More bullets, less hits, more wounded, more real?
Post by: KJAM on 29 Nov 2003, 23:17:34
this script is great, and i thought it couldnt get any better, well i was wrong.

if you Have the ECP mod, and (or?) the Dynamic Range sound thing that you can get on the ECP page, i suggest trying this using the ECP mod, it makes it sound so cool and when your in slomo and a unit gets hit and blood comes flying off it it looks impressive :D
Title: Re:More bullets, less hits, more wounded, more real?
Post by: Skorp1on on 04 Dec 2003, 02:48:56
Sounds like a great script, good luck with it.
In answer to...um...someones question earlier about the accuracy of the AK, most varients of the AK are very accurate for the first, and possibly the second shot, and after that it sprays everywhere. For example, if you aimed at a soldiers neck with the AK and took your time aiming, the first shot of a three round burst would hit dead on the neck, the second within a foot of his head, and the third, who knows, this would be at a range of approx. 35-50 meters. Hope that helps a bit.
Title: Bullet Whiz script?
Post by: CptBravo on 05 Jan 2004, 23:37:55
hey Zayfod,

On a releated topic, can we get the Bullet Whiz sound script seperate from the ECP??

Great script by the way :)
Title: Re:More bullets, less hits, more wounded, more real?
Post by: Super-Six-Four on 02 Jun 2004, 13:27:14
Any news on this script?
Title: Re:More bullets, less hits, more wounded, more real?
Post by: sim on 02 Jun 2004, 22:31:39
WOW this thread was started over a year ago... :o

yer, any news???    ;D

sim
Title: Re:More bullets, less hits, more wounded, more real?
Post by: Zayfod on 04 Jun 2004, 05:06:13
Wow :o,
yes this is an old thread. Thanks for all the interest guys but I stopped development of this script ages ago. I joined the ECP team and have been constantly busy with that.

However, that is not to say that the initial goal has been dropped--that being suppressive fire from AI. If anything, the high attention this thread has gained has proven once again that this was, and still is, one of the most sought after additions to the game.

What I will say is this,
my drive to attain this goal combined with the skill, experiance and drive of other like minded fellows (both inside and outside the ECP) has brought the ECP to the brink of achieving this. And the preliminary results are no short of scary. In particular, General Barron has made some great config updates that are in this area.

This script was the stepping stone for me, and although it decreases AI accuracy in a random manner it doesnt portray the true nature of covering fire. That is what we are still working on--and its looking better than it ever has. :)

But, make no promises tell no lies :D

Once again, thanks for the interest and stay tuned for a unique ECP update in the (not too distant) future.

Zay
Title: Re:More bullets, less hits, more wounded, more real?
Post by: Homefry31464 on 04 Jun 2004, 13:39:45
Excellent to hear, can't wait until ECP can do this.  ;D
Title: Re:More bullets, less hits, more wounded, more real?
Post by: cliff on 24 Aug 2004, 03:03:42
HavenÂ't posted in AGES, but reading this, I must say it sounds promising for future ECPs. This must be why I never get tired of OFP?
Title: Re: More bullets, less hits, more wounded, more real?
Post by: andywt on 08 Mar 2013, 20:00:18
Please can someone post the example mission/scripts that used to be in this thread.