StrategicAreas.con

Create groups.

Add vehicles to group

 AiSettings.AddVehicleToVehicleGroup 0  land
 AiSettings.AddVehicleToVehicleGroup 1  any
 AiSettings.AddVehicleToVehicleGroup 2  sea
 AiSettings.AddVehicleToVehicleGroup 3  land
 AiSettings.AddVehicleToVehicleGroup 4  any
 AiSettings.AddVehicleToVehicleGroup 5  land
 AiSettings.AddVehicleToVehicleGroup 6  land
 AiSettings.AddVehicleToVehicleGroup 7  any
 AiSettings.AddVehicleToVehicleGroup 8  any
 AiSettings.AddVehicleToVehicleGroup 9  any
 AiSettings.AddVehicleToVehicleGroup 10 any
 AiSettings.AddVehicleToVehicleGroup 11 any
 AiSettings.AddVehicleToVehicleGroup 12 sea
 AiSettings.AddVehicleToVehicleGroup 13 any
 AiSettings.AddVehicleToVehicleGroup 14 land

These look like spawn point assignments.

Looks like they correspond to the aiSettings.setVehicle statements in AIBehaviours.con within game.rfa (HDN)

from AIBehaviours.con:

 aiSettings.setNVehiclesTypes 18
 aiSettings.setVehicle 0  Tank
 aiSettings.setVehicle 1  Plane
 aiSettings.setVehicle 2  Boat
 aiSettings.setVehicle 3  Infantery
 aiSettings.setVehicle 4  Fixed
 aiSettings.setVehicle 5  Car
 aiSettings.setVehicle 6  UnarmedTank
 aiSettings.setVehicle 7  LandingCraft
 aiSettings.setVehicle 8  Passenger
 aiSettings.setVehicle 9  BoatFixed
 aiSettings.setVehicle 10 LandingCraftPassenger
 aiSettings.setVehicle 11 LandingCraftFixed
 aiSettings.setVehicle 12 UnarmedBoat
 aiSettings.setVehicle 13 FixedLargeBore
 aiSettings.setVehicle 14 ArtilleryDriver
 aiSettings.setVehicle 15 UnarmedPlane
 aiSettings.setVehicle 16 AmphibiousCar
 aiSettings.setVehicle 17 FixedGuidedMissileLauncher

15 - 17 are not listed in any of the original Battlefield maps addVehicleToVehicleGroup statements, looks like these were added for Secret Weapons.

Best guesses:

 15 UnarmedPlane = C47 Cargo Plane
 16 AmphibiousCar = Axis Schwimmwagen/Allied LVT-2 Water Buffalo
 17 FixedGuidedMissleLauncher = Wasserfall Guided Rocket

Some of the original maps differentiate vehicle 3 as "infantry" (eg. Wake), others simply as "land" (eg. Midway)

Some of the original maps use "any" for vehicle 9 (eg. Wake), others use "sea" (eg. Midway)

Why are things like "Passenger", "Fixed", and "FixedLargeBore" listed as "any" in most (all?) maps? Maybe because these things are vehicle components (eg. Passenger), or simply cannot move (eg. FixedLargeBore - defensive gun?)

Create strategic areas

Define an area with a label/(x/y) patrol positions?/capture value/group that should attack this point

i.e. AIStrategicArea.Create Village 2070/1880 2090/1902 250 land

for reference below is its location in controlpoints.con

 Object.Create openbase4_Cpoint
 Object.AbsolutePosition 2092.45/81.6/1901.82

So this value seems to hold true.

For those who do not know how to handle this values, here is a little hint: The two pairs of x,y values are defining a rectangle. The first pair is one of the rectangle's edges. The second pair is the point in the center of the rectangle.

Create areas defined above.

 AIStrategicArea.SetActive Village
 AIStrategicArea.AddAllowedVehicleGroup land
 AIStrategicArea.AddAllowedVehicleGroup any
 AIStrategicArea.AddNeighbour CrossRoads
 AIStrategicArea.AddNeighbour AxisBunker
 AIStrategicArea.AddNeighbour AlliedBunker
 AIStrategicArea.AddNeighbour AxisBase
 AIStrategicArea.AddNeighbour AlliedBase
 AIStrategicArea.AddObjectTypeFlag Centre
 AIStrategicArea.AddObjectTypeFlag ControlPoint
 AIStrategicArea.AddObjectTypeFlag East
 AIStrategicArea.SetOrderPosition Tank 2090/1909
 AIStrategicArea.SetOrderPosition Infantry 2090/1909
 AIStrategicArea.SetSide 0

You can go to the main AiDissection page or to the next section, Conditions.con.


File StrategicAreas.con (22 occurrences)

Required tokens:

Always used multiple times in each file:

 AIStrategicArea.AddNeighbour
 AIStrategicArea.AddObjectTypeFlag
 AIStrategicArea.Create
 AIStrategicArea.SetActive
 AIStrategicArea.SetOrderPosition
 AIStrategicArea.SetSide

Optional tokens:

Sometimes used once or more in each file:

 AiLandingZone.CreateLandingZone (single: 6, multiple: 4, in 22 files)
 AIStrategicArea.AddLandingZoneUnit (single: 8, multiple: 5, in 22 files)
 AIStrategicArea.AttachLandingZone (single: 6, multiple: 4, in 22 files)
 AIStrategicArea.VehicleSearchRadius (single: 14, multiple: 11, in 22 files)

Sometimes used multiple times in each file (never just once):

 AiSettings.AddVehicleToVehicleGroup (multiple: 9, in 22 files)
 AiSettings.CreateVehicleGroup (multiple: 9, in 22 files)
 AIStrategicArea.AddAllowedVehicleGroup (multiple: 9, in 22 files)
 AIStrategicArea.AddExpelledUnit (multiple: 2, in 22 files)
 AIStrategicArea.CreateNewCategory (multiple: 7, in 22 files)
 AIStrategicArea.SetTakeable (multiple: 13, in 22 files)

Getting bots to capture flags

AIStrategicArea.AddObjectTypeFlag ControlPoint

u need to put this on strategic areas made for control points that way the bots will know theres a flag and they will go to it

depending on how valuable its worth, if this line is not put then the bots will not go to and stay to capture the flag, i couldnt

figure out how to get the bots to get the flag so i tried this and it works, and if you have ShowAIstats on, it is very

useful in showing you were the strategic areas are and if u put AIStrategicArea.AddObjectTypeFlag ControlPoint for one of the areas

then u will see a blue (whatever other color, i think blue) around the flag so it tells the bots theres a flag right there

but on some occasion the bots will not go to the flag, they will just pass it, so the value needs to be changed

AIStrategicArea.Create Village 2070/1880 2090/1902 250

the number 250 is the value of the area, usually control points need higher values, typically any value may be used as , and if the ShowAIstats is on then if u look at the big blue boxes in air then u will see text, such as the name of the strategic area along with position and temp, it shows the allies temptation and the axis, and the control point needs a higher temp and that can be done by raising the value,


Creating Landing Zones

by HDN

AILandingZone.createLandingZone name x1/z1 x2/z2 direction

Direction

Landing Zones require a direction from which the bots will attempt to land.

These directions are hard coded as LZZMax, LZXMax, LZZMin, LZXMin. They are defined as follows:

The direction specifies on which edge of the Landing Zone box the bots will travel towards and attempt to land on (when they reach the end of the LandingCraft3 pathmap).

The Landing Zone direction can be seen in game with bot stats on as a dark green line beneath the lighter green edge of the Landing Zone box.

An Example:

Creates a Landing Zone called WestLanding with a box at the specified coordinates with a direction towards Z zero (west).

Attaching Landing Zones to Strategic Areas

AIStrategicArea.attachLandingZone name

AIStrategicArea.addLandingZoneUnit unitName

Once a Landing Zone has been attached to a Strategic Area, it appears linked in game with a green line going from the center of the Landing Zone box to the center of the Strategic Area box (assuming you have bot stats on).

An Example:

Notes on using Landing Craft and Landing Zones

The following files must have a specific code block encapsulating all statements:

The code is as follows:

 if v_arg1 == host
 ... file contents ...
 endif

additionally AI.con must have the following blocks:

 if v_arg1 == host
 ... every statement from aiSettings.setWorldMapSize to ai.botStatisticUpdateSpeed ...
 endif
 run AIPathFinding.con v_arg1
 run ai/StrategicAreas.con v_arg1
 run ai/conditions.con v_arg1
 run ai/prerequisites.con v_arg1
 run ai/Strategies.con v_arg1
 if v_arg1 == host
 ... list of strategies ...
 endif

Without the v_arg1 blocks the bots will not use landing craft. The will get in landing craft, but they will not move.

Maps without landing crafts or boats can safely have these code blocks as well (all Secret Weapons maps do).

It appears this v_arg1 code block was added sometime around Secret Weapons because none of the original or Road To Rome maps have the code in their base rfa's. The code appears in later rfa revisions for the affected water based maps.

Please note that even if a map does include the above code, it will not necessarily work with landing craft until appropriate strategies are implemented for landing craft.

 

Has anyone else noticed that the car pathmaps are never used? If you look at the aiTemplatePlugIn.vehicleNumber setting for vehicles you would logically think of as cars, they are set to 0. This means they're using the 0 pathmap, which is always Tank in vanilla. In fact, no vehicle in the original battlefield uses vehicleNumber 4.

Not only that, in many of the original levels, you'll get lines like this in the AiPathFinding.con file:

Code:

rem *** Tank ***
ai.addSearchMap Tank0 0 0 25 3.0 0.3 2.5 0
ai.addSearchType Tank 0 0
ai.setMapSpawnPoints 0 514/204,547/759,558/380
 
rem *** Infantry ***
ai.addSearchMap Infantry1 0 1.5 30 1.0 0.4 2.0 1
ai.addSearchType Infantry 1 0
ai.setMapSpawnPoints 1 514/204,547/759,558/380
 
ai.addSearchType Boat
 
ai.addSearchType LandingCraft
 
rem *** Car ***
ai.addSearchMap Car4 0 0 20 4.0 0.3 2.5 0
ai.addSearchType Car 2 0
ai.setMapSpawnPoints 2 514/204,547/759,558/380


These lines are meaningless since you still have to name the pathmap after infantry as 2. The second parameter of the ai.addSearchType line defines the pathmap number, so for the above Car4 map, it's map is defined as 2. You can't simply set the parameter to 4 because Battlefield requires the pathmaps to be in numerical order (otherwise you get a nasty assert), regardless if you have empty ai.addSearchType lines for Boat and LandingCraft.

I was experimenting on one level that would have a vehicle using pathmap 5, and I used empty ai.addSearchType lines for Boat and Landingcraft assuming this would work (which it didn't because of the above reasons). So I tried changing the second ai.addSearchType parameter to 3 (since it was the 4th map, after car), but this caused a debug assert as well since the vehicleNumber was set to 5, it was looking for pathmap 5, not 3, regardless if the pathmap was named MyVehicle5 or whatever.

So what does this have to do with the car pathmaps? Well car is supposed to be vehicle number 4 (hence the name, Car4), but on maps which use the above code, it would end up being vehicle number 2 (typically used by boats). So what would happen if there was a vehicle which had it's vehicleNumber set to 4? It would cause a debug assert, and possibly crash the game because the 4 pathmap wouldn't exist.

Knowing this, how can you take advantage of it? Well for one you can safely remove the Car4 section from the AIpathFinding.con file. Really it's just additional space taken up in your level for pathmaps which are never used. Although if your running a custom mod, you should double check your vehicles just in case one of them has had it's vehicleNumber set to 4.

If your working on custom vehicles, you can create your own pathmaps for them using pathmap 4, if you like, although if you plan on using any of the Secret Weapons stuff, you should note that it uses 4 for amphibius vehicles. You can also create your own pathmaps above number 4. Seems as though the battlefield engine doesn't really care what the pathmap is named, only it's number, and which vehicles use it. I use pathmap 5 for PT boats with the following settings (which are still being tested):

Code:

rem *** PT ***
ai.addSearchMap PT5 1 5 3 1 0.3 2.5 0 2 5
ai.addSearchType PT 5 2
ai.setMapSpawnPoints 5 500/500
ai.setSmoothing 5 20


You should also know that if you do make a level which uses vehicles from pathmap 3, for instance, but not 2, you still have to add those pathmaps to your AIpathFinding.con file and generate them, otherwise your vehicle which uses 3 will not work.

 

 

Legion of the Dragon link:

http://www.enidesigns.com/v2/forum/default...lt.asp?CAT_ID=9

 

 

The key thing to getting pathmaps (BF42 or BFV) is setting good mapping coordinates in the ai.setMapSpawnPoints line of the AIpathfinding.con file after using the botinator:

 

For each different type of pathmap, you should have a pair of coordinates after the ai.setMapSpawnPoints line.

 

So ai.setMapSpawnPoints 0 560/450,600/500

 

would set the number 0 pathmap (for tanks) with two sets of coordinates . These coordinates are the starting points that the game uses to create pathmaps. Usually you only need two sets, one for the allied/U.S. side and the other for Vietnam/Axis side. You may need to add more coordinates for areas that are cut off from the mainland, or areas that are turning out unpathed. Usually you can add points that are the same as vehicle or soldier spawn locations. Sometimes you may need to add a point that is in the desired bot path, but is not being pathed by the game.

 

Other potential problems are bridges and custom objects. In another forum, Cajun suggested creating a temp land bridge in place of the bridge object while creating the pathmap. Necronom also reported the BFV does not handle custom objects well at all. One suggestion to pathout a custom object, to prevent bots from running into it, is to create a steep hill in its place temporarily.

 

Another workaround for hard to path maps with custom objects, would be to convert the map to BF42, replacing the custom objects with similar BF42 objects and then use the BF42 engine to create the pathmaps.

 

Note - BFV pathmapping has some new parameters, the createSecondLayerMap settings used on Infantry and Tank maps. Don't understand what these are used for, but that is the only important difference in the Aipathfinding settings between BF42 and BFV. The slope settings are a little different; the Heli pathmaps are new (apparently are only used by choppers when landing for a pickup); SW uses amphibious pathmaps, but other than that I can't see any differences.

 

The following is sample AIpathfinding settings for BFV:

rem *** Setup map parameters ***

rem *** Tank ***

rem *** searchMap name/ waterHeight/ waterDepth/maxSlope/brush/lowClipLevel/hiClipLevel/

rem considerAITypes/createSecondLayerMap/ firstLevel-secondlevel-thirdlevel (for second layer map)

ai.addSearchMap Tank0 0 0 30 3.0 0.3 2.5 0 0 1.0/3.0/7.0

rem *** searchType name/mapNum/minSearchLevel

ai.addSearchType Tank 0 0

ai.setMapSpawnPoints 0 560/450,600/500

ai.setSmoothing 0 20

 

rem *** Infantry ***

ai.addSearchMap Infantry1 0 1.5 40 1.0 0.4 2.0 1 0 1.0/3.0/7.0

ai.addSearchType Infantry 1 0

ai.setMapSpawnPoints 1 560/450,600/500 139/815,149/825 159/433,169/443 259/433,269/443 498/525,508/535

ai.setSmoothing 1 10

 

rem *** Boat ***

ai.addSearchMap Boat2 1 1.4 30 4.0 0.3 2.5 0 0 0/0/0

ai.addSearchType Boat 2 2

ai.setMapSpawnPoints 2 560/450,600/500

ai.setSmoothing 2 20

 

ai.addSearchMap LandingCraft3 1 1.4 30 4.0 0.3 2.5 0 0 0/0/0

ai.addSearchType LandingCraft 3 2

ai.setMapSpawnPoints 3 560/450,600/500

ai.setSmoothing 3 20

 

rem *** Car ***

ai.addSearchMap Car4 0 0 35 3.0 0.3 2.5 0 0 0/0/0

ai.addSearchType Car 4 0

ai.setMapSpawnPoints 4 560/450,600/500

ai.setSmoothing 4 20

 

rem *** Heli ***

ai.addSearchMap Heli5 0 0 20 4.0 2.0 4.5 0 0 0/0/0

ai.addSearchType Heli 5 0

ai.setMapSpawnPoints 5 560/450,600/500

ai.setSmoothing 5 20

 

rem *** Amphibius ***

ai.addSearchMap Amphibius6 0 5000 30 3.0 0.3 2.5 0 0 2

ai.addSearchType Amphibius 6 0

ai.setMapSpawnPoints 6 560/450,600/500

ai.setSmoothing 6 20

rem ai.setWaterCutOffDepth 1

 

In BF42, most of the standard maps only have 1 coordinate. Bocage has 4 coordinates for each pathmap. In BFV, it appears that each pathmap just has 2 coordinates, except the infantry maps, which have around 1 coordinate per control point.

 

For BFV pathmapping, it would probably work best to use the control point locations of the bases for most pathmaps, and all the control point locations for the infantry pathmaps. Using spawnpoints can run into problems if a spawn is in a building, so its safer to use control points, which are usually in open locations. This is probably something that needs to be explained in the tutorial. This is probably why the Vanilla BF42 map conversions to BFV where not pathing after running the botinator (most of the spawns are in the buildings). Phonk mentions that the best pathmaps are generated with coordinates in open positions.

 

The same method can probably be used with BF42. This is something that needs to be tested to see what settings generate the best pathmaps. It will be interesting to compare pathmaps generated on the same maps between BF42 and Vietnam, to see what difference the number of control points make and if the two game engines actually make different quality maps, or if its just the settings.

 

 

As far as search map paramenters here is quick rundown, taken mostly from wiki and copied from Phonks pathing forum thread at FPScentral:

 

BF42:

waterheight: How low should this object get to the water?

waterdepth: How far into the water can this object go?

maxslope: What is the slope limit that I can get up?

brush: How big am I?

lowclip: What road clearance do I have? i.e. what objects can I run over?

hiclip: How tall am I?

considerAITypes: seems to be a boolean deciding if insides of buildings get pathed. if set to 0 the building will be a white blob, otherwise it will be nicely pathed. Note that is is only set to 1 for infantry pathmaps. It also appears that the layout of the pathmap comes from the aimeshes, which custom objects don't have.

 

 

You can add 2 more params after considerAITypes which determine the levels that will be generated. mainly used on boat and landingcraft pathmaps, which are defined like this:

ai.addSearchMap LandingCraft3 1 1.4 0 4.0 0.3 2.5 0 2 5

 

Note the 2 and 5 at the end.

If you look at the existing pathmaps for wake you will see tank, inf and car having levels 0-2, whilst boat and landingcraft have levels 0-5, but it appears the boat types don't use 0 and 1 levels.

 

It appears that the 2 means start using pathmaps at the level 2 map.

 

The 5 sets the highest level of maps to create (default is 2).

 

Basically if you look at the pathmaps that are created, you will see the following basic files (The common types are Infantry, Tank,Car, Boat)

 

[VehicleType].raw

[VehicleTypeInfo].raw

[Vehicletype]1Level0map.raw

[Vehicletype]1Level1map.raw

[Vehicletype]1Level2map.raw

 

Boats have 3 more levels:

 

[Vehicletype]1Level3map.raw

[Vehicletype]1Level4map.raw

[Vehicletype]1Level5map.raw

 

There is also an 8bit file for each vehicle type which is used to generate all the other files, and can be edited in photoshop as well as the botinator.

 

However amphibious vehicles (from BFV) are set as:

ai.addSearchMap Amphibius6 0 5000 30 3.0 0.3 2.5 0 0 2

 

I am guessing that the end 2 just means that Amphibious will only use level2 maps

 

Also:

ai.addSearchType LandingCraft 3 2

 

sets the minSearchLevel to 2. So boat and landingcraft pathfinding generally uses a lower resolution map.

 

Now for BFV, the difference appears to be with parameters related to creating first,second, third level maps on infantry and tank maps:

 

1.0/3.0/7.0

 

as in:

ai.addSearchMap Infantry1 0 1.5 40 1.0 0.4 2.0 1 0 1.0/3.0/7.0

 

these might be the level of detail, but all other pathtypes (except amphibious) are set as

0/0/0

 

as in :

 

ai.addSearchMap Car4 0 0 35 3.0 0.3 2.5 0 0 0/0/0

 

Boats are also different in BFV

ai.addSearchMap Boat2 1 1.4 30 4.0 0.3 2.5 0 0 0/0/0

 

(No level 3-5 pathmaps)

 

if you have experimented with amphibious stuff you probably have seen ai.setWaterCutOffDepth already. im not sure about what exactly this property does, as for now it effects are comparable to waterDepth, but for sure it doesnt work the way its been used in secret weapons. it is ai.setWaterCutOffDepth <vehiclenumber> <WaterCutOffDepth> and will influence the outcome of your pathmap as it can blend in/out deep water.

ai.setSmoothing <vehiclenumber> <smoothing> does not affect pathmaps, but the bots themselves and how closely they will follow their computed path. this is especially noticeable with infantry, on low settings like 2 they will follow exactly the orange line you see with aistats enabled, on higher settings like 20 they will be less strict in following the path.

these two files (AI.con and AIpathFinding.con) are all you need for pathmap generation. all other files concerning AI can be added later.

if you done with all this, start up the level in coop mode (as for now it must be coop, otherwise the game will not initalize some needed properties like vehiclecount). if youre on the bright side of life the game will not crash and you can create your pathmaps now. bring down the console, type ai.createAllMaps, wait a bit, change to your battlefield root dir, see the bf1942 folder then dive into it until you reach a shiny set of new pathmaps. if for some reason you dont like what you find there, feel free to adjust any param to the sickest value, but thats about the only advice i can give atm. its also possible to create maps for one vehicle only using ai.createMaps <vehiclenumber> or searchmaps (the big ones) only using ai.createSearchMaps <vehiclenumber>. <vehiclenumber> is the 1st number from ai.addSearchType (0,1,2).

if you didnt make it that far (means: bf crashed), you will most likely have a problem with the aitemplates now being loaded for that map. invasion of the philippines for example will die ugly if you attempt to load it with the unmodified files from above. first the game will miss an aitemplate for the type38mg and the elco80mg, then it will whine about an invalid vehicle number of 3 for the daihatsu and finally choke on it. while its pretty clear that you need to make the aitemplates, it may not initally spring to your mind that you need to add the fitting search maps and types for your map vehicles to the above files. in this case it would suffice to rip the boat and landingcraft sections out of midways aipathfinding.con and put them in your files. better be prepared to encounter such things, i wouldnt call the entire above procedure plug n play, but usually it works pretty well. on a side note, generation of these boat and landingcraft pathmaps takes longer than infantry or tanks, so dont immediately reboot if nothing happens and your mouse is frozen.

the biggest drawback using the above method is for now that there seems to be no way to adjust the position of individual smallones. that kinda screws a few maps like bocage, where the damn axis bots will never move straight over their bridge instead always taking a hard left turn over the higher ground, kinda like an U to reach it. situations like that seem to be unavoidable, but maybe someone finds a way. also theres progs like genPathmaps which follow another concept of creating smallones, which would perfecly suit these probs. anyway, have phun tryin to get those pesky bots to move.

laters,
ph0nk

ps: it seems for many people most problems arise after the generation whilst trying to get a solid SAI running. unfortunately i find it especially hard to write a nice guide pinning down the general process, as the possible problems are as many as the bugs that may pop up (with my personal favourite being the one Audiogod already posted on this thread, it at least shows were not the only ones struggling with AI) and the official documents concerning strategies are pretty complete. so i dare to say that the key to pathmapping is experience, if you want good results, you will have to spend time. ill try to give a few examples of strange behavior you may come across:
in the latter stages of bot implementation the debugger usually becomes concerningly quiet. this doesnt mean youre fine, it just means the errors get dumped to log only. for example "aiStrategy.createConstantCondition NoFriendlyCPCond Crisp Equal Hostile ControlPoint 0" will not raise an exception for an unknown ConditionSide named "Hostile" (should be Enemy), but the error can be seen in the log.
if you see your bots, especially vehicles, acting like Creutzfeldt-Jakob infected cows (turning in circles on a position, running left and right only, never leaving their spawn, but actually moving), look if your strategies allow for an attack on an isolated ControlPoint. see the northernmost CP on Liberation of Caen for example. when the game starts, axis have all CPs in the city. for the allied SAI its impossible to plan an attack on the northern area as long as its not occupying/is a direct neighbour of it. try to take a few CPs and see if things change. its also possible that you simply gave the wrong side to a strategic area, always have an eye on the stats above the strategic areas.
if you see a number greater than 0 behind D in the second row of these above mentioned stats, you should take a look at your Aggression/NumOfAtts/NumOfDefs settings. if you use a number between 1 and 0 for Aggression, you must distribute forces to attack and defend. otherwise these bots stand around in dumb places.
if youre having probs with strategies, the two numbers number behind the strategy name in the top left corner usually drop to 0/0. if you see this check your log for errors.
dont forget that youre able to set most parameters like the already mentioned Aggression/NumOfAtts/NumOfDefs in game, exploit that possibility to its fullest.

 

http://www.benandmandy.com/botinator

 

Cpl. Reynolds - are you running bf1942_r.exe in windows mode?

if not open up VideoDefault.con in the battlefield settings folder ( ..\..\Battlefield 1942\Mods\bf1942\Settings) and change

renderer.setFullScreen 1
to
renderer.setFullScreen 0




This is a really excellent find Ph0nk

I've just be giving this a quick test and for custom static objects you need to create a new folder called 'AIMeshes' in your Battlefield 1942 folder.

In this new 'AIMeshes' folder put a copy of your custom static meshes.

However they need to be renamed to end with _a1 instead of _m1

for example:

roadblock_m1.rs
roadblock_m1.sm

needs to be renamed to:

roadblock_a1.rs
roadblock_a1.sm

Note - if bf1942_r.exe cannot find your _a1 custom meshes then it will crash.

 

 

The debugger did a much better job of creating the pathfinding maps for Piti than I could.

I noticed that anoying debug assertion error for the Elco80MG and Type38MG aiTemplates, so I went in and rem'ed them out. There is only one reference to each.

You need to open up the Objects.rfa in the bf1942 mod folder (<gamepath>\Mods\bf1942\Archives\Objects.rfa)

Then go into:
Objects/Vehicles/Sea/Elco80/Objects.con and
Objects/Vehicles/Sea/Type38/Objects.con
find:
ObjectTemplate.aiTemplate Elco80MG and
ObjectTemplate.aiTemplate Type38MG
Respectively and add the place a 'rem' before each of these lines, then save the changes.

The file for the (machine gunner) ai template doesn't exist anyway.

The debugger stops complaining...

 

u missed ai.compileaimeshes
if you hit tab in the console it'll show you all possible completions for a command, kinda like bash in linux.
so if you did ai.<tab><tab> it would show you all commands for ai. pressing tab again shows you what arguments a command expects

 

 

ok ill try to make it simple

i dont post much unless i can help...you can search for my name and check

if i ask a question usually its ignored

and most of all ive actually been e-mailed that its to hard to understand my posts because of run on sentences and bad grammer

so to keep from getting email i dont post much sorry

as for the pt boats i dont have them working the way i think they should work but they do go up to the destroyers on midway and fire torpedoes at them

but the gunners work fine and the boats zip around

i can usually get anybodys stuff to work with bots so ask away and i will help

but i cant guarantee good grammer



also the best thing you can do is BUY the expansion packs and read the code...its all there
i dont have an education past 8th grade so if i can get it you guys definately can

also the mdt is the best thing out besides the debugger

ive actually learned some stuff from there on ai

back to business

first thing to do is find a compatible vehicle and equiptment type

as there are no pt boats ingame i had to make an equiptment type

its the same as a boat but the boat uses 2d fire...which is no good
it needs to fire direct

so i gave it the same as tanks ...fireinfantery which is spelled wrong but we all know that story already

now i have not played with that stuff yet i only made it to see if i could get it to work

all of this stuff is in the AIbehaviors.con
in the game.rfa

read the mdt tutorial on making new behaviors it will explain it better than i can

i made the greater number of equiptment types that fourcents is talking about
i dont think there are more just you can make combinations of whats there to make certain vehicles work better

ive even made a artytank that fires arty and drives
its works on decrappers brummbar

i will apply it to the new sexton also as there are no vehicles that are mobile and fire arty from the same seat

also the objects and weapons .cons in the ai folder are critical
not just the equiptment type

it all works together

i have yet to come across a vehicle or weapon i couldnt get the bots to use

the day after EOD was released i posted pictures of me playing with bots on guadalcanal

i got bots firing a10 guns and rockets and have even gotten choppers to fire
not just the gunners the pilots too but its few and far between as its very difficult to get them to fly them right...im constantly tweaking them

now im into maps


also the pak gun is not new its in road to rome
dnamro which sea vehicle are you talking about and how did you set up the objects and weps

 

 

This is continuation of a thread that got off track in another forum. WHDACV and Fourcentsshy provided this info for getting the PT boats working with bots.

missing types:

aiSettings.setVehicle 18 AmphibiousTank
aiSettings.setVehicle 19 Helicopter
aiSettings.setVehicle 20 ArmedCar
aiSettings.setVehicle 21 ArmedBoat
aiSettings.setVehicle 22 ArtyTank
aiSettings.setVehicle 23 ArtyCarDriver

then the vehicle has to be defined something like this

rem *** PTArmedBoat Behaviour setup ***
aiSettings.setVehicleBehaviour ArmedBoat Avoid BBAvoid BBPAvoidCollision2d 1 0 UCUnion AvoidInhibit
aiSettings.setVehicleBehaviour ArmedBoat MoveTo BBMoveTo BBPGotoWaypoint2d 5 0 UCUnion UnitWeights
aiSettings.setVehicleBehaviour ArmedBoat Idle BBIdle BBPIdle2d 5 0 UCUnion UnitWeights
aiSettings.setVehicleBehaviour ArmedBoat Fire BBFireInfantery BBPFireInfantery 3 0 UCFire UnitWeights
aiSettings.setVehicleBehaviour ArmedBoat Scout BBScout BBPScout 7 0 UCUnion UnitWeights
aiSettings.setVehicleBehaviour ArmedBoat Change BBChangeTeleport BBPChangeTeleport 6 0 UCUnion ChangeInhibit
aiSettings.setVehicleDefaultBehaviour ArmedBoat Idle
aiSettings.addInterpreterEntry ArmedBoat MoveToMediumBoat Medium
aiSettings.addInterpreterEntry ArmedBoat MoveToObjectMediumBoat Medium
aiSettings.addInterpreterEntry ArmedBoat InfoWrapper
aiSettings.addInterpreterEntry ArmedBoat BoatMoveTo
aiSettings.addInterpreterEntry ArmedBoat BoatMoveToDirection
aiSettings.addInterpreterEntry ArmedBoat BoatMoveToObject
aiSettings.addInterpreterEntry ArmedBoat Trigger
aiSettings.addInterpreterEntry ArmedBoat TriggerContinously
aiSettings.addInterpreterEntry ArmedBoat MouseTurretLookAt
aiSettings.addInterpreterEntry ArmedBoat MouseTurretAimAt
aiSettings.addInterpreterEntry ArmedBoat Sense
aiSettings.addInterpreterEntry ArmedBoat BoatResetControls
aiSettings.activateDefaultInterpreter ArmedBoat BAPSTParallel Full
aiSettings.activateDefaultInterpreter ArmedBoat BAPSTSerial Full
aiSettings.activateDefaultInterpreter ArmedBoat BAPSTIf Full
aiSettings.activateDefaultInterpreter ArmedBoat BAPSTPlanEnd Full
aiSettings.activateDefaultInterpreter ArmedBoat BAPSTWait Full
aiSettings.activateDefaultInterpreter ArmedBoat BAPSTWhile Full
rem aiSettings.activateDefaultInterpreter ArmedBoat BAPSTInfoWrapper Full
aiSettings.activateDefaultInterpreter ArmedBoat BAPSTWeaponWrapper Full
aiSettings.activateDefaultInterpreter ArmedBoat BAPSTAimingWrapper Full
aiSettings.activateDefaultInterpreter ArmedBoat BAPSTFinishedWrapper Full
aiSettings.activateDefaultInterpreter ArmedBoat BAPSTUpdateVehicle Full
aiSettings.activateDefaultInterpreter ArmedBoat BAPSTChangeWeapon Full
aiSettings.activateDefaultInterpreter ArmedBoat BAPSTICTurnLock Full
aiSettings.activateDefaultInterpreter ArmedBoat BAPSTICChangeVehicle Full
aiSettings.activateDefaultInterpreter ArmedBoat BAPSTICScout Full
aiSettings.activateDefaultInterpreter ArmedBoat BAPSTEvaluate Full
aiSettings.activateDefaultInterpreter ArmedBoat BAPSTNotifyBot Full
aiSettings.activateDefaultInterpreter ArmedBoat BAPSTIdle Full

in the ai directory you need the weapons.con for the PT (or sub):

rem *** Add gun ***
weaponTemplate.create Elco80TorpedoAI
weaponTemplate.burst 0
weaponTemplate.indirect 0
weaponTemplate.minRange 0.0
weaponTemplate.maxRange 400.0
weaponTemplate.weaponActivate PINone
weaponTemplate.weaponFire PIFire
weaponTemplate.setStrength Infantry 3.0
weaponTemplate.setStrength LightArmour 5.0
weaponTemplate.setStrength HeavyArmour 9.0
weaponTemplate.setStrength NavalArmour 10.0
weaponTemplate.setStrength Submarine 0.0
weaponTemplate.setStrength Air 0.0

rem *** Add gun ***
weaponTemplate.create Elco80MineAI
weaponTemplate.burst 0
weaponTemplate.indirect 1
weaponTemplate.minRange 0.0
weaponTemplate.maxRange 150.0
weaponTemplate.weaponActivate PINone
weaponTemplate.weaponFire PIAltFire
weaponTemplate.setStrength Infantry 0.0
weaponTemplate.setStrength LightArmour 1.0
weaponTemplate.setStrength HeavyArmour 3.0
weaponTemplate.setStrength NavalArmour 8.0
weaponTemplate.setStrength Submarine 0.0
weaponTemplate.setStrength Air 0.0

rem *** Add Browning Machine Gun ***
weaponTemplate.create Elco80BrowningAI
weaponTemplate.burst 1
weaponTemplate.indirect 0
weaponTemplate.minRange 0.0
weaponTemplate.maxRange 300.0
weaponTemplate.weaponActivate PINone
weaponTemplate.deviationCorrectionTime 1
weaponTemplate.weaponFire PIFire
weaponTemplate.setStrength Infantry 12.0
weaponTemplate.setStrength LightArmour 7.0
weaponTemplate.setStrength HeavyArmour 0.0
weaponTemplate.setStrength NavalArmour 0.0
weaponTemplate.setStrength Submarine 0.0
weaponTemplate.setStrength Air 5.0

 

 

A little clarification, since I have played with AIbehaviors:

this part would be added to the AIbehaviors.con file in the game.rfa:

This would be added to the existing list of AIvehicle behaviors

The number of AIvehicle behaviors would need to be incremented to the last one, and only the ArmedBoat behavior is provided. The others are missing from this code:

aiSettings.setVehicle 18 AmphibiousTank
aiSettings.setVehicle 19 Helicopter
aiSettings.setVehicle 20 ArmedCar
aiSettings.setVehicle 21 ArmedBoat
aiSettings.setVehicle 22 ArtyTank
aiSettings.setVehicle 23 ArtyCarDriver

then the vehicle has to be defined something like this

rem *** PTArmedBoat Behaviour setup ***
aiSettings.setVehicleBehaviour ArmedBoat Avoid BBAvoid BBPAvoidCollision2d 1 0 UCUnion AvoidInhibit
aiSettings.setVehicleBehaviour ArmedBoat MoveTo BBMoveTo BBPGotoWaypoint2d 5 0 UCUnion UnitWeights
aiSettings.setVehicleBehaviour ArmedBoat Idle BBIdle BBPIdle2d 5 0 UCUnion UnitWeights
aiSettings.setVehicleBehaviour ArmedBoat Fire BBFireInfantery BBPFireInfantery 3 0 UCFire UnitWeights
aiSettings.setVehicleBehaviour ArmedBoat Scout BBScout BBPScout 7 0 UCUnion UnitWeights
aiSettings.setVehicleBehaviour ArmedBoat Change BBChangeTeleport BBPChangeTeleport 6 0 UCUnion ChangeInhibit
aiSettings.setVehicleDefaultBehaviour ArmedBoat Idle
aiSettings.addInterpreterEntry ArmedBoat MoveToMediumBoat Medium
aiSettings.addInterpreterEntry ArmedBoat MoveToObjectMediumBoat Medium
aiSettings.addInterpreterEntry ArmedBoat InfoWrapper
aiSettings.addInterpreterEntry ArmedBoat BoatMoveTo
aiSettings.addInterpreterEntry ArmedBoat BoatMoveToDirection
aiSettings.addInterpreterEntry ArmedBoat BoatMoveToObject
aiSettings.addInterpreterEntry ArmedBoat Trigger
aiSettings.addInterpreterEntry ArmedBoat TriggerContinously
aiSettings.addInterpreterEntry ArmedBoat MouseTurretLookAt
aiSettings.addInterpreterEntry ArmedBoat MouseTurretAimAt
aiSettings.addInterpreterEntry ArmedBoat Sense
aiSettings.addInterpreterEntry ArmedBoat BoatResetControls
aiSettings.activateDefaultInterpreter ArmedBoat BAPSTParallel Full
aiSettings.activateDefaultInterpreter ArmedBoat BAPSTSerial Full
aiSettings.activateDefaultInterpreter ArmedBoat BAPSTIf Full
aiSettings.activateDefaultInterpreter ArmedBoat BAPSTPlanEnd Full
aiSettings.activateDefaultInterpreter ArmedBoat BAPSTWait Full
aiSettings.activateDefaultInterpreter ArmedBoat BAPSTWhile Full
rem aiSettings.activateDefaultInterpreter ArmedBoat BAPSTInfoWrapper Full
aiSettings.activateDefaultInterpreter ArmedBoat BAPSTWeaponWrapper Full
aiSettings.activateDefaultInterpreter ArmedBoat BAPSTAimingWrapper Full
aiSettings.activateDefaultInterpreter ArmedBoat BAPSTFinishedWrapper Full
aiSettings.activateDefaultInterpreter ArmedBoat BAPSTUpdateVehicle Full
aiSettings.activateDefaultInterpreter ArmedBoat BAPSTChangeWeapon Full
aiSettings.activateDefaultInterpreter ArmedBoat BAPSTICTurnLock Full
aiSettings.activateDefaultInterpreter ArmedBoat BAPSTICChangeVehicle Full
aiSettings.activateDefaultInterpreter ArmedBoat BAPSTICScout Full
aiSettings.activateDefaultInterpreter ArmedBoat BAPSTEvaluate Full
aiSettings.activateDefaultInterpreter ArmedBoat BAPSTNotifyBot Full
aiSettings.activateDefaultInterpreter ArmedBoat BAPSTIdle Full

 

 

WHDACV said he was still playing with it, but fine work!

The VehicleAI.pdf is a must read for those who don't understand any of this. It doesn't seem complete, but it does take you through the process of adding a vehicle, step by step.

There are 2 files in both PT boat AI directories: Objects.con and Weapons.con. WHDACV's Weapons.con for the elco80 list listed above. I didn't send the elco80 Objects.con in the PM because it seemed like it might be too long and I left out the type38 because it's no more than a simple search and replace of the elco80

Here is the WHDACV's elco80 Objects.con:

Code:

aiTemplatePlugIn.create Armament Elco80Arms
 
aiTemplatePlugIn.create Unit Elco80Unit
aiTemplatePlugIn.equipmentType 21
aiTemplatePlugIn.setStrategicStrength 0 5
aiTemplatePlugIn.setStrategicStrength 1 5
 
aiTemplatePlugIn.create Mobile Elco80Mobile
aiTemplatePlugIn.vehicleNumber 2
aiTemplatePlugIn.maxSpeed 44.0
rem worksaiTemplatePlugIn.maxSpeed 45.0
rem aiTemplatePlugIn.maxSpeed 35.0
aiTemplatePlugIn.turnRadius 15.0
aiTemplatePlugIn.coverSearchRadius 550.0
aiTemplatePlugIn.avoidCollisionLookAhead 10.0
 
aiTemplatePlugIn.create Physical Elco80Physical
aiTemplatePlugIn.setStrType LightArmour
 
aiTemplatePlugIn.create ControlInfo Elco80ControlInfo
aiTemplatePlugIn.driveTurnControl           PIYaw
aiTemplatePlugIn.driveThrottleControl       PIThrottle
aiTemplatePlugIn.aimHorizontalControl       PIYaw
aiTemplatePlugIn.aimVerticalControl         PIMouseLookY
aiTemplatePlugIn.lookHorizontalControl      PIMouseLookX
aiTemplatePlugIn.lookVerticalControl        PIMouseLookY
aiTemplatePlugIn.throttleSensitivity       -1.0
aiTemplatePlugIn.pitchSensitivity           0.21817
aiTemplatePlugIn.rollSensitivity           -0.21817
aiTemplatePlugIn.yawSensitivity            -2.5
aiTemplatePlugIn.lookVerticalSensitivity    0.21817
aiTemplatePlugIn.lookHorizontalSensitivity -0.21817
aiTemplatePlugIn.throttleLookAhead          1.0
aiTemplatePlugIn.pitchLookAhead             1.0
aiTemplatePlugIn.rollLookAhead              1.0
aiTemplatePlugIn.yawLookAhead               1.0
aiTemplatePlugIn.lookVerticalLookAhead      1.0
aiTemplatePlugIn.lookHorizontalLookAhead    1.0
aiTemplatePlugIn.throttleScale              1.0
rem *** Angle in radians ***
aiTemplatePlugIn.pitchScale                 5.0
aiTemplatePlugIn.rollScale                  5.0
aiTemplatePlugIn.yawScale                   0.0020
aiTemplatePlugIn.lookVerticalScale          1.0
aiTemplatePlugIn.lookHorizontalScale        1.0
aiTemplatePlugIn.setCameraRelativeMinRotationDeg -0/-30/0
aiTemplatePlugIn.setCameraRelativeMaxRotationDeg 0/10/0
 
rem *** AITemplate ***
aiTemplate.create Elco80AI
aiTemplate.addType ITMobile
aiTemplate.addType ITBiological
aiTemplate.addType ITNaval
aiTemplate.addType ITUnit
rem aiTemplate.addType ITObstructedView
aiTemplate.degeneration 50
aiTemplate.allowedTimeDiff 2
aiTemplate.basicTemp 25
aiTemplate.commonKnowledge 0
aiTemplate.addPlugIn Elco80Unit
aiTemplate.addPlugIn Elco80Physical
aiTemplate.addPlugIn Elco80ControlInfo
aiTemplate.addPlugIn Elco80Mobile
aiTemplate.addPlugIn Elco80Arms
 
rem  *** The  Deck MG
rem **************************************************  ****************************************
rem **************************************************  ****************************************
 
rem *** Plugins ***
aiTemplatePlugIn.create Armament Elco80MgArms
aiTemplatePlugIn.setIsAntiAircraft 1
 
aiTemplatePlugIn.create Unit Elco80MgUnit
aiTemplatePlugIn.equipmentType 9
aiTemplatePlugIn.setStrategicStrength 0 2
aiTemplatePlugIn.setStrategicStrength 1 2
aiTemplatePlugIn.setSelectKey PIMenuSelect2
aiTemplatePlugIn.setHasExposedSoldier 1
 
aiTemplatePlugIn.create ControlInfo Elco80MgCtrl
aiTemplatePlugIn.driveTurnControl           PIYaw
aiTemplatePlugIn.driveThrottleControl       PIThrottle
aiTemplatePlugIn.aimHorizontalControl       PIMouseLookX
aiTemplatePlugIn.aimVerticalControl         PIMouseLookY
aiTemplatePlugIn.lookHorizontalControl      PIMouseLookX
aiTemplatePlugIn.lookVerticalControl        PIMouseLookY
aiTemplatePlugIn.throttleSensitivity       -1.0
aiTemplatePlugIn.pitchSensitivity           0.21817
aiTemplatePlugIn.rollSensitivity           -0.21817
aiTemplatePlugIn.yawSensitivity            -2.5
aiTemplatePlugIn.lookVerticalSensitivity    0.21817
aiTemplatePlugIn.lookHorizontalSensitivity -0.21817
aiTemplatePlugIn.throttleLookAhead          1.0
aiTemplatePlugIn.pitchLookAhead             1.0
aiTemplatePlugIn.rollLookAhead              1.0
aiTemplatePlugIn.yawLookAhead               1.0
aiTemplatePlugIn.lookVerticalLookAhead      1.0
aiTemplatePlugIn.lookHorizontalLookAhead    1.0
aiTemplatePlugIn.throttleScale              1.0
rem *** Angle in radians ***
aiTemplatePlugIn.pitchScale                 5.0
aiTemplatePlugIn.rollScale                  5.0
aiTemplatePlugIn.yawScale                   0.0020
aiTemplatePlugIn.lookVerticalScale          1.0
aiTemplatePlugIn.lookHorizontalScale        1.0
aiTemplatePlugIn.setCameraRelativeMinRotationDeg -360/-45/0
aiTemplatePlugIn.setCameraRelativeMaxRotationDeg 360/10/0
 
rem *** AITemplate ***
aiTemplate.create Elco80MG
aiTemplate.addType ITUnit
aiTemplate.addType ITBiological
aiTemplate.addType ITNaval
aiTemplate.degeneration 20
aiTemplate.allowedTimeDiff 1
aiTemplate.basicTemp 6
aiTemplate.commonKnowledge 0
aiTemplate.secondary 1
aiTemplate.addPlugIn Elco80MgArms
aiTemplate.addPlugIn Elco80MgUnit
aiTemplate.addPlugIn Elco80MgCtrl

 

 

http://www.intergate.com/~glyph/bf1942/VehicleAI.pdf

 

WHDACV

My Subs still can't fire torpedoes.

I had allready created a custom sub AIbehavior type with your mentioned changes. But I went ahead and tried your AIbehavior changes.

I even tried adding PTboat torps to the sub. ( I adjusted the firearms positions so the visible torps are below the water line).
I can get in and fire, but bots just ignore the torps.

Bots can pilot but won't fire:

Appreciate any help you can give me.

rem *** Gato object.con***
ObjectTemplate.create PlayerControlObject Gato
ObjectTemplate.aiTemplate GatoAI
ObjectTemplate.setNetworkableInfo GatoBodyInfo

ObjectTemplate.saveInSeparateFile 1
ObjectTemplate.hasMobilePhysics 1
ObjectTemplate.drag 0.2
ObjectTemplate.mass 800000
ObjectTemplate.hasCollisionPhysics 1
ObjectTemplate.hasResponsePhysics 1
ObjectTemplate.hasArmor 1
ObjectTemplate.hitpoints 200
ObjectTemplate.maxhitpoints 200
ObjectTemplate.material 57
ObjectTemplate.criticalDamage 100
ObjectTemplate.hpLostWhileCriticalDamage 1.5
ObjectTemplate.explosionForceMod 50
ObjectTemplate.dontClearTeamOnExit 1
ObjectTemplate.speedMod 0.05
ObjectTemplate.addArmorEffect 137 em_GatoDamage 0/0/0
ObjectTemplate.addArmorEffect 0 WaterExplosionSub 0/0/0
rem -------------------------------------
ObjectTemplate.addTemplate lodGato
ObjectTemplate.addTemplate GatoFloater
ObjectTemplate.setPosition 0/2/32
ObjectTemplate.addTemplate GatoFloater
ObjectTemplate.setPosition -2.499/2/16
ObjectTemplate.addTemplate GatoFloater
ObjectTemplate.setPosition 2.5/2/16
ObjectTemplate.addTemplate GatoFloater
ObjectTemplate.setPosition -3.499/2/0
ObjectTemplate.addTemplate GatoFloater
ObjectTemplate.setPosition 3.5/2/0
ObjectTemplate.addTemplate GatoFloater
ObjectTemplate.setPosition -2.499/2/-15.999
ObjectTemplate.addTemplate GatoFloater
ObjectTemplate.setPosition 2.5/2/-15.999
ObjectTemplate.addTemplate GatoFloater
ObjectTemplate.setPosition 0/2/-31.999
ObjectTemplate.addTemplate e_waterfrontBigSub
ObjectTemplate.setPosition 0/1/54
ObjectTemplate.addTemplate e_Water06Dive
ObjectTemplate.setPosition 0/6/20
ObjectTemplate.addTemplate e_Water510Dive
ObjectTemplate.setPosition 0/3/23
ObjectTemplate.addTemplate e_Water10BDive
ObjectTemplate.setPosition 0/0/55
ObjectTemplate.addTemplate e_Water10BDiveBack
ObjectTemplate.setPosition 0/0/-25.999
ObjectTemplate.addTemplate e_waterBoatSvallSub
ObjectTemplate.setPosition 0/0/55
ObjectTemplate.setRotation 90/0/0
ObjectTemplate.addTemplate e_waterBoatSvallSub
ObjectTemplate.setPosition 0/0/-26
ObjectTemplate.setRotation 270/0/0
rem -------------------------------------
ObjectTemplate.subPos 1
ObjectTemplate.setSoldierExitLocation 0/4.3/5 0/0/0
ObjectTemplate.GUIIndex 86
ObjectTemplate.setVehicleIcon "Vehicle/Icon_gato.tga"
ObjectTemplate.setVehicleIconPos 60/85
ObjectTemplate.setNumberOfWeaponIcons 1
ObjectTemplate.setPrimaryAmmoIcon "Ammo/Icon_torpedo.tga"
ObjectTemplate.setPrimaryAmmoBar ABAmmoBarReloadBar
ObjectTemplate.setCrossHairType CHTNone
ObjectTemplate.setVehicleCategory VCSea
ObjectTemplate.setVehicleType VTSubmarine
ObjectTemplate.setToolTipType TTSubmarine
ObjectTemplate.setMinimapIcon "Minimap/minimap_icon_submarine_32x32.tga"
ObjectTemplate.setMinimapIconSize 32
rem *** <oxygenUsagerate> <oxygenFillrate> <oxygenDamageRate> <periscopeMinDepth> <periscopeMaxDepth> <maxDepth> <maxDepthDamageRate>
ObjectTemplate.submarineData 0.009 0.03 1 10 19.5 40 5
ObjectTemplate.setSubmarineHudDepthModifier 5.9
ObjectTemplate.setSubmarineHudDirModifier 0.01

ObjectTemplate.disableSpawnPointsOnEnter 0

rem *** lodGato ***
ObjectTemplate.create LodObject lodGato
ObjectTemplate.hasMobilePhysics 1
ObjectTemplate.hasCollisionPhysics 1
ObjectTemplate.hasResponsePhysics 1
rem -------------------------------------
ObjectTemplate.addTemplate GatoComplex
ObjectTemplate.addTemplate GatoSimple
rem -------------------------------------
ObjectTemplate.lodSelector GatoLodSelector


rem *** GatoComplex ***
ObjectTemplate.create Bundle GatoComplex
ObjectTemplate.setNetworkableInfo GatoBodyInfo
ObjectTemplate.geometry Gato_Hull_m1
ObjectTemplate.hasMobilePhysics 1
ObjectTemplate.hasCollisionPhysics 1
ObjectTemplate.hasResponsePhysics 1
rem -------------------------------------
ObjectTemplate.addTemplate SubmarineSonar
ObjectTemplate.addTemplate GatoEngine
ObjectTemplate.setPosition 0/0/-30
ObjectTemplate.addTemplate GatoRudder
ObjectTemplate.setPosition 0/-3/-30
ObjectTemplate.setRotation 0/0/-90
ObjectTemplate.addTemplate GatoHullWing
ObjectTemplate.setPosition 0/-3/30
ObjectTemplate.setRotation 0/0/-90
ObjectTemplate.addTemplate GatoDriverSoldierSpawn
ObjectTemplate.setPosition 0/2.75/8.8
ObjectTemplate.addTemplate GatoEntry
ObjectTemplate.setPosition 5/1.9/18.5
ObjectTemplate.addTemplate GatoEntry
ObjectTemplate.setPosition 5/1.9/10.5
ObjectTemplate.addTemplate GatoEntry
ObjectTemplate.setPosition -5/1.9/18.5
ObjectTemplate.addTemplate GatoEntry
ObjectTemplate.setPosition -5/1.9/10.5

rem ObjectTemplate.addTemplate GatoDaiHatsuSpawner
rem ObjectTemplate.setPosition 1.54/2.55/5.44

ObjectTemplate.addTemplate GatoCamera
ObjectTemplate.setPosition 0/14.9/20.2
ObjectTemplate.addTemplate GatoRudderFrontL
ObjectTemplate.setPosition -1.358/-0.776/47.214
ObjectTemplate.addTemplate GatoRudderFrontR
ObjectTemplate.setPosition 1.359/-0.776/47.214
ObjectTemplate.addTemplate GatoRudderBackUD
ObjectTemplate.setPosition 0/-3.317/-33.502
ObjectTemplate.addTemplate Gato_Torpedos
ObjectTemplate.setPosition 0/0/60
rem ObjectTemplate.addTemplate TorpedTub
rem ObjectTemplate.setPosition 1.6/-0.499/57.7
rem ObjectTemplate.addTemplate TorpedTub
rem ObjectTemplate.setPosition -1.6/-0.499/57.7
ObjectTemplate.addTemplate GatoRadar
ObjectTemplate.setPosition 0/10.177/19.022
rem -------------------------------------

rem *** GatoDriverSoldierSpawn ***
ObjectTemplate.create SpawnPoint GatoDriverSoldierSpawn
ObjectTemplate.setSpawnRotation 0/0/0
ObjectTemplate.setSpawnPositionOffset 0/0/0
ObjectTemplate.setSpawnPreventionDelay 0
ObjectTemplate.setSpawnId 0
ObjectTemplate.setGroup 79
rem ObjectTemplate.setEnterOnSpawn 1
ObjectTemplate.setAIEnterOnSpawn 1
ObjectTemplate.setSpawnAsParaTroper 0


rem *** GatoEntry ***
ObjectTemplate.create EntryPoint GatoEntry
ObjectTemplate.setEntryRadius 8


rem *** GatoDaiHatsuSpawner ***
ObjectTemplate.create ObjectSpawner GatoDaiHatsuSpawner
ObjectTemplate.geometry spawnbutton_m1
ObjectTemplate.hasCollisionPhysics 1
ObjectTemplate.setObjectTemplate 1 DaiHatsu
ObjectTemplate.setObjectTemplate 2 DaiHatsu
ObjectTemplate.minSpawnDelay 20
ObjectTemplate.maxSpawnDelay 20
ObjectTemplate.TimeToLive 30
ObjectTemplate.Distance 20
ObjectTemplate.useButtonRadius 2
ObjectTemplate.spawnOffset -5.5/-2/0
ObjectTemplate.damageWhenLost 10


rem *** GatoCamera ***
ObjectTemplate.create Camera GatoCamera
ObjectTemplate.setMinRotation -170/0/0
ObjectTemplate.setMaxRotation 170/0/0
ObjectTemplate.setMaxSpeed 90/0/0
ObjectTemplate.setAcceleration 5000/0/0
ObjectTemplate.setInputToYaw c_PIMouseLookX
ObjectTemplate.setInputToPitch c_PIMouseLookY


rem *** GatoRadar ***
ObjectTemplate.create RotationalBundle GatoRadar
ObjectTemplate.geometry Gato_Radar_m1
ObjectTemplate.setMaxSpeed 100/0/0
ObjectTemplate.setAcceleration 10000/0/0
ObjectTemplate.setContinousRotationSpeed 100/0/0


rem *** GatoSimple ***
ObjectTemplate.create SimpleObject GatoSimple
ObjectTemplate.geometry Gato_Hull_m1


rem *** GatoLodSelector ***
LodSelectorTemplate.create DistCompareSelector2 GatoLodSelector
LodSelectorTemplate.addLodDistance 150

rem * Gato Weapons.con

rem *** Torpedos ***
ObjectTemplate.create FireArms Gato_Torpedos
ObjectTemplate.setNetworkableInfo TankFireArmInfo
ObjectTemplate.aiTemplate GatoTorpAI
ObjectTemplate.setAsynchronyFire 1
ObjectTemplate.projectileTemplate PTBoatTorpedo
ObjectTemplate.projectilePosition 0/-1.5/3.55
ObjectTemplate.visibleDummyProjectileTemplate PT_Dummy_Torpedo
ObjectTemplate.magSize 2
ObjectTemplate.numOfMag 5
ObjectTemplate.velocity 30
ObjectTemplate.autoReload 1
ObjectTemplate.reloadtime 10
ObjectTemplate.roundOfFire 3.5
ObjectTemplate.fireOnce 1
ObjectTemplate.setInputFire c_PIFire
ObjectTemplate.AmmoType 15

ObjectTemplate.addFirearmsPosition -1/-2/0.4 0/0/0
ObjectTemplate.addFirearmsPosition 1/-2/0.4 0/0/0

ObjectTemplate.loadSoundScript Sounds/PT_Torpedo_Left.ssc

rem *** PT_Dummy_Torpedo ***
ObjectTemplate.create SimpleObject PT_Dummy_Torpedo
ObjectTemplate.geometry Torpedo_Sml_m1

rem *******************************
rem *** PTBoatTorpedo ***
rem *******************************

rem *** PTBoatTorpedo ***
ObjectTemplate.create Projectile PTBoatTorpedo
ObjectTemplate.geometry Torpedo_Sml_M1
ObjectTemplate.saveInSeparateFile 1
ObjectTemplate.timeToLive CRD_NONE/20/0/0
ObjectTemplate.endEffectTemplate WaterExplosionTorpedo
ObjectTemplate.gravityModifier 1.0
ObjectTemplate.hasMobilePhysics 1
ObjectTemplate.hasCollisionPhysics 1
ObjectTemplate.hasCollisionEffect 1
ObjectTemplate.hasResponsePhysics 1
ObjectTemplate.setHasPointPhysics 0
ObjectTemplate.DetonateOnWaterCollision 0
ObjectTemplate.drag 0.04
ObjectTemplate.mass 200
ObjectTemplate.material 250
ObjectTemplate.radius 30
rem -------------------------------------------------
ObjectTemplate.addTemplate e_WaterTorpedo
ObjectTemplate.setPosition 0/0/0
ObjectTemplate.setRotation 0/0/0

ObjectTemplate.addTemplate Shallow_Torpedo_Floater
ObjectTemplate.setPosition 0/3/-2
ObjectTemplate.setRotation 0/0/0

ObjectTemplate.addTemplate Shallow_Torpedo_Floater
ObjectTemplate.setPosition 0/3/2
ObjectTemplate.setRotation 0/0/0

ObjectTemplate.addTemplate Shallow_Torpedo_Engine
ObjectTemplate.setPosition 0/0/-3
ObjectTemplate.setRotation 0/0/0

ObjectTemplate.addTemplate Torpedo_Wing
ObjectTemplate.setPosition 0/0/-3
ObjectTemplate.setRotation 0/0/0

ObjectTemplate.addTemplate Torpedo_Wing
ObjectTemplate.setPosition 0/0/-3
ObjectTemplate.setRotation 0/0/-90

rem *** Shallow_Torpedo_Engine ***
ObjectTemplate.create Engine Shallow_Torpedo_Engine
ObjectTemplate.setPosition 0/0/90
ObjectTemplate.setRotation 0/0/0
ObjectTemplate.setPivotPosition 0/0/0
ObjectTemplate.setMinRotation 0/0/0
ObjectTemplate.setMaxRotation 0/0/15000
ObjectTemplate.setMaxSpeed 0/0/17500
ObjectTemplate.setAcceleration 0/0/25000
ObjectTemplate.setContinousRotationSpeed 0/0/0
ObjectTemplate.setInputToRoll c_PIThrottle
ObjectTemplate.setEngineType c_ETTorpedo
ObjectTemplate.setTorque 12.5
ObjectTemplate.setNoPropellerEffectAtSpeed 200
ObjectTemplate.setDifferential 5
ObjectTemplate.setAutomaticReset 1
ObjectTemplate.loadSoundScript Sounds/TorpedEngine.ssc

rem *** Shallow_Torpedo_Floater ***
ObjectTemplate.create FloatingBundle Shallow_Torpedo_Floater
ObjectTemplate.saveInSeparateFile 1
ObjectTemplate.setHullHeight 6.3
ObjectTemplate.setFloatMaxLift 7.9
ObjectTemplate.setFloatMinLift 7.9
ObjectTemplate.setDragModifier 8000.0
ObjectTemplate.setMinRotation 0/0.5/0
ObjectTemplate.setMaxRotation 0/0.5/0
ObjectTemplate.setMaxSpeed 0/0.1/0
ObjectTemplate.setAcceleration 0/-0.1/0
ObjectTemplate.setInputToPitch 1
ObjectTemplate.setAutomaticReset 1

rem *** Shallow_Torpedo_Wing ***
ObjectTemplate.create Wing Shallow_Torpedo_Wing
ObjectTemplate.setWingLift 0.4

rem gato ai\object.con

aiTemplatePlugIn.create Armament GatoArms

aiTemplatePlugIn.create Unit GatoUnit
aiTemplatePlugIn.equipmentType 19
aiTemplatePlugIn.setStrategicStrength 0 5
aiTemplatePlugIn.setStrategicStrength 1 5

aiTemplatePlugIn.create Mobile GatoMobile
aiTemplatePlugIn.vehicleNumber 2
aiTemplatePlugIn.maxSpeed 44.0
rem worksaiTemplatePlugIn.maxSpeed 45.0
rem aiTemplatePlugIn.maxSpeed 35.0
aiTemplatePlugIn.turnRadius 15.0
aiTemplatePlugIn.coverSearchRadius 550.0
aiTemplatePlugIn.avoidCollisionLookAhead 10.0

aiTemplatePlugIn.create Physical GatoPhysical
aiTemplatePlugIn.setStrType LightArmour

aiTemplatePlugIn.create ControlInfo GatoControlInfo
aiTemplatePlugIn.driveTurnControl PIYaw
aiTemplatePlugIn.driveThrottleControl PIThrottle
aiTemplatePlugIn.aimHorizontalControl PIYaw
aiTemplatePlugIn.aimVerticalControl PIMouseLookY
aiTemplatePlugIn.lookHorizontalControl PIMouseLookX
aiTemplatePlugIn.lookVerticalControl PIMouseLookY
aiTemplatePlugIn.throttleSensitivity -1.0
aiTemplatePlugIn.pitchSensitivity 0.21817
aiTemplatePlugIn.rollSensitivity -0.21817
aiTemplatePlugIn.yawSensitivity -2.5
aiTemplatePlugIn.lookVerticalSensitivity 0.21817
aiTemplatePlugIn.lookHorizontalSensitivity -0.21817
aiTemplatePlugIn.throttleLookAhead 1.0
aiTemplatePlugIn.pitchLookAhead 1.0
aiTemplatePlugIn.rollLookAhead 1.0
aiTemplatePlugIn.yawLookAhead 1.0
aiTemplatePlugIn.lookVerticalLookAhead 1.0
aiTemplatePlugIn.lookHorizontalLookAhead 1.0
aiTemplatePlugIn.throttleScale 1.0
rem *** Angle in radians ***
aiTemplatePlugIn.pitchScale 5.0
aiTemplatePlugIn.rollScale 5.0
aiTemplatePlugIn.yawScale 0.0020
aiTemplatePlugIn.lookVerticalScale 1.0
aiTemplatePlugIn.lookHorizontalScale 1.0
aiTemplatePlugIn.setCameraRelativeMinRotationDeg -0/-30/0
aiTemplatePlugIn.setCameraRelativeMaxRotationDeg 0/10/0

rem *** AITemplate ***
aiTemplate.create GatoAI
aiTemplate.addType ITMobile
aiTemplate.addType ITBiological
aiTemplate.addType ITNaval
aiTemplate.addType ITUnit
rem aiTemplate.addType ITObstructedView
aiTemplate.degeneration 50
aiTemplate.allowedTimeDiff 2
aiTemplate.basicTemp 25
aiTemplate.commonKnowledge 0
aiTemplate.addPlugIn GatoUnit
aiTemplate.addPlugIn GatoPhysical
aiTemplate.addPlugIn GatoControlInfo
aiTemplate.addPlugIn GatoMobile
aiTemplate.addPlugIn GatoArms

rem Gato ai\weapon.con


rem *** Add gun ***
weaponTemplate.create GatoTorpAI
weaponTemplate.burst 0
weaponTemplate.indirect 0
weaponTemplate.minRange 0.0
weaponTemplate.maxRange 400.0
weaponTemplate.weaponActivate PINone
weaponTemplate.weaponFire PIFire
weaponTemplate.setStrength Infantry 3.0
weaponTemplate.setStrength LightArmour 5.0
weaponTemplate.setStrength HeavyArmour 9.0
weaponTemplate.setStrength NavalArmour 10.0
weaponTemplate.setStrength Submarine 6.0
weaponTemplate.setStrength Air 0.0

rem AIbehaviors.con from game.rfa

rem *** Set number of vehicles and id/name mappings ***
aiSettings.setNVehiclesTypes 20
aiSettings.setVehicle 0 Tank
aiSettings.setVehicle 1 Plane
aiSettings.setVehicle 2 Boat
aiSettings.setVehicle 3 Infantery
aiSettings.setVehicle 4 Fixed
aiSettings.setVehicle 5 Car
aiSettings.setVehicle 6 UnarmedTank
aiSettings.setVehicle 7 LandingCraft
aiSettings.setVehicle 8 Passenger
aiSettings.setVehicle 9 BoatFixed
aiSettings.setVehicle 10 LandingCraftPassenger
aiSettings.setVehicle 11 LandingCraftFixed
aiSettings.setVehicle 12 UnarmedBoat
aiSettings.setVehicle 13 FixedLargeBore
aiSettings.setVehicle 14 ArtilleryDriver
aiSettings.setVehicle 15 UnarmedPlane
aiSettings.setVehicle 16 AmphibiousCar
aiSettings.setVehicle 18 Submarine
aiSettings.setVehicle 19 ArmedBoat

rem *** Submarine Behaviour setup ***
aiSettings.setVehicleBehaviour Submarine Avoid BBAvoid BBPAvoidCollision2d 1 0 UCUnion AvoidInhibit
aiSettings.setVehicleBehaviour Submarine MoveTo BBMoveTo BBPGotoWaypoint2d 4 0 UCUnion SubWeights
aiSettings.setVehicleBehaviour Submarine Idle BBIdle BBPIdle2d 5 0 UCUnion SubWeights
aiSettings.setVehicleBehaviour Submarine Fire BBFireInfantery BBPFireInfantery 4 0 UCFire SubWeights
aiSettings.setVehicleBehaviour Submarine Scout BBScout BBPScout 8 0 UCUnion SubWeights
aiSettings.setVehicleBehaviour Submarine Change BBChangeTeleport BBPChangeTelep ort 6 0 UCUnion ChangeInhibit
aiSettings.setVehicleDefaultBehaviour Submarine Idle
aiSettings.addInterpreterEntry Submarine InfoWrapper
aiSettings.addInterpreterEntry Submarine BoatMoveTo
aiSettings.addInterpreterEntry Submarine BoatMoveToDirection
aiSettings.addInterpreterEntry Submarine BoatMoveToObject
aiSettings.addInterpreterEntry Submarine Trigger
aiSettings.addInterpreterEntry Submarine TriggerContinously
aiSettings.addInterpreterEntry Submarine MouseTurretLookAt
aiSettings.addInterpreterEntry Submarine MouseTurretAimAt
aiSettings.addInterpreterEntry Submarine Sense
aiSettings.addInterpreterEntry Submarine BoatResetControls
aiSettings.activateDefaultInterpreter Submarine BAPSTParallel Full
aiSettings.activateDefaultInterpreter Submarine BAPSTSerial Full
aiSettings.activateDefaultInterpreter Submarine BAPSTIf Full
aiSettings.activateDefaultInterpreter Submarine BAPSTPlanEnd Full
aiSettings.activateDefaultInterpreter Submarine BAPSTWait Full
aiSettings.activateDefaultInterpreter Submarine BAPSTWhile Full
aiSettings.activateDefaultInterpreter Submarine BAPSTWeaponWrapper Full
aiSettings.activateDefaultInterpreter Submarine BAPSTAimingWrapper Full
aiSettings.activateDefaultInterpreter Submarine BAPSTFinishedWrapper Full
aiSettings.activateDefaultInterpreter Submarine BAPSTUpdateVehicle Full
aiSettings.activateDefaultInterpreter Submarine BAPSTChangeWeapon Full
aiSettings.activateDefaultInterpreter Submarine BAPSTICTurnLock Full
aiSettings.activateDefaultInterpreter Submarine BAPSTICChangeVehicle Full
aiSettings.activateDefaultInterpreter Submarine BAPSTICScout Full
aiSettings.activateDefaultInterpreter Submarine BAPSTEvaluate Full
aiSettings.activateDefaultInterpreter Submarine BAPSTNotifyBot Full
aiSettings.activateDefaultInterpreter Submarine BAPSTIdle Full

rem *** PTArmedBoat Behaviour setup ***
aiSettings.setVehicleBehaviour ArmedBoat Avoid BBAvoid BBPAvoidCollision2d 1 0 UCUnion AvoidInhibit
aiSettings.setVehicleBehaviour ArmedBoat MoveTo BBMoveTo BBPGotoWaypoint2d 5 0 UCUnion UnitWeights
aiSettings.setVehicleBehaviour ArmedBoat Idle BBIdle BBPIdle2d 5 0 UCUnion UnitWeights
aiSettings.setVehicleBehaviour ArmedBoat Fire BBFireInfantery BBPFireInfantery 3 0 UCFire UnitWeights
aiSettings.setVehicleBehaviour ArmedBoat Scout BBScout BBPScout 7 0 UCUnion UnitWeights
aiSettings.setVehicleBehaviour ArmedBoat Change BBChangeTeleport BBPChangeTeleport 6 0 UCUnion ChangeInhibit
aiSettings.setVehicleDefaultBehaviour ArmedBoat Idle
aiSettings.addInterpreterEntry ArmedBoat MoveToMediumBoat Medium
aiSettings.addInterpreterEntry ArmedBoat MoveToObjectMediumBoat Medium
aiSettings.addInterpreterEntry ArmedBoat InfoWrapper
aiSettings.addInterpreterEntry ArmedBoat BoatMoveTo
aiSettings.addInterpreterEntry ArmedBoat BoatMoveToDirection
aiSettings.addInterpreterEntry ArmedBoat BoatMoveToObject
aiSettings.addInterpreterEntry ArmedBoat Trigger
aiSettings.addInterpreterEntry ArmedBoat TriggerContinously
aiSettings.addInterpreterEntry ArmedBoat MouseTurretLookAt
aiSettings.addInterpreterEntry ArmedBoat MouseTurretAimAt
aiSettings.addInterpreterEntry ArmedBoat Sense
aiSettings.addInterpreterEntry ArmedBoat BoatResetControls
aiSettings.activateDefaultInterpreter ArmedBoat BAPSTParallel Full
aiSettings.activateDefaultInterpreter ArmedBoat BAPSTSerial Full
aiSettings.activateDefaultInterpreter ArmedBoat BAPSTIf Full
aiSettings.activateDefaultInterpreter ArmedBoat BAPSTPlanEnd Full
aiSettings.activateDefaultInterpreter ArmedBoat BAPSTWait Full
aiSettings.activateDefaultInterpreter ArmedBoat BAPSTWhile Full
rem aiSettings.activateDefaultInterpreter ArmedBoat BAPSTInfoWrapper Full
aiSettings.activateDefaultInterpreter ArmedBoat BAPSTWeaponWrapper Full
aiSettings.activateDefaultInterpreter ArmedBoat BAPSTAimingWrapper Full
aiSettings.activateDefaultInterpreter ArmedBoat BAPSTFinishedWrapper Full
aiSettings.activateDefaultInterpreter ArmedBoat BAPSTUpdateVehicle Full
aiSettings.activateDefaultInterpreter ArmedBoat BAPSTChangeWeapon Full
aiSettings.activateDefaultInterpreter ArmedBoat BAPSTICTurnLock Full
aiSettings.activateDefaultInterpreter ArmedBoat BAPSTICChangeVehicle Full
aiSettings.activateDefaultInterpreter ArmedBoat BAPSTICScout Full
aiSettings.activateDefaultInterpreter ArmedBoat BAPSTEvaluate Full
aiSettings.activateDefaultInterpreter ArmedBoat BAPSTNotifyBot Full
aiSettings.activateDefaultInterpreter ArmedBoat BAPSTIdle Full

 

 

well i guess i could be wrong about the ctd but i do remember having a problem with a vehicle because of no weapons

any way my point i didnt make was why go through the trouble of changing the equiptment type and adding plugins when it works already

there are multiple ways to get stuff to work in battlefield and still have the same outcome

but if you notice in the secret weapons maps,(which the 15 equiptment type is used only) the maps have a call in the ai which calls for unarmedplane

not 15

not air

but unarmedplane

now i dont know why its neccessary to have that there but the landing craft are used the same way

so i figured why take the chance and mess that setup up by changing the type when really the radians is what causes the turning and diving

if you read the mdt it actually tells you what some of those properties are

and the c47 is

rem *** Angle in radians ***
aiTemplatePlugIn.pitchScale 0.0010
aiTemplatePlugIn.rollScale 0.0750
aiTemplatePlugIn.yawScale 0.0750
aiTemplatePlugIn.maxRollAngle 0.80
aiTemplatePlugIn.maxClimbAngle 0.20


and the turn radius which is ultimately the problem

aiTemplatePlugIn.turnRadius 135.0

im sure they did that to give it as much of a sweep across the maps as possible...although thats why they turn into the ground

but if you play with the max roll angle im sure you can correct that

here's a site to convert radians to degrees to better understand what you are doing

http://www.beg.utexas.edu/GIS/tools/deg_rad.htm

one day ill get to that and i will probably fix that problem and i will let you know

 

 

Here are my PAK40 AI improvements:
rem AI\objects.con
rem *** Plugins ***
aiTemplatePlugIn.create Unit Pak40Unit
aiTemplatePlugIn.equipmentType 13
aiTemplatePlugIn.setStrategicStrength 0 3
aiTemplatePlugIn.setStrategicStrength 1 3
aiTemplatePlugIn.setHasExposedSoldier 1
rem aiTemplatePlugIn.setUseNoPathfindingToGetToObject 1

aiTemplatePlugIn.create Armament Pak40Armament

aiTemplatePlugIn.create Physical Pak40Physical
aiTemplatePlugIn.setStrType LightArmour

aiTemplatePlugIn.create ControlInfo Pak40Ctrl
aiTemplatePlugIn.driveTurnControl PIYaw
aiTemplatePlugIn.driveThrottleControl PIThrottle
aiTemplatePlugIn.aimHorizontalControl PIMouseLookX
aiTemplatePlugIn.aimVerticalControl PIMouseLookY
aiTemplatePlugIn.lookHorizontalControl PIMouseLookX
aiTemplatePlugIn.lookVerticalControl PIMouseLookY
aiTemplatePlugIn.throttleSensitivity -1.0
rem aiTemplatePlugIn.pitchSensitivity 0.021817
rem aiTemplatePlugIn.rollSensitivity -0.021817
aiTemplatePlugIn.pitchSensitivity 0.21817
aiTemplatePlugIn.rollSensitivity -0.21817
aiTemplatePlugIn.yawSensitivity -2.5
rem aiTemplatePlugIn.lookVerticalSensitivity 0.021817
rem aiTemplatePlugIn.lookHorizontalSensitivity -0.021817
aiTemplatePlugIn.lookVerticalSensitivity 0.21817
aiTemplatePlugIn.lookHorizontalSensitivity -0.21817
aiTemplatePlugIn.throttleLookAhead 1.0
aiTemplatePlugIn.pitchLookAhead 1.0
aiTemplatePlugIn.rollLookAhead 1.0
aiTemplatePlugIn.yawLookAhead 1.0
aiTemplatePlugIn.lookVerticalLookAhead 1.0
aiTemplatePlugIn.lookHorizontalLookAhead 1.0
aiTemplatePlugIn.throttleScale 1.0
rem *** Angle in radians ***
aiTemplatePlugIn.pitchScale 1.0
aiTemplatePlugIn.rollScale 1.0
aiTemplatePlugIn.yawScale 0.0020
aiTemplatePlugIn.lookVerticalScale 1.0
aiTemplatePlugIn.lookHorizontalScale 1.0
aiTemplatePlugIn.setCameraRelativeMinRotationDeg -26/-20/0
aiTemplatePlugIn.setCameraRelativeMaxRotationDeg 26/12/0

rem *** AITemplate ***
aiTemplate.create Pak40
aiTemplate.addType ITUnit
aiTemplate.addType ITGround
aiTemplate.addType ITFixed
rem aiTemplate.addType ITMobile
rem aiTemplate.addType ITAir
aiTemplate.degeneration 20
aiTemplate.allowedTimeDiff 3
aiTemplate.basicTemp 13
aiTemplate.commonKnowledge 0
aiTemplate.addPlugIn Pak40Unit
aiTemplate.addPlugIn Pak40Physical
aiTemplate.addPlugIn Pak40Armament
aiTemplate.addPlugIn Pak40Ctrl

rem ai\weapons.con
rem *** Add gun ***
weaponTemplate.create Pak40MainGun
weaponTemplate.burst 0
weaponTemplate.indirect 1
weaponTemplate.minRange 5.0
weaponTemplate.maxRange 600.0
weaponTemplate.weaponActivate PINone
weaponTemplate.weaponFire PIFire
weaponTemplate.setStrength Infantery 6.0
weaponTemplate.setStrength LightArmour 8.0
weaponTemplate.setStrength HeavyArmour 11.0
weaponTemplate.setStrength NavalArmour 7.0
weaponTemplate.setStrength Submarine 2.0
weaponTemplate.setStrength Air 0.0

 

 

60 is degrees to convert to radians divide by 180 and times by pi or 22/7

Eg.

60*(22/7)/180 = 1.0472 radians

 

 

>>>its the same as a boat but the boat uses 2d fire...which is no good it needs to fire direct. so i gave it the same as tanks ...fireinfantery

Thanks! I have been trying to get the bots to fire with the subs forever, and I have played around with the AIbehaviors, but never noticed that before. You just solved a big hang up. I had added subs to my Realplayer AI improvement mod from Loktars subs & bombers, but could never get them to fire torps. Now I know how to work it. Thanks again.

By the way Realplayer is an open source project to improve the AI experience of the standard game. I took Psychoslapheads Realplane mod and expanded it out for all vehicles. It increases bot aggression by increasing the weight of the fire behavior. It also reduces plane collisions by enabling the plane avoid behavior and increasing its weight. It also adds vehicle tweaks from realplane, and subs and bombers. Recently I have been tweaking the handweapon AI. The AT and sniper bots will switch to a pistol at short range.

I have also been testing bots using grenades. The problem I found is that bots will only use a grenade if no other weapon is available, and I do not know how to change that. What I did was set the rifle strengths to only fire on infantry, and now some classes will throw grenades on vehicles if no infantry targets are available.

>>>i got bots firing a10 guns and rockets and have even gotten choppers to fire not just the gunners the pilots too but its few and far between as its very difficult to get them to fly them right...im constantly tweaking them

I would love to use your changes in a Realplayer_DC mini-mod


>>> also the pak gun is not new its in road to rome
Well, its a custom object that is not in the standard game's object file. Since its now in a standard map by Dice, that means that it can be used by modders in standard maps and not under the restriction to RTR anymore.

>>>dnamro which sea vehicle are you talking about and how did you set up the objects and weps

I was referring to subs and it looks like you had the answer to the bot sub problem.

 

do you have aimHorizontal(vertical)Control set to PIyaw/pitch? they should steer to aim then. Alternatively you could set the camera rotations in ai/objects.con to 0/0/0

 

 

Looking at Aimeshes, I noticed the following:

Aimeshes are only created for objects where the bots need to travel inside it, like bridges, useable buildings, bunkers, windmills, etc.

So, I am guessing that the debugger will generate pathmaps using the AImeshes if available, but will pathout the object using the standardmesh if not.

Does this make sense? And has anyone tried to create AImeshes for custom objects?

 

Then again, maybe the problem is with the LC pathmaps. I've never heard of a problem with the Rexman tools generating bad landing craft maps, but it sound reasonable. I generated my maps from Rexman's tools but I had to edit the batch files slightly to generate 6 levels instead of 3 since LCs and boats only seems to use 2 - 5 instead of 0 - 2 like land vehicles/infantry, maybe this is the problem some people have been having with the Rexman tools. I was using pathmaps I drew up myself since this was well before the debugger was released. Maybe the debugger makes correct pathmaps.

 

I'm working on a level where axis and allies both have a battleship and destroyer and the bots actually do land and take the island (Piti). Changing the infantry and landing craft pathmaps tends to break it and so does changing the position of the landing zone, so Iím waling on egg shells when I change anything related to pathfinding. I think it has something to do with the smallOnes (waypoints), not totally sure yet.

But what I do know is:

If the landing craft pathmap extends too close to shore, the bots either never leave the landing craft or they go into an infinite loop of:
1) Get out of the landing craft
2) Switch to upgrade vehicle and get back into the landing craft
3) Goto step 1

Silly bots...

The infantry pathmap should extend a little over the length of a landing craft vehicle length into the water. If it goes too far into the water, the bots will get out of the landing craft and go for a nice swim. Once I extended the infantry pathmap into the water all around the island so the bots might find their way to shore (if needed). That was a mistake. I found most of the bots swimming around the island instead of taking bases.

The landing craft and infantry pathmaps don't have to overlap, but in some of the game levels there is a little.

No matter how far the boundary between the landing craft and infantry pathmaps extents into the water, the bots will not try to leave it until they hit land.

If the landing zones extend too far onto land, the bots will not land. They just putter around the island and attack any big ship they see.

If one landing zone doesnít work, none of them do.

--

When I first started this level, all the bots that spawned in the landing craft just sat there. It took me a month to figure it out. The problem was in the LandingCraftInfo.raw (and BoatInfo.raw) file. It has a slightly different encoding than those for land. Itís much more compressed, probably because much less information is required (no cliffs or buildings). So I wrote a tool to create these files with the right encoding (genPathmaps) and posted it in the ĎPost new tools hereí thread. It creates all the pathfinding files needed for a good sea battle.

The image below I made from the both infantry and landing craft pathmaps and smallOnes files from the Omaha Beach level. It's a little busy, but I'll do what I can with it. I flipped the images in the raw files so it looks like it would in actual game play. The 0x0 point is on the bottom left hand side. The blue area is the landing craft pathmap and the brown is the infantry pathmap. There are only a hand full of points where they overlap and a few where they don't even touch.

The shaded grid is very important. In order for the bots to get from one grid square to the next, there has to be a smallOne (red dot) in both grids that are connected (the gray line). Each grid square can have up to 4 (levels) smallOnes.

If you compare this to what you see in the game, you'll notice that the actual shoreline is a bit past the obstacles (which are in the water). That means that the infantry pathmap extends into the water by at least 3 landing craft lengths. Yet the bots continue to pilot the landing craft until they hit the shoreline. That means that once the bots hit a landing zone, they donít seem to care all that much about the pathmaps. Also notice that the landing zone doesnít extent very far onto land, most of it is in the water. It also has the attribute LZZMax because that is the side that touches land.

 

 

the LZ X/Z Min/Max determines an "edge" of the landing zone.

you can see with the AI stats on, an extra line along one edge of a landingzone, which in Omaha is on the beach side of the landing zone (LZZMax).

i guess this lets the bots know which side to get out

If it was set to LZZMin the line would be on the opposite side,
and LZXMin/Max would be on the sides.
So best bet would be to set this to the appropriate side for your level.



btw mutley, the LZ coding works well with helicopters, NecronoM implemented this for Target Practice

 

 

I feel this information is pretty important and should be publicly shared. If you already know it, great, but why didn't you tell us? *grin*

Most of us know by now how to use the debugger to make useable pathmaps. What most people don't know is that your pathmaps will be fundamentally flawed if you launch a modification that you are mapping for and run the ai.createallmaps command while in that modification. Case in point: my latest map has two bridges on it. The pathmap generated while running it as a BG42 mod always created a white line directly through the middle of both bridges, preventing 'bot passage. Not only that, but hand editing did not make the 'bots move any better. Not only THAT, but when I tried make the bridge using terrain (ie, it was no longer a bridge but a strip of land that connected both sides of the river) the pathmap turned out exactly the same.

I then tried doing the pathmaps in vanilla BF1942 after converting the map to be for the regular game, not the mod. And wouldn't you know it, perfect pathmaps on the first attempt.

In conclusion: if you are making a complex map, particularly one with rivers and bridges, for a modification and want good pathmaps, convert the map to vanilla BF first to make your pathmaps. If you have custom objects, place them on the map using the run objects/objects setup as Dice has done in maps like Coral Sea and Liberation of Caen.

 

 

I just hit this wall also. I was pulling my hair out. Good solution as it doesn't matter which mod does the paths..just gotta have the paths.

I use that "strip of land trick" for the bridges also. Works good.

By the way, I do not use the debugger (bf1942_r.exe) instead I add the following to the AIpathfinding.con file.

run StaticObjects.con
ai.createAllMaps


I then start the game in COOP. You will notice it takes a little longer to load but the game will load with stats running..bots standing there. Quit and your pathmaps are in the bf1942 root. Extract and copy them into your map archive or use the "Add File to Archive" feature in BC. Re pack ect and it should work.