Home   Help Search Login Register  

Author Topic: Fire dispersion script for AI  (Read 10215 times)

0 Members and 1 Guest are viewing this topic.

GeneralCoder

  • Guest
Fire dispersion script for AI
« on: 14 Apr 2003, 17:38:23 »
Hi I made a script wich makes AI(super AI) less accurate.
(I just hate when they shoot me from 200meters whit one shot)
Heres the example mission below if you are intrested.

And I know some made allready this but... well you can decide wich one's better to use Im not saying anything.
« Last Edit: 15 Apr 2003, 20:28:00 by GeneralCoder »

Yahoo

  • Guest
Re:Fire dispersion script for AI
« Reply #1 on: 14 Apr 2003, 18:21:02 »
Wow  :o :o :o this script kicks a**se precisly what i have been waiting for thank you thank you thank you plus i couldn't detect any errors

 ;D 8) ;D ;)

GeneralCoder

  • Guest
Re:Fire dispersion script for AI
« Reply #2 on: 15 Apr 2003, 11:54:51 »
Wow  :o :o :o this script kicks a**se precisly what i have been waiting for thank you thank you thank you plus i couldn't detect any errors

 ;D 8) ;D ;)

Nice to hear that I did't do it for nothing  :)

But theres one thing you should know. Becose I just noticed that if you but this script to a machinegunner (the mounted mgs) the accuracy doesn't decrease much becose the mg's bullet is too fast or shometing. I gotta look for this if there's anything to do.

Yahoo

  • Guest
Re:Fire dispersion script for AI
« Reply #3 on: 15 Apr 2003, 16:15:41 »
Yeah i know i meant to mention that but too exicted plus could you change it so that hand held rocket launchers+grenade launcher are not affected or affected as severily

GeneralCoder

  • Guest
Re:Fire dispersion script for AI
« Reply #4 on: 15 Apr 2003, 20:24:16 »
Yeah i know i meant to mention that but too exicted plus could you change it so that hand held rocket launchers+grenade launcher are not affected or affected as severily

Ok now the launchers are more accurate becose dispersion is counted from their speed. But tell if u need them to be even more accurate.
And about that problem what I meantioned earlier.. I dont think there's nothing to do about it, but I think it's good as it is becose other wise the game would become too easy.

I updated the attachment.

Yahoo

  • Guest
Re:Fire dispersion script for AI
« Reply #5 on: 15 Apr 2003, 20:34:37 »
Quote
Ok now the launchers are more accurate becose dispersion is counted from their speed. But tell if u need them to be even more accurate.


just a 30% increase needed then they should be fine  
 
plus could you do it so that the taqnks aren't affected as badly cos they can hardly hit anything with any of there guns and especially there machinegun
« Last Edit: 18 Apr 2003, 14:43:54 by Yahoo »

Yahoo

  • Guest
Re:Fire dispersion script for AI
« Reply #6 on: 18 Apr 2003, 14:44:04 »
BUMP

GeneralCoder

  • Guest
Re:Fire dispersion script for AI
« Reply #7 on: 18 Apr 2003, 23:07:54 »
just a 30% increase needed then they should be fine  
 
plus could you do it so that the taqnks aren't affected as badly cos they can hardly hit anything with any of there guns and especially there machinegun


I though it was good that they wont hit that much.  :)
Ok I see what I can do but I cant get hold of the code right now so you have to wait a couple days.

Yahoo

  • Guest
Re:Fire dispersion script for AI
« Reply #8 on: 19 Apr 2003, 11:29:18 »
No sorry about that i meant there machine gun

and i would make all these changes my self but i am a scripting n00b

GeneralCoder

  • Guest
Re:Fire dispersion script for AI
« Reply #9 on: 26 Apr 2003, 19:07:44 »
No sorry about that i meant there machine gun

and i would make all these changes my self but i am a scripting n00b
Sorry for late reply but I've been busy. Is this script what I attached ok? It works for me. :)

Yahoo

  • Guest
Re:Fire dispersion script for AI
« Reply #10 on: 26 Apr 2003, 19:22:07 »
Yep it works fine  8) want my advice then submit it as  to the Editors Depot ;)

« Last Edit: 26 Apr 2003, 19:22:23 by Yahoo »

O Neil

  • Guest
Re:Fire dispersion script for AI
« Reply #11 on: 29 May 2003, 00:18:51 »
Hey, just thought i'd but in and say that this script RULES !

O Neil ;)

Yahoo

  • Guest
Re:Fire dispersion script for AI
« Reply #12 on: 29 May 2003, 00:31:45 »
I think it is better then the athoer one that is/was in development using setpos

Offline General Barron

  • Former Staff
  • ****
  • Semper Fi!
Re:Fire dispersion script for AI
« Reply #13 on: 16 Jul 2003, 22:06:10 »
Funny, I was working on yet another script like this. Only mine will be much better when it's finished  :P

Just thought I'd mention that there is a command that will find the speed of an object, without manually finding the magnitude of the velocity vector. Its the: speed object command.

Just thought I'd point that out. I figure it might make the script run just an eency weency bit faster, which might make a difference if you have a couple hundred units all firing off their weapons at the same time.
HANDSIGNALS COMMAND SYSTEM-- A realistic squad-control modification for OFP
kexp.org-- The best radio station in the world, right here at home! Listen to John Richards!

GeneralCoder

  • Guest
Re:Fire dispersion script for AI
« Reply #14 on: 21 Jul 2003, 21:20:51 »
Funny, I was working on yet another script like this. Only mine will be much better when it's finished  :P

I really hope so becose this doesn't please me much. The setvelocity part executes too late probably becose Nearestobject is so slow... so do you have any idea to solve that?

GeneralCoder

  • Guest
Re:Fire dispersion script for AI
« Reply #15 on: 23 Jul 2003, 17:36:00 »
Ok here's new version wich uses the speed function. It might be better dunno.

CptBravo

  • Guest
Re:Fire dispersion script for AI
« Reply #16 on: 25 Jul 2003, 21:35:30 »
Hey General,

I have a new b question .. I am using a creat units script. How do I add this script to the created units?? I want to add it to certain units.

The demo mission was impressive!

CptBravo

  • Guest
Re:Fire dispersion script for AI
« Reply #17 on: 25 Jul 2003, 22:21:12 »
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,"",0.5,"SERGEANT"]
"sdoc_russianMachinegunnerRPK74" createunit [getpos _pos,_grp,"",0.2,"CORPORAL"]
"sdoc_uce_russianHvyGrenadier" createunit [getpos _pos,_grp,"",0.2,"CORPORAL"]
"sdoc_uce_russianGrenadier" createunit [getpos _pos,_grp,"",0.2,"CORPORAL"]
"sdoc_uce_russianRPGsoldier" createunit [getpos _pos,_grp,"",0.2,"CORPORAL"]
"sdoc_uce_russianSniper" createunit [getpos _pos,_grp,"",0.8,"CORPORAL"]
"sdoc_uce_russianSoldier" createunit [getpos _pos,_grp,"",0.2,"PRIVATE"]
"sdoc_uce_russianSoldier" createunit [getpos _pos,_grp,"",0.2,"PRIVATE"]
"sdoc_uce_russianSoldier" createunit [getpos _pos,_grp,"",0.2,"PRIVATE"]
"sdoc_uce_russianSoldier" createunit [getpos _pos,_grp,"",0.2,"PRIVATE"]
"sdoc_uce_russianSoldier" createunit [getpos _pos,_grp,"",0.2,"PRIVATE"]
~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"

Where does your script go??

Any help is grrrrrrrreatly appreciated!


GeneralCoder

  • Guest
Re:Fire dispersion script for AI
« Reply #18 on: 26 Jul 2003, 16:55:07 »
Hey General,

I have a new b question .. I am using a creat units script. How do I add this script to the created units?? I want to add it to certain units.

The demo mission was impressive!

Put this to their init string: (between the " and ")
this addeventhandler["fired",{_this exec"fired.sqs"}]
like this: (note there's { and } instead of ")

"sdoc_uce_russianSoldier" createunit [getpos _pos,_grp,{this addeventhandler["fired",{_this exec"fired.sqs"}]
},0.2,"PRIVATE"]

« Last Edit: 26 Jul 2003, 17:02:05 by GeneralCoder »

CptBravo

  • Guest
Re:Fire dispersion script for AI
« Reply #19 on: 29 Dec 2003, 03:15:55 »
Quick ? please :)

How do you adjust the accuracy of firing? Is there a certain line in the script whenre you can increase reduce the accuracy? ANd is there anyway to make only applicable to certain groupes instead of sides?


Thanks

Offline Blanco

  • Former Staff
  • ****
Re:Fire dispersion script for AI
« Reply #20 on: 18 Mar 2004, 21:00:49 »
I think it's in this line :


_disp = (_speed * (0.01 - (skill _shooter)/100) )


0.01...it's 10% less accuracy, I think...





Search or search or search before you ask.

Offline Chammy

  • Members
  • *
  • I'm a llama!
Re:Fire dispersion script for AI
« Reply #21 on: 14 May 2004, 18:34:53 »
I know this is a stupid question but did you guys take a class or study Java script book to know how to do all of this? Cause I have been trying to figure out how to do all this scripting and I am still stumped, thanks to my ADD and short attention span.Oh yeah, im trying out the script right now. ;D

Offline General Barron

  • Former Staff
  • ****
  • Semper Fi!
Re:Fire dispersion script for AI
« Reply #22 on: 14 May 2004, 19:30:35 »
Kinda off topic, don't you think?

Anyway, for me, learning OFP scripting was fairly easy, because I already had experience programming on my TI calculator, and a little in Java/Visual Basic. But prior programming experience isn't required to learn scripting. I didn't even WANT to learn scripting at first, but I started wanting to do things I couldn't do in the editor, so I started downloading other people's scripts, and using those in my missions. Then I started looking at those scripts, seeing how they were done, and modifying them a little bit to get them to do something else. The first script I ever looked at was one that ejects a squad from a helo.

For you to learn, you first need to get the very basics of scripting down. How to do "goto"s, how to use delays, how to make a loop, how to read the command reference, etc etc etc. Hopefully you have been putting commands in units 'init fields' and in the activation fields of triggers, waypoints, etc. From there, it is easy to see that scripting is basically writing a series of those commands, and adding loops and if-then conditions in there.

Most importantly, you need a desire to create. What drives me to get better and better at scripting, is that I am always thinking of something new to script, and usually I have to come up with a creative way to do it. As long as you have the will, you will have the way.
  *END CHEESE*

HANDSIGNALS COMMAND SYSTEM-- A realistic squad-control modification for OFP
kexp.org-- The best radio station in the world, right here at home! Listen to John Richards!

DBR_ONIX

  • Guest
Re:Fire dispersion script for AI
« Reply #23 on: 15 May 2004, 17:21:31 »
Sorry for the continuing OT, but I found out, the best thing for learning scripting is the DePBO tool ;)
(www.ofp.info utilites section)

Open up mission, look at they're scripts, download scripts from places like here, look at them, even better if they're commented
Try to work out what each bit does
Or, talk to scripters on something like MSN (I'd be happy to help ya, if you want) or ICQ (Don't have ICQ myself, only MSN)

Anyway, the script is good, it could be made quicker if the nearest object is made into a function (*.sqf)
Aparently.. Never wrote one my self, but there's tutorials in the eds depot about them

Nice script though :)
- Ben

Offline 456820

  • Contributing Member
  • **
Re:Fire dispersion script for AI
« Reply #24 on: 06 Feb 2005, 12:40:14 »
im not sure if its working for me the demo mission does but if i try and put it in my own mission it doesnt seem to effect the ai i copied the trigger from the demo mission and put it in my own then put the scripts into my folder

Offline andywt

  • Members
  • *
  • I'm a llama!
Re: Fire dispersion script for AI
« Reply #25 on: 22 Feb 2013, 16:48:12 »
Does anyone have this example mission please?

If so, please could they provide a link.