SUBSIM: The Web's #1 resource for all submarine & naval simulations since 1997 |
03-24-21, 04:10 PM | #76 |
Village Idiot
|
You know Ships have this.
WNOperationAirContactComm Now before anyone freaks about playing with the AI Files from TDW? This is from the readme released with the Mod. NOTE: this mod can be customized by editing the \data\Scripts\AI\init.AIX. I went to great lengths to make it user customizable and for testing different setups/configurations (testing) Last edited by Jeff-Groves; 03-24-21 at 04:18 PM. |
03-25-21, 04:17 AM | #77 |
Grey Wolf
Join Date: Oct 2010
Location: Poland
Posts: 874
Downloads: 72
Uploads: 3
|
Ok, I looked into it but fail to grasp how I can use this. It seems to be a strategy for warships for maneuvers when air contact is detected - three different maneuver patterns depending on distance to the plane (no threat, threat and critical). Granted I don't understand half these commands but nothing I saw seem to affect firing any cannons.
In other news, I did have a little progress yesterday. Since ship can fire AA, I thought I'd change relevant conditions and commands in Sub-Attack AI file from Sub: (command) to Ship: (command). That got U-boats to fire AA guns at planes, but the fire was very intermittent (couple shots, back to ignoring planes, again couple shots after some time) and accuracy looks like they have gunner's mate first class Philip A. from Spaceballs manning the gun. Edit: in general, something that can be looked into by modders re: sh5 scripting, is that it seems while various AI commands only work when used by "ship" "sub" or "plane", game seems to accept if we put "ship: do thing x" in plane ai file or vice versa. TDW already used this in his plane strategies, now it seems to allow subs to fire guns, perhaps there are more situations where using "someone else's" command can be beneficial
__________________
An elemental spirit summoned up from the Sea of Lament itself and given one purpose, one skill, one desire... to sail! Or, to model hulls and adjust damage zones if no sailing jobs are open. My mods: Little Ships, Air Force Last edited by kapuhy; 03-25-21 at 05:02 AM. |
03-27-21, 10:52 AM | #78 | |
Grey Wolf
Join Date: Oct 2010
Location: Poland
Posts: 874
Downloads: 72
Uploads: 3
|
Quote:
- Other than that, by GetMyWeight which returns own weight in tons - while that doesn't directly differentiate by type, it can be used to sort out light bombers and fighters from heavy bombers for example. |
|
03-27-21, 11:06 AM | #79 |
Village Idiot
|
Possibly IsType?
For example: Ship:IsType(ESCORT) or Ship:IsType(BATTLESHIP) Then see about GetMyWeight? |
08-03-22, 02:19 AM | #80 |
Grey Wolf
Join Date: Oct 2010
Location: Poland
Posts: 874
Downloads: 72
Uploads: 3
|
Returning to meddling with plane AI after a long break. As a little recap, I made a video showing difference between airplane AI as it is in TWoS and what happens if we tell planes to strafe, not bomb, fast moving targets:
In the above, I set 6 planes starting at 6 km distance (Sunderland, B-17, Liberator, Swordfish, Martlet, Catalina) to bomb our boat which is simply sailing in straight line at flank speed. Results: - unmodified AI: only level bombers even drop bombs, and after 3 minutes U-Boat is more or less intact (only light damage from guns). - "strafing" planes: two planes crash into sea, but remaining ones score several hits in 3 minutes sending U-Boat to the bottom. Edit: - Behaviour is only modified for targets moving over 5 kts. For static/slow targets planes use SetCourseBomb approach which is much safer. - I tried to add condition checking plane's own speed to break off the attack if in danger of stalling, but to my suprise GetCurrentSpeed() function returns unit's maximum, not current speed so it proved useless for this. Only thing that somewhat reduces stalling is increasing plane minimum height, but this has to be done on plane-by-plane basis.
__________________
An elemental spirit summoned up from the Sea of Lament itself and given one purpose, one skill, one desire... to sail! Or, to model hulls and adjust damage zones if no sailing jobs are open. My mods: Little Ships, Air Force Last edited by kapuhy; 08-03-22 at 04:35 AM. |
08-03-22, 05:22 PM | #81 |
Navy Seal
Join Date: Jan 2011
Location: CJ8937
Posts: 8,214
Downloads: 793
Uploads: 10
|
Brilliant!
Other than increased stalling chances for strafing planes, have you noticed any other undesired side effect? On a partly unrelated note: as you probably know coastal defenses featured in TWoS are in reality floating gun platforms. This is the only workaround I and Vecko found to land units not being able to shoot their guns. IIRC in stock game coastal batteries can aim and follow targets, but they never fire. Do you think we can fix them by editing their AI routines, the way you did with AI sub's deck guns? Edit: have you tried if the GetCurrentSpeedKnots() function works as supposed? Last edited by gap; 08-04-22 at 04:00 AM. |
08-04-22, 11:11 AM | #82 | |||
Grey Wolf
Join Date: Oct 2010
Location: Poland
Posts: 874
Downloads: 72
Uploads: 3
|
Quote:
Quote:
Quote:
By the way, ship-weapons.aix script uses the same function to ensure an escort is not going too slow before dropping DC's. I bet this is bugged too and related to destroyers blowing themselves occasionally. |
|||
08-04-22, 04:42 PM | #83 |
CTD - it's not just a job
|
What CrewRating do you have the planes or AirBase set to kapuhy? We found in SH4 that they have to be set to Elite to even begin to look like airplanes flying, and even then, they will attempt 90 degree climbs, and even appear to stall-out and fall backwards after dive-bombing. Of course, we don't have scripting in SH4, therefore that CrewRating is very important.
|
08-04-22, 04:54 PM | #84 |
Village Idiot
|
One would need to release the scripts for others to check.
Just saying something means nothing so gives us nothing to work with. I'm also wondering about any other attempts to do such things. I don't recall details of HOW one did thimgs. Last edited by Jeff-Groves; 08-04-22 at 05:02 PM. |
08-05-22, 01:27 PM | #85 |
Village Idiot
|
Just a quick look at the Scripting for AI Units?
I can't find any reason one could not do Scripts for the Land Units. Even scanning the base files in SH5 leads me to believe it can be done. |
08-05-22, 02:18 PM | #86 | ||
Grey Wolf
Join Date: Oct 2010
Location: Poland
Posts: 874
Downloads: 72
Uploads: 3
|
Quote:
Try 1: 1 plane crashed (Liberator), 1 minute to kill U-Boat Try 2: 2 planes ran into each other and fell on U-Boat, killing it Try 3: 1 plane crashed (Liberator), 2 minutes to kill U-Boat So, mostly better in my first test but very inconsistent. I don't know what to make of it. Also, some planes (Liberator for example) crash a lot more than others. Quote:
That said, I'm pretty sure I can post exact changes I made. In Airplane.aix there's a strategy "BombCoursePopUp". I replaced it with this: By the way, I have no idea what does the number in brackets after Strafe stand for. Tried various values here and plane behaviour seemed similar. Then it is certainly worth trying |
||
08-05-22, 02:46 PM | #87 |
Village Idiot
|
His Copyright stuff really means nothing as He broke the License of the Game to start with and I'd doubt he'd even stand a chance inforcing anything.
As to uploading? He went 'POOF' years ago and does not respond to messages so it's fair Game to modify anything. Of course I will state that IF you use his work? Credit it! Been enough of that issue going on. Now. There's a lot of things in the Scripts one needs to understand and look at. One can create different actions that you'll not find in the Scripts. |
08-05-22, 03:01 PM | #88 |
Village Idiot
|
As to Land Units?
I ask what gap and others tried to get them working. I'm not about to start from scratch if other methods were tried. |
08-05-22, 03:54 PM | #89 |
Village Idiot
|
On Plane Strafe?
I'm not finding a definition on that. Any Action needs a defined definition. So one would need to declare the Strafe Action. That was never done in TDW's stuff so guess what? It is a NULL action. Should one write a Strafe Action for Planes? You could control speeds based on different conditions. Last edited by Jeff-Groves; 08-05-22 at 04:07 PM. |
08-06-22, 01:07 PM | #90 | |
Grey Wolf
Join Date: Oct 2010
Location: Poland
Posts: 874
Downloads: 72
Uploads: 3
|
Quote:
|
|
|
|