Home   Help Search Login Register  

Advertisement

Author Topic: More bullets, less hits, more wounded, more real?  (Read 14026 times)

0 Members and 1 Guest are viewing this topic.

Josef

  • Guest
Re:More bullets, less hits, more wounded, more real?
« Reply #15 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...

Offline Chris Death

  • Former Staff
  • ****
  • Finally Death's gonna get ya
    • OFPEC
Re:More bullets, less hits, more wounded, more real?
« Reply #16 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
« Last Edit: 18 Mar 2003, 13:15:33 by Chris Death »
Dont argue with idiots....they will bring you down to their level and beat you there with experience.

How to use Waypoint type Scripted

Offline Zayfod

  • ECP Team
  • *
  • Llama, softest natural fibre in the world.
Re:More bullets, less hits, more wounded, more real?
« Reply #17 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
"I have come here to kick ass and chew bubble gum......an I'm all outta bubble gum!"

Offline Chris Death

  • Former Staff
  • ****
  • Finally Death's gonna get ya
    • OFPEC
Re:More bullets, less hits, more wounded, more real?
« Reply #18 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
Dont argue with idiots....they will bring you down to their level and beat you there with experience.

How to use Waypoint type Scripted

Offline Zayfod

  • ECP Team
  • *
  • Llama, softest natural fibre in the world.
Re:More bullets, less hits, more wounded, more real?
« Reply #19 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

« Last Edit: 19 Mar 2003, 01:16:27 by Zayfod »
"I have come here to kick ass and chew bubble gum......an I'm all outta bubble gum!"

Offline Zayfod

  • ECP Team
  • *
  • Llama, softest natural fibre in the world.
Re:More bullets, less hits, more wounded, more real?
« Reply #20 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?
"I have come here to kick ass and chew bubble gum......an I'm all outta bubble gum!"

Offline Zayfod

  • ECP Team
  • *
  • Llama, softest natural fibre in the world.
Re:More bullets, less hits, more wounded, more real?
« Reply #21 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
« Last Edit: 19 Mar 2003, 03:50:09 by Zayfod »
"I have come here to kick ass and chew bubble gum......an I'm all outta bubble gum!"

Offline Chris Death

  • Former Staff
  • ****
  • Finally Death's gonna get ya
    • OFPEC
Re:More bullets, less hits, more wounded, more real?
« Reply #22 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
Dont argue with idiots....they will bring you down to their level and beat you there with experience.

How to use Waypoint type Scripted

Offline Chris Death

  • Former Staff
  • ****
  • Finally Death's gonna get ya
    • OFPEC
Re:More bullets, less hits, more wounded, more real?
« Reply #23 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
« Last Edit: 20 Mar 2003, 17:46:12 by Chris Death »
Dont argue with idiots....they will bring you down to their level and beat you there with experience.

How to use Waypoint type Scripted

Offline Terame

  • Members
  • *
  • Nice one OFPEC
    • http://fantasyscifi.com/main/ fantasy scifi sci-fi
Re:More bullets, less hits, more wounded, more real?
« Reply #24 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::
You can travel to infinity though the endless passages of the cosmos. Even
better this belongs to you. This is your mind

Fox2

  • Guest
Re:More bullets, less hits, more wounded, more real?
« Reply #25 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

Offline Chris Death

  • Former Staff
  • ****
  • Finally Death's gonna get ya
    • OFPEC
Re:More bullets, less hits, more wounded, more real?
« Reply #26 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
Dont argue with idiots....they will bring you down to their level and beat you there with experience.

How to use Waypoint type Scripted

Fox2

  • Guest
Re:More bullets, less hits, more wounded, more real?
« Reply #27 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.

Yahoo

  • Guest
Re:More bullets, less hits, more wounded, more real?
« Reply #28 on: 11 Apr 2003, 16:43:23 »
Any news/Progress  ??? ???

esti_the_big

  • Guest
Re:More bullets, less hits, more wounded, more real?
« Reply #29 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!