Home   Help Search Login Register  

Author Topic: How do you further increase AI (Skill of a unit, etc)?  (Read 1107 times)

0 Members and 1 Guest are viewing this topic.

Captain Wacky

  • Guest
I want to increase the skill level (AI) of a unit. I've increased the unit's skill bar to the max within the editor, and have given him a: [this allowFleeing 0] code so that he becomes braver. Is there any way to make a units reactions super fast? I also want the unit to be able to easily track the player down, no matter where he is. And, I want the unit to be even more skilled and accurate than the skill level that is available in the editor. Does anyone know ways in which I could achieve this? Cheers in advance.

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:How do you further increase AI (Skill of a unit, etc)?
« Reply #1 on: 01 Mar 2004, 18:22:48 »
There are various AI enhancement scripts and threads - hunt around the Ed Depot and the forum.  Whether they will do exactly what you want, I'm not sure.     I doubt you can improve their reacion speed but you can, for example, make them harder to kill.

For AI loons to track the player that's not really an AI skill thing.    However you could script it ... for intermediate distances perhaps a reveal command might achieve what you want.
Plenty of reviewed ArmA missions for you to play

Captain Wacky

  • Guest
Re:How do you further increase AI (Skill of a unit, etc)?
« Reply #2 on: 01 Mar 2004, 18:33:34 »
Thanks, macguba. I'm not familiar with exactly how to use the reveal command. How is that used?

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:How do you further increase AI (Skill of a unit, etc)?
« Reply #3 on: 01 Mar 2004, 18:50:58 »
Can't remember the syntax but its very straightforward - check the command reference.   I always use the online version in the Editors Depot because you sometimes get a helpful Comment.  

What it does is reveal one unit to another.   Say, for example, you were a couple of hundred metres away from an enemy AI loon ... maybe he would "know" you are there and maybe he wouldnt'.     After you were "revealed" to him then he would know that you are there and will act accordingly.    The command takes no account of distance or line of sight effects, though obviously they will have an impact on how the AI behaves after the command has been issued.

Set up a wee test mission and experiment, just have a play with it.   for examply I don't know if a reveal command has a permanent effect or if it "wears off" after a while.     There is a complementary command - knowsAbout.
Plenty of reviewed ArmA missions for you to play

Offline icarus_uk

  • Members
  • *
  • LiarLiarPants Inflame True
    • [furryclan]
Re:How do you further increase AI (Skill of a unit, etc)?
« Reply #4 on: 01 Mar 2004, 20:30:24 »
I personally wouldnt use the reveal command.  The reveal command sets the knowsabout value to 1, regardless of what it was originally (at least it did a year or so ago).  Also, just because the enemy knows about the player on the other side of the map, doesnt mean the enemy will hunt the player down.

I would make a script, that told the pursuing enemy group to move to the position of the player.


#hunt
? (!alive Player) : goto "exit"
Enemy Move (Getpos Player)
?Enemy KnowsAbout Player > 3 :goto "kill"
~5
goto "hunt"

#kill

? (!alive Player) : goto "exit"

~2

?(Enemy knowsabout Player) < 2 : goto "hunt"

goto "kill"

#exit
exit


This way, every 5 seconds the enemy will move to the position of the player.  The script checks when the enemy knowsabout the player, (and will start to shoot at him).  If the player is dead the script exits.
« Last Edit: 01 Mar 2004, 22:39:00 by [icarus_uk] »

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:How do you further increase AI (Skill of a unit, etc)?
« Reply #5 on: 01 Mar 2004, 21:02:35 »
Icarus is right, reveal is only appropriate in certain circumstances.    Use his script if you actually want a fierce manhunt.
Plenty of reviewed ArmA missions for you to play

Komuna

  • Guest
Re:How do you further increase AI (Skill of a unit, etc)?
« Reply #6 on: 03 Mar 2004, 19:31:30 »
And, I want the unit to be even more skilled and accurate than the skill level that is available in the editor. Does anyone know ways in which I could achieve this? Cheers in advance.

About this one: there's the setSkill command, which lets you to increase or decrease the skill of a unit:

{_x setSkill 1} forEach AllMyDeadlyUnits_Array

but it will only modify the skill ingame.

If you want to make them even more accurate (fastnest depends on ingame skill level), then you'll have to configure new units and define their 'sensitivity' levels to a higher number (1 by default, 2 for snipers default, 1.25 for BAS and other addon units). In this way they'll be able to detect and engage you at further distances - however, shooting range depends on the weapon's AIRange.

The only 'IF' is that you'll have to make a new addon.

Captain Wacky

  • Guest
Re:How do you further increase AI (Skill of a unit, etc)?
« Reply #7 on: 04 Mar 2004, 13:49:22 »
Thanks, guys this is really helping. Komuna, instead of completely making a new addon from scratch, how do I adapt an alreadly existing unit so his skill can be raised higher? Could I use UnPBO to decompress the files and edit them in some way? Are the official units easy to modify?
« Last Edit: 04 Mar 2004, 13:51:42 by Captain Wacky »

Komuna

  • Guest
Re:How do you further increase AI (Skill of a unit, etc)?
« Reply #8 on: 05 Mar 2004, 15:50:00 »
Thanks, guys this is really helping. Komuna, instead of completely making a new addon from scratch, how do I adapt an alreadly existing unit so his skill can be raised higher? Could I use UnPBO to decompress the files and edit them in some way? Are the official units easy to modify?

Yes, yes, it is very simple. All you must do is making a new class under an already existant unit class. Download the Config1.91 from Breathe and learn more about the OFP classes configuration.

To make an addon all you must have is the config.cpp (or config.bin if binarized with CCP2BIN from Amalfi) compressed in PBO format, at the addons folder. The configuration should have the following base configuration classes:

CfgPatches {};
CfgWeapons {}; //If you want to add new weapon settings
CfgAmmo {}; //If you want to add new ammo settings
CfgVehicles {}; //If you want to add new vehicle settings

Then, each of these should have a proper configuration - check the configuration of other addons or just download Config1.91 from the above link; as I don't memorise all the required settings...

Exempli Gratia:

Code: [Select]
class CfgPatches
{
  class Captain_Wacky_FirstAddon
  {
  units[]={"WackySoldier"};
  weapons[]={};
  };
};

class CfgVehicles
{
  class All{}; //This class has been configured at the default OFP config @ BIN folder
  class AllVehicles : All {}; //This class picks a few settings from the class "All" and creates new ones
  class Man : AllVehicles {}; //The same as above, but base settings are taken from "AllVehicles"
  class Soldier : Man {};
  class SoldierWB : Soldier {}; //This is the class of a basic west unit, named "Soldier"

  class WackySoldier : SoldierWB //Now, this is you class ;)
  {
  displayName="Captain Wacky";
  sensitivity=3; //This is a very high sentitivity!!! Beware of this deadly unit ::)
  };

};

With these settings you'll be able to find your unit under "West"\"Men" designated as "Captain Wacky" (notice this is not the character's name yet the unit type). You can also create this unit with "WackySoldier" class name: "WackySoldier" createUnit [groupName,blah,blah]

Notice that there are many other settings that you can define, such as "model", "armor", "formationX" and "formationY", "threat", "camoflage" , etc; and, therefore, I recomend you to download the Config1.91, if you didn't do it already ;).

IMPORTANT: before making your addon, be sure you have checked the settings I've proposed. I might have missed some step, misswritten a setting or made other errors - I did it from experience, not from reference.

I hope it helps you ;)

#Edited
I've presented just three classes to make an addon : CfgAmmo, CfgVehicles and CfgWeapons. However, there are many other available at the OFP configuration. You can create dialogs, resource text/pictures, unit groups [F2], characters, faces, models, etc, etc. So, mate, enjoy OFP configuration dynamics ;D.
« Last Edit: 05 Mar 2004, 15:58:14 by Komuna »

Captain Wacky

  • Guest
Re:How do you further increase AI (Skill of a unit, etc)?
« Reply #9 on: 05 Mar 2004, 16:08:28 »
To make an addon all you must have is the config.cpp (or config.bin if binarized with CCP2BIN from Amalfi) compressed in PBO format, at the addons folder.

Sorry, this is helping a lot, but as a first time addon maker some of that is still quite confusing. I've downloaded the Config 1.91 zip. But, I just have a few more questions: Is the config.cpp the file in which I add that example code you gave me and is that the ONLY file I need in the .PBO? Do I need to change any values within any of those other files that are in the config 1.91 zip? (I don't recognize the extensions.) How do a create a .PBO file properly?
« Last Edit: 05 Mar 2004, 16:11:04 by Captain Wacky »

Komuna

  • Guest
Re:How do you further increase AI (Skill of a unit, etc)?
« Reply #10 on: 05 Mar 2004, 16:16:56 »
First of all, create a folder with your addon name - "CWacky's patch" e.g.. Then create an empty file named "config.cpp" in it. Then copy the code I posted within that file. Then compress the folder "CWacky's patch" with MakePBO. Then copy the compressed archive "CWacky's patch.pbo" to your addons folder. Then hope I made the configuration correctly. If not, correct it yourself by comparing it with other ones.

After all these "Then" I'm sure you won't have anymore problems.

Captain Wacky

  • Guest
Re:How do you further increase AI (Skill of a unit, etc)?
« Reply #11 on: 05 Mar 2004, 16:27:07 »
Right. Thanks very much for all the help. You will be credited.