Home   Help Search Login Register  

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

0 Members and 1 Guest are viewing this topic.

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.