SUBSIM Radio Room Forums

SUBSIM Radio Room Forums (https://www.subsim.com/radioroom/index.php)
-   SH5 Mods Workshop (https://www.subsim.com/radioroom/forumdisplay.php?f=249)
-   -   [REL] Shoot at periscope (https://www.subsim.com/radioroom/showthread.php?t=191772)

Rongel 01-30-12 01:57 PM

Quote:

Originally Posted by sober (Post 1829623)
Rongel What mods are you using ?

Here goes! I can't think any other mods affecting the periscope shooting than IRAI. Maybe TDW's UI and FX mod. But yes, compatability may have something to do with the problems people have reported.

RemoveLogoIntroTheDarkWraith
MightyFine Crew Mod 1.2.1 Stock faces
MCCD_1.04_MFCM_1.2.1_compatible
Speech fixes and additions (german version)
Reduced_crew_abilities
Dynamic Environment SH5 Basemod (realistic version) V2.0
Dynamic Environment SH5 BrighterNights V2.0
Dynamic Environment SH5 Undersea (temperate and polar) V2.0
Dynamic Environment SH5 Sounds V2.0
Dynamic Environment SH5 Atlantic Floor V2.0
sobers best ever fog V4 SH5
Small_trees_SH5_V1
sobers chimney smoke V2
SteelViking's Interior Mod V1.2
Naights Submaine Textures v1.2 (PUV)
NOZAURIO'S SKIN (Standar No Emblem) v-1.0.0
FX_Update_0_0_19_ByTheDarkWraith
Tastatur_1.2_Fi
IRAI_0_0_30_ByTheDarkWraith
TheDarkWraith_DC_Water_Disturbances_v2_0_SH5
NewUIs_TDC_6_9_0_ByTheDarkWraith
NewUIs_TDC_6_9_0_New_radio_messages_German
Trevally Automated Scripts v0.6
Trevally Harbour & Kiel Canal Pilot v2.8
Compatible Conus00's Graphic Mod+SV's work
Window_Lights_Redone_V1
KZS Hull wetness for U-Boats + co tower and deck_revised_by_TheDarkWraith
Stormys DBSM SH5 v1.3 Basemod
Stormys DBSM SH5 v1.3 additional crew sounds beta6
Stormys_DBSM_SH5_v1.3_optional_louder_engine_sound s
OPEN HORIZONS II_full v1.6
Equipment_Upgrades_Fix_v1_4_byTheBeast
DeckGunMod
Enhanced FunelSmoke1.2_by HanSolo78
Grossdeutscher Rundfunk
SH5Lifeboats_by_Rongel_TDW_stoianm_v2_1
Battlestations_soundmod_1.1
Shoot_at_Periscope
Quote:

This is fantastic. shall I change to exactly this:Plane:CanFireCannons() and Ship:ContactPresenceIs(PRESENCE_SENSORS, 15) and Ship:GetContactDepth() >= -15
or are the "and" ment not to be there.Anyone with some screenshots? I can only remember finding weird numbers(when modding for hydrophone)
I don t remember what hexedit I used but the ones I tried seemed to show slightly different things. I managed when someone said I used this hexeditor , it look like this and should be changed to this.:D
Will they hit your sub, or just periscope btw
You can edit the file with just notepad. Be sure to have to ANSI coding option on. And you must keep the "and" there also. I will revise the first post soon and give better instructions. And, yes, they will hit other parts of the sub too when firing the periscope (I rarely get hull damage, same thing as with the depth charges).

Husksubsky 01-31-12 12:57 AM

Thx . :)
hrmm whats ANSI coding?:oops:

dcb 01-31-12 01:10 AM

I am not very skilled at scripting, so I apologize if I'm asking a stupid question, but wouldn't this command:

action
{
Plane:FireCannons();

mean that only planes will fire their cannons?
Don't we also need something like

action
{
Ship:FireCannons();


if we want ships to shoot at scope?

pedrobas 01-31-12 06:35 PM

Sorry Rongel, what mod is Tastatur_1.2_Fi ?, never heard of it. :cry:

Rongel 02-01-12 06:00 AM

Quote:

Originally Posted by Husksubsky (Post 1830489)
Thx . :)
hrmm whats ANSI coding?:oops:

I don't know really! It's just a option when saving with notepad, when you save with "save as" command, in the bottom of the page reads "coding" (or something like it) and you can select ANSI or unicode, and so on. I had the ANSI option as a default, maybe other options cause problems...

Quote:

I am not very skilled at scripting, so I apologize if I'm asking a stupid question, but wouldn't this command:

action
{
Plane:FireCannons();

mean that only planes will fire their cannons?
Don't we also need something like

action
{
Ship:FireCannons();


if we want ships to shoot at scope?
Airplanes have their own .aix file which tells how they behave, and when shoot cannons. Ship-weapons.aix tells how ship use their weapons. The default Ship:FireCannons(); command is not workin properly. It only makes ships fire cannons at you if you are surfaced. You can have the conning tower already surfaced, but ships wont fire it if you are still technically underwater.

Planes can attack you when you are underwater so switching the Ship:FireCannons(); to plane:FireCannons(); is just a workaround to use planes hardcoded actions. It's not a perfect solution but it makes armed ships much more dangerous (like they should be).

Quote:

Sorry Rongel, what mod is Tastatur_1.2_Fi ?, never heard of it. :cry:
It's just the keyboard bindings I use, I got it from ustahl :D

There is a now screenshot in the first page so you can double check that you have the right script-format in your file. And if you have still problems, please tell and I'll try to help!

pedrobas 02-01-12 10:56 AM

Quote:

Originally Posted by Rongel (Post 1831021)
It's just the keyboard bindings I use, I got it from ustahl :D

There is a now screenshot in the first page so you can double check that you have the right script-format in your file. And if you have still problems, please tell and I'll try to help!

Thanks for answer.
I´m using your code since the first day you posted here, not via jgsme, just directly (edited with notepad) and didn´t notice any CTD related with this. I´m happy with it. :yeah:

Husksubsky 02-01-12 01:42 PM

Much better instructions now, thx Rongel. I misunderstood first time and thought we were gonna mess with the exe file:D

dcb 02-01-12 02:24 PM

Thanks for the answer, Rongel:salute:

Husksubsky 02-01-12 07:50 PM

your picture say GetContactDepth() >= -13 and you describe GetContactDepth() >= -15..just a little adjust for liking? :)
Edit:
quote:So the only bad thing about this is that when the escorts lose you, they will bombard the last location 4-8 minutes causing possibly havoc. When they know you are deeper, they'll stop the firing.

(Had great fun with this.One DD bombarded the other :D)


Anyways I found that with GetContactDepth() >= -13 They never saw my scope until I was 13 m depth or less. short test with eange aob practice and fx update test They stopped when I took down scope but when I wenr deeper they just shot the "old "spot until my depth was above 13 m again regardless of my unmodded attackscope towering couple of meters above the surface. I put that to -17 the merchants never shot now but the dds started whit me just below 15 m. They never hit though . Not sure what to make of this.

SO now Im curious what this value does: ContactPresenceIs(PRESENCE_SENSORS, 15)

Edit: with -17 they didn t shoot at all. I really just try fail here

Husksubsky 02-01-12 11:20 PM

Now I tested with your test mission and it seem to work as purpoused. I put value to -15 again (GetContactDepth() >= -13) Felt weird that they could spot me with peri barly touching surface like they did when I put it to -17.
But what do they see actually? just periscope, or do they spot me like if I was surfaced when above this value?:hmmm: Can I cruise around at 15.5 meters and all is safe since I m to deep for shooting and too shallow for depthcharge? Anyways its a big step in the right directon ;) thx

Rongel 02-02-12 03:33 AM

Quote:

Originally Posted by Husksubsky (Post 1831477)
Now I tested with your test mission and it seem to work as purpoused. I put value to -15 again (GetContactDepth() >= -13) Felt weird that they could spot me with peri barly touching surface like they did when I put it to -17.
But what do they see actually? just periscope, or do they spot me like if I was surfaced when above this value?:hmmm: Can I cruise around at 15.5 meters and all is safe since I m to deep for shooting and too shallow for depthcharge? Anyways its a big step in the right directon ;) thx

Thanks for the good report! Glad that you got it working!

Quote:

your picture say GetContactDepth() >= -13 and you describe GetContactDepth() >= -15..just a little adjust for liking? :)
Exactly. It's a small mistake, I've been testing what is the best depth value, right now using 15 meters.

Quote:

SO now Im curious what this value does: ContactPresenceIs(PRESENCE_SENSORS, 15)
This is how I think it goes: If a enemy ship has located you with sensors (it can be any sensor: visual, hydro, sonar, radar) it can open fire if the other condition (GetContactDepth() >= -13) is true also. So it doesn't even need to see you, if dd's sensors show that you are nearby in periscope depth, it will try to shoot you down. There is also a script called ContactPresenceIs(PRESENCE_LOOKOUT, 0) which makes the ships attack you only when the see you visually, but I thought the current is more interesting and challenging. Not 100 % sure which is more historically accurate.

What makes things complicated is that the escorts react always in a different way. Some tests go just beutifully, like you would except, but sometimes escorts do something stupid, like shoot at themselves. Can't figure out why the escorts sometimes continue attacking you even if the script conditions are false. I guess they just want to sink you that badly!

Quote:

Can I cruise around at 15.5 meters and all is safe since I m to deep for shooting and too shallow for depthcharge?
I think IRAI makes the escorts depthcharge you even if in periscope depth. I'm pretty sure I have witnessed this in my tests.

By the way, I did a long campaign play yesterday with this and had fun with Norwegian destroyer that I mistakenly thought as a neutral unit. I just cruised in periscope depth but then cannon shells started to hit the water breaking the radio and radar. I dove immediately and it stopped the shooting and started to drop depthcharges. It was like an angry bee!

Vanilla 02-02-12 05:25 AM

Great mod, Rongel!

As of the realism of firing at a submerged submarine, to my knowledge most of the secondary naval guns had special anti-submarine shells, AFAIK they were diving shells - special shells with blunt nose so you shot it into the water and it did not bounce of the water but dived and continued for some distance submerged hopefuly meeting the submarine. Moreover you read in reports of real ASW actions that planes often strafed the spot where the submarine had submerged with their guns, I recon that it is modelled in the AI logic by developers, that is why, I recon, the ships continue to shoot at the last known spot for some time with your mod as well since they use plane's script, I recon that is realistic as well - why would a ship not want to shell the last known spot knowing that the sub is relatively slow to escape? Imagining myself as a DD captain I think I would still fire guns at last know spot for a couple of minutes even if I did not see the periscope any longer and even if I did not have ASW shells, at least there is some hope that a shell would strike something fragile or the sub would be damaged by the HE-shell explosion, even if the shells did not strike they at least would force the sub to be frightened and stay submerged so negating a possibility for the sub to attack me or the convoy - you see enemy, you shoot. :) The only unrealistic thing I see is the fact that they continue for far too long when you submerge while it should be no more than a minute or two in reality.

If only we could get of the friendly-fire issue... but it is not this mod's issue since if planes do not check for friendly-fire condition they can strafe a friendly DD on a DC run. That means that it is a stock AI error.

Husksubsky 02-02-12 02:02 PM

Good points Vanilla.
Thx for answer Rongel, I will keep testing but it s hard to keep track of whats happening sometimes.

I m still curious wether that getcontactdepth means your just as visible to the game as if you were surfaced when above 15 m. doesn t look that way since they stop shooting with peri down but anyways I WANT them to shoot if they spot me but I DONT want them to spot me like if I m surfaced when I sneak silent under the surface :).

TheDarkWraith 02-02-12 02:23 PM

Quote:

Originally Posted by Husksubsky (Post 1831789)
Good points Vanilla.
Thx for answer Rongel, I will keep testing but it s hard to keep track of whats happening sometimes.

I m still curious wether that getcontactdepth means your just as visible to the game as if you were surfaced when above 15 m. doesn t look that way since they stop shooting with peri down but anyways I WANT them to shoot if they spot me but I DONT want them to spot me like if I m surfaced when I sneak silent under the surface :).

GetContactDepth only returns the depth of the contact and nothing more.

Rongel 02-02-12 04:26 PM

Thanks for the info Vanilla! :DL

Glad to hear that they actually fired cannons at submerged subs! Otherwise this would have been somewhat pointless in the first place!

Quote:

I m still curious wether that getcontactdepth means your just as visible to the game as if you were surfaced when above 15 m. doesn t look that way since they stop shooting with peri down but anyways I WANT them to shoot if they spot me but I DONT want them to spot me like if I m surfaced when I sneak silent under the surface :).
Quote:

GetContactDepth only returns the depth of the contact and nothing more.
Yep, it doesn't mean that they can automaticly spot you if you are above 15 meters. If they have spotted you with sensors and you are above 15 meters, only then they can fire at you. So you can still sneak silently in periscope depth and they won't spot you.

Been messing with the scripts like crazy (yes, I'm a bit obsessed by this...) but no significant progress. However, I noticed one thing! When you are in periscope depth, and the periscope is up, and they have spotted you and started firing, do not lower the scope, but just dive to safety. Now when you pass the 15 meter line, enemies will see it and know that you are too deep to attack with cannons. This way even DD's will instantly stop firing you.

I'll try to explain it with example... If you just lower the scope when you are attacked with cannons in periscope depth, escorts lose your contact and continue firing the area several minutes. They think that you still might be there even if you are 100 meters below. But if you dive with periscope up (with -15 depth value it has to be all way up) they see you as you pass the magical line and understand to stop. Ofcourse this is not a perfect way either, you are basically helping the escorts by telling them your depth!

So close....

pedrobas 02-02-12 05:59 PM

:yeah:

Husksubsky 02-02-12 10:59 PM

I m a bit obsessed too. Thx a lot TDW for clearing that out. (Not that you didn t know Rongel) Finally even I understand how this works a bit more...I think..
I really hated this issue with SH4 and was sad to see it still existed in SH5. They still cant hurt you much at 15 + so I miss those guns Vanilla talked about. Ive heard that depthcharges usully had a preset at 30 60 or 90 meters can that be true? anyways they should have guns to take you out with at shallow depth. Or run fast over you so they would be at somewhat safe distance when the depthcharges explode..(if they could explode above 30 m)anyways I cant think that a sub in reallife would survive long in PD with destroyers present.were supposed to dive away arent we?

Before I play more with the numbers. out of what you say I conclude that
ContactPresenceIs(PRESENCE_SENSORS, 15) . tells the guns to fire if GetContactDepth tells you are above 15.

I stick to visual spot for now.
If they spot my scope when I m at 16 they won t open fire. why not put them both to 17? I can t think of any downsides to it except they started to fire at me even before my scope was above the surface in your testmod.
That means I was spotted but can not tell now wich sensor did it. When I scout I try to keep my scope just above the surface and for short periods. I m still a bit scared that these are the things we mess with to some degree. that it s not how high your scope actually is but how deep you are with scope fully raised. Or have the sensors their own scripts and these shipweapons scripts that you change only come in use if you ALREADY have been spotted.

Sorry for all these qustions but I m very curios

Vanilla 02-03-12 06:14 AM

Quote:

Originally Posted by Husksubsky (Post 1832072)
...
Ive heard that depthcharges usully had a preset at 30 60 or 90 meters can that be true? anyways they should have guns to take you out with at shallow depth. Or run fast over you so they would be at somewhat safe distance when the depthcharges explode..(if they could explode above 30 m)anyways I cant think that a sub in reallife would survive long in PD with destroyers present.were supposed to dive away arent we?
...

Even with a DC set at 30m it can still heavily damage the sub, at shallow depths the explosion expands much further, since the pressure is way lower then down below, and I have read somewhere that the most deadly explosions were the ones just below the sub, don't exactly remember why, though.
There is a nice example of a PD sinking with DCs here: http://www.uboatarchive.net/U-432INT.htm see chapter IV there, note that the sub was at 20m and DCs were set at 34m. So you are absolutely right to say that staying at PD while detected is suicidal. I think a destroyer would use everything available: guns, ramming, DCs, hedgehog and what not (throwing Bertrand overboard? Hygiene tanks flushing?) seeing a sub at shallow depth and with up-scope. Very deadly for the sub unless it timely manages to escape to depth. :arrgh!:

Rongel 02-03-12 07:00 AM

Quote:

Originally Posted by Husksubsky (Post 1832072)

Before I play more with the numbers. out of what you say I conclude that
ContactPresenceIs(PRESENCE_SENSORS, 15) . tells the guns to fire if GetContactDepth tells you are above 15.

The "15" in ContactPresenceIs(PRESENCE_SENSORS, 15) is just a default value to make the condition true (it's defined in the ship.aix file). You could probably use "1" as well.

Good way to test the ships behaviour is to have the map contacts on and have the visual sensor data activated in nav map settings. That way you can see if you are in enemy's visual area, passive sonar area, or active sonar area (pinging).

In my tests I have noticed that you won't get any damage from cannons if you are deeper than 20 meters or so. It's a issue with the cannon shell damage and would need modding in that area. Also when you are underwater you rarely get any actual hull damage from guns (and DC's). The water is lowering the damage radically (too much in my opinion!).

So even if get the ships to fire at you when you are 30 meters below for example, the shells couldn't damage you.

But I would be happy if the enemies would fire you when you are in periscope depth and acted logically enough. I have witnessed too many times situations where I'm circling in the middle of the unescorted convoy and have periscope up, and even the armed merchants just zigzag slowly around me, sailors pointing at my direction but too lazy to open fire. Right now it's already working with the merchants, they will shoot you and force you down.

Husksubsky 02-03-12 11:08 PM

thx for the link Vanilla.
Hygiene tanks flushing lool
Thx for additional info ROngel
I will do as you say in my tests. weird I didn t think about that. Still I think..why not put getcontactdepth to -20? any reason to have them stop firing?


All times are GMT -5. The time now is 07:33 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright © 1995- 2025 Subsim®
"Subsim" is a registered trademark, all rights reserved.