Jump to content
Sign in to follow this  
zonekiller

WORKING AI MORTARS - works with all mortars

Recommended Posts

Do you like the idea of Mortars but it sucked how they dont fire

well they do now and all in real time

they can even hit a moving target as they zero onto it.

just copy the mortar folder to your mission and

add this in the init of the mortar --- _nil = this execVM "mortar\mortar.sqf"; ---

Have fun with this :)

Here is a demo mission to show the working AI mortars

http://zonekiller.ath.cx/Missions/temp/MORTAR.Takistan.zip

The scripts are here

http://zonekiller.ath.cx/Missions/temp/MORTAR_scripts.Takistan.zip

Edited by Zonekiller
  • Like 1

Share this post


Link to post
Share on other sites

It's good, but it's much better this addon "Fire at will" Artillery autonomously without scripts :http://www.armaholic.com/page.php?id=15653 BIS forum http://forums.bistudio.com/showthread.php?128002-quot-Fire-At-Will-quot-Functional-AI-artillery-without-any-knowledge-about-scripts-etc

Edited by LDU30

Share this post


Link to post
Share on other sites

Interesting approach.

Scripts like FAW (it is a bit outdated BTW, means will work usually, but has some problems, need fixes - sometimes battieries may stop to shoot permanently, is also poorly coded and optimized - after a year of learning I know much better ways to do some things) or Blake's AI FO are working basing on BIS Arty module and really tries to predict, where target will be at the moment of planned impact (basing on target's movement vector and shell's time of flight or even near roads). Also with complex method of choosing most tempting target, kind of ammo, all with cooperation with AI FOs (someone see the target, battery fires), and complex semi-randomization for dispersion handling.

This is something else. Seems, that there is no prediction, no FO, no module, no randomization. Mortar act autonomously, and every shell is "guided" in real time by manipulating its trajectory towards current target position with nice homing function (I always had problems with geometry in scripting, especially vectors in 3D, pitch, bank and such, so such code is valuable source of knowledge to me). This rather is small and simply way to make mortars firing with probably (not tested) quite deadly accuracy, maximized shooter skills (is there any difference between setUnitAbility and setSkill commands?) and unlimited ammo. May be handy in some circumstancies.

BTW in "Fired" EH projectile object should be passed to the script as _this select 6, so probably no need for using neaerstObject to find it?

Share this post


Link to post
Share on other sites

^ Just been working on an insurgent rocket attack script (rocket fired low trajectory from launch to target with guidance) using the vector function by Venori - @ZK you want me to send it to u to finish off lol? I wan't to put in a random firing composition based on this:

Og7KRzBY4hs

It will probably end up as a small mission to track down the firing team.

Share this post


Link to post
Share on other sites

Works great, but sometimes it gives this error and it happens randomly.

String STR_EVAL_TYPENAN not found
Error in expression <call BIS_fnc_rotateVector2D;
_obj setVectorDirAndUp [_vdir, _vup];>
  Error position: <setVectorDirAndUp [_vdir, _vup];>
  Error Type , expected Number
File ca\modules\functions\objects\fn_setPitchBank.sqf, line 99

 

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×