SUBSIM Radio Room Forums



SUBSIM: The Web's #1 resource for all submarine & naval simulations since 1997

Go Back   SUBSIM Radio Room Forums > Silent Hunter 3 - 4 - 5 > SH5 Mods Workshop
Forget password? Reset here

Reply
 
Thread Tools Display Modes
Old 08-09-22, 02:23 PM   #121
gap
Navy Seal
 
Join Date: Jan 2011
Location: CJ8937
Posts: 8,214
Downloads: 793
Uploads: 10
Default

Quote:
Originally Posted by Jeff-Groves View Post
Maybe the torpedos on suface Ships are looking for the
wpn_SubTorpedoSys Controller?
The AI Subs have that.
Do you mean that if we added the wpn_SubTorpedoSys controller to surface units and if we updated ship's .aix file, we could make ships to launch topedoes without using the dummy guns workaround?
__________________
_____________________
|May the Force be with you!|
...\/
gap is offline   Reply With Quote
Old 08-09-22, 02:27 PM   #122
Jeff-Groves
Village Idiot
 
Jeff-Groves's Avatar
 
Join Date: Sep 2014
Posts: 5,319
Downloads: 130
Uploads: 0


Default

# void ShipWaitAction(fMinutes) -- action -- ship waits for given time [minutes]
TurnToHeading(newHeading, fThrottle) -- action -- turns ship to a new heading given by "newHeading" [deg] using given throttle (0..1];
# can be used with getbearing/heading functions;
__________________
I don't do Stupid. So don't ask.
Jeff-Groves is offline   Reply With Quote
Old 08-09-22, 02:31 PM   #123
gap
Navy Seal
 
Join Date: Jan 2011
Location: CJ8937
Posts: 8,214
Downloads: 793
Uploads: 10
Default

Quote:
Originally Posted by Jeff-Groves View Post
# void ShipWaitAction(fMinutes) -- action -- ship waits for given time [minutes]
TurnToHeading(newHeading, fThrottle) -- action -- turns ship to a new heading given by "newHeading" [deg] using given throttle (0..1];
# can be used with getbearing/heading functions;


what about Plane:Strafe, and btw where do you get that information from?
__________________
_____________________
|May the Force be with you!|
...\/
gap is offline   Reply With Quote
Old 08-09-22, 02:32 PM   #124
Jeff-Groves
Village Idiot
 
Jeff-Groves's Avatar
 
Join Date: Sep 2014
Posts: 5,319
Downloads: 130
Uploads: 0


Default

It's all listed in the Stock Ship.aix file

But things like Strafe and Flock? No definitions I have found.
__________________
I don't do Stupid. So don't ask.
Jeff-Groves is offline   Reply With Quote
Old 08-09-22, 02:37 PM   #125
gap
Navy Seal
 
Join Date: Jan 2011
Location: CJ8937
Posts: 8,214
Downloads: 793
Uploads: 10
Default

Quote:
Originally Posted by Jeff-Groves View Post
It's all listed in the Stock Ship.aix file
Okay, I thought you had performed one of your wizard tricks

Unfortunately I have not the game installed and I can't check that file. Could you please copy/paste those command syntax instructions for me?
__________________
_____________________
|May the Force be with you!|
...\/
gap is offline   Reply With Quote
Old 08-09-22, 02:39 PM   #126
Jeff-Groves
Village Idiot
 
Jeff-Groves's Avatar
 
Join Date: Sep 2014
Posts: 5,319
Downloads: 130
Uploads: 0


Default



Give me a minute.

OK. Here it all is,



################################################## #################################################
#
# Ship main:
#
################################################## #####################
################# Tactics methods #####################
################################################## #####################

# void AddRole(RoleID, MinShips, MaxShips)
#
# Adds a role with the given RoleID to the current tactic
#
# MinShips: minimum number of ships that need to be assigned the role
# MaxShips: maximum number of ships that need to be assigned the role

# void AssignRole(RoleID, ShipType, ShipMinSpeed, Option)
#
# Tries to assigns given role to ships of given type which can achieve speeds greater than ShipMinSpeed;
# ships are selected in the order given by Option.
# (ship count is bounded by AddRole params; it tries to add the maximum number of ships given in AddRole)
# If there aren't enough ships in this group, it borrows ships from roles with redundant ships. If there still aren't
# enough ships, the current tactic ends
#
# Option can have one of the values
# ASSIGN_CLOSEST_TO_CONTACT: assigns ships in increasing
# order of distance to contact
# ASSIGN_ANY: assigns ships in no particular order

# int CanContinueCurrentTactic()
#
# Verifies if there are enough ships left in each role for the current tactic;
# returns true if all roles in current tactic have enough ships;
# should be called by the commander of the group

# void EndCurrentTactic()
#
# Terminates current operation (tactic) for all involved ships

# int GetCurrentTacticID()
#
# Returns the current tactic(operation) ID

# int GetCurrentTacticMinShips()
#
# Retrieves the minimum number of ships required by the current tactic

# int GetRole()
#
# Retrieves the role of the current ship.

# bool IsCommander()
#
# True if the current ship is the commander of a group (or is not part of a group)

# int IsRoleInCurrentTactic(RoleID)
#
# Determines if the role given by RoleID is a role of the current tactic.


# void SetLineFormation(RoleID, MaxSlotCount, SpanDist, Orientation) // MaxSlotsCount = 0 => no limit
#
# Sets formation for RoleID as a line consisting of a maximum of MaxSlotCount slots
# that can be occupied by ships in that role, spanning over a distance of Dist meters, and
# the orientation given by Orientation.
#
# RoleID: role for which the formation is configured
# MaxSlotCount: maximum number of ships that can be part of the formation
# (if 0, there can be any number of ships in the formation)
# SpanDist: spanning distance of the formation (total length of the line of ships)
#
# Orientation: can have one of these values
# LINE_ORIENTATION_ACROSS: ships in formation will position themselfes
# perpendicular to the formation's heading
# LINE_ORIENTATION_ALONG: ships in formation will position themselfes
# along the formation's heading (parallel to the heading)

# void SetTactic(TacticID, MinShips)
#
# Sets a tactic (represented by TacticID) as the current tactic followed by this group
# MinShips: minimum number of ships requiered by the tactic; if there aren't at least MinShips ships in the group,
# the tactic is not started

# void WaitForFormation()
#
# Makes current ship wait for its formation to reach destination

################################################## #################
####################### Utility methods ########################
################################################## #################

# void AvoidTorpedoes() Ship tries to avoid torpedoes
# bool CanFireCannons() True if the ship can fire its cannons
# bool CanFireDCRacks() True if DCs can be thrown from DC Racks
# bool CanFireDCThrowers() True if DCs can be thrown from DC Throwers
# bool CanFireHHogs() True if the ship can fire HHogs
# bool CanFireStarShells() True if the ship can fire star shells
# bool CanFollowWaypoint() True if this ship may follow waypoints
# bool ContactDetected() True if a contact has been detected
# bool ContactIs(Type) Returns 1 if contact is the specified type.
# bool ContactIsInsideGroupArea() True if the contact is positioned somewhere between or below merchants in the group
# bool ContactPresenceIs(PresenceType, bOldPresence)
# Returns true if contact has presence of PresenceType.
# If bOldPresence is 1, it will return the old contact presence, else if it is 0, it will return the current contact presence.
# PresenceType can be:
# PRESENCE_LOOKOUT = 0
# PRESENCE_RADAR = 1
# PRESENCE_HYDROPHONE = 2
# PRESENCE_SONAR = 3
# PRESENCE_SENSORS = 15
# PRESENCE_LOOSING = 16
# PRESENCE_NEW = 32
# PRESENCE_PROCESSED = 64
# void FireCannons() Fires cannons
# void FireDCRacks() Fires DC Racks
# void FireDCThrowers() Fires DC Throwers
# void FireHHogs() Fires HHogs
# void FireStarShells() Fires star shells
# void FollowWaypoints(fPatrolRate) The ship follows given waypoints; fPatrolRate dictates how often
# the ship searches around the given waypoint path for threats
# usually, fPatrolRate = SHIP_PATROL_RATE (used in a rate event happen method)
# float GetContactBearing() 0-360 clockwise, 0 = north
# float GetContactDepth() Retrieves contact depth [m]
# float GetContactLostTime() Returns the lost time of our contact. Recomended to use it with ContactPresenceIs(PRESENCE_LOOSING).
# float GetContactRelDist() Distance from ship to contact [m]
# float GetContactSpeed() Returns contact speed [kts]
# int GetCrewRating() Returns crew rating for current ship
# returned values may be:
# CREW_POOR
# CREW_NOVICE
# CREW_COMPETENT
# CREW_VETERAN
# CREW_ELITE
# float GetCurrentHeading() 0-360 clockwise, 0 = north
# float GetCurrentFormationHeading() 0-360 clockwise, 0 = north
# float GetCurrentSpeed() [m/s]
# float GetDamage() Returns the amount of damage inflicted to the ship as a float in [0.0, 1.0]
# 1.0 corresponding to the maximum amount of damage a ship can take
# float GetFormationContactBearing() Retrieves contact bearing relative to the center of the formation
# this ship is part of
# float GetMyWeight() Retrieves ship weight in tons
# int GetShipCountInGroup(ShipType) Returns the number of ships with given type in this ship's group
# int GetShipsDestroyedRecentlyInGroup() Returns the number of ships destroyed in this ship's group since last call or since tactic creation
# if this is the first call of this method

# void Goto(fThrottleRatio, bZigZagOn) Goes forward with given throttleRatio (optionally zigzagging)
# void GotoAction(bZigZag, bUseBreaks, fEpsilon) -- action -- goes forward(optionally zigzagging and/or breaks to
# Achieve desired speed and arrival time) to current destination
# fEpsilon is the acceptable error to destination ( in meters )
# bool HasContacts() True if the ship has enemy contacts
# bool IsDocked() True if the ship is docked
# bool IsNeutral() True if the ship is neutral
# bool IsType(ShipType) True if current ship is of given type
# float Random(a, b) A random real number between a and b
# void SetGotoForwardDist(fDist) Sets destination used by GotoAction at fDist meters in front of the ship; (works with formations)
# void SetGotoDestRelToContact(fDist) Sets destination used by GotoAction; it is relative to main contact (works with formations)
# void SetGotoDestRelToContactKeepFormationOrientation(fD ist) Sets destination at fDist meters from the line that passes through the
# contact's position and perpendicular to current ship/formation heading
# void SetGotoDestRelToGroupCenter(fDist) Sets destination at fDist meters from the center of merchant group center(if no merchants in group,
# destination is set relative to the group commander)
# void SetGotoDestRelToGroupCenterAlongGroupHeading(fDist ) Sets destination at fDist meters from the center of merchant group center(if there
# are no merchants in group, destination is set relative to the group commander)
# void SetRamDestination() Sets destination at contact position for ramming
# void SetSensorFactor(sensorType, factor) Sets a modifier for given sensor type (factor in (0, 1]
# sensorType can have one of the following values:
# SENSOR_LOOKOUT
# SENSOR_RADAR
# SENSOR_HYDROPHONE
# SENSOR_SONAR
# void SetThrottleRatio(fThRatio) Value in [-1, 1]
# void SetThrottle(fThrottle) Value in [-1, 1]

# void ShipWaitAction(fMinutes) -- action -- ship waits for given time [minutes]
# void Spiral(fThrottle, maxSpiralTime, float fStartRudder, float fStopRudder) -- action --
# Spirals around current position with given throttle, for at most maxSprialTime seconds.
# It will interpolate between StartRudder and StopRudder in maxSpiralTime time.
# void StartFiringDCs() Starts firing DCs regardles of distance to contact or contact presence
# void StopFiringDCs() Stops firing DCs unless ships are near contact
# void TimeEventHappen(Minutes) Used to trigger events at given interval of time
# bool TorpedoDetected() True if a torpedo has been detected nearby
# void TurnToHeading(newHeading, fThrottle) -- action -- turns ship to a new heading given by "newHeading" [deg] using given throttle (0..1];
# can be used with getbearing/heading functions;
# void TurnFormationToHeading(newHeading, fThrottle) -- action -- turns the whole formation to a new heading given by "newHeading" [deg] using given throttle (0..1];
# can be used with getbearing/heading functions;
__________________
I don't do Stupid. So don't ask.
Jeff-Groves is offline   Reply With Quote
Old 08-09-22, 02:43 PM   #127
kapuhy
Grey Wolf
 
Join Date: Oct 2010
Location: Poland
Posts: 873
Downloads: 72
Uploads: 3
Default

Quote:
Originally Posted by Jeff-Groves View Post
Maybe the torpedos on suface Ships are looking for the
wpn_SubTorpedoSys Controller?
The AI Subs have that.
If they were, they would have found one on my test ship

Quote:
Originally Posted by gap View Post
No, Ship:Random is one of those commands whose arguments are pretty obvious. I mean the parameter of commands like Ship:ShipWaitAction, or the second parameter of Ship:TurnToHeading. They seem to always be in the range 0-1

Else, Plane:Strafe is another of those commands that accept a numeric parameter, but all the instances I found of it go from -20 to 100. Could that be an angle relative to current aircraft heading?
Some of these commands are luckily explained in comments to Ship.aix file. For example, for ShipWaitAction:

# void ShipWaitAction(fMinutes) -- action -- ship waits for given time [minutes]

Unfortunately there are a lot of commands that are not explained anywhere, Strafe being one of them (that's why I asked for meaning of the same numbers earlier in this thread). For those commands I'm afraid we can only find what parameters mean by testing different values and noting what happens.

Edit: ninja'ed
Attached Files
File Type: txt Ship.aix.txt (10.3 KB, 1 views)
kapuhy is offline   Reply With Quote
Old 08-09-22, 02:52 PM   #128
Jeff-Groves
Village Idiot
 
Jeff-Groves's Avatar
 
Join Date: Sep 2014
Posts: 5,319
Downloads: 130
Uploads: 0


Default

There are other valid commands NOT listed.
I'm working on a complete listing.
Bad part is there are no details on them.
Now the Dive command is pretty easy to figure out from the Sub files.

I'm also pretty sure CostalDefense will not work as a seperate aix file for a couple reasons.
Doing more digging? Only 3 appear to be stated. Ship, Sub, Plane.
I've also looked at the Land Units in TWoS.
I'll not comment on those at this time. It would end up being like this.
__________________
I don't do Stupid. So don't ask.
Jeff-Groves is offline   Reply With Quote
Old 08-09-22, 03:01 PM   #129
kapuhy
Grey Wolf
 
Join Date: Oct 2010
Location: Poland
Posts: 873
Downloads: 72
Uploads: 3
Default

Quote:
Originally Posted by Jeff-Groves View Post
There are other valid commands NOT listed.
I'm working on a complete listing.
Bad part is there are no details on them.
Now the Dive command is pretty easy to figure out from the Sub files.
To think that somewhere in basement of Ubisoft Romania offices, there probably is a forgotten backup drive with a copy of developer notes explaining all of it...
kapuhy is offline   Reply With Quote
Old 08-09-22, 03:04 PM   #130
Jeff-Groves
Village Idiot
 
Jeff-Groves's Avatar
 
Join Date: Sep 2014
Posts: 5,319
Downloads: 130
Uploads: 0


Default

I'd be surprised if ANYONE knows the whole thing!
There's stuff from SH3, And SH4 still in the files!
__________________
I don't do Stupid. So don't ask.
Jeff-Groves is offline   Reply With Quote
Old 08-09-22, 03:29 PM   #131
gap
Navy Seal
 
Join Date: Jan 2011
Location: CJ8937
Posts: 8,214
Downloads: 793
Uploads: 10
Default

Thank you both, kapuhy and Jeff, for your patient replies


Quote:
Originally Posted by Jeff-Groves View Post
I'm also pretty sure CostalDefense will not work as a seperate aix file for a couple reasons.
Doing more digging? Only 3 appear to be stated. Ship, Sub, Plane.
That sound to me like a "no hope"

Quote:
Originally Posted by Jeff-Groves View Post
I've also looked at the Land Units in TWoS.
I'll not comment on those at this time. It would end up being like this.


There is no risk of that happening, you are nowhere near the overdone politeness of the average British man lol

TWoS 'land units' are only a workaround. Under many respects they are disappointing, probably they can be improved, but until someone pops up with anything better, they are the only working coastal defenses in SH5

Quote:
Originally Posted by kapuhy View Post
If they were, they would have found one on my test ship
Not if you didn't update Ship.aix to use the torpedo controller, but even so I doubt that it would have worked. No doubt, some ship commands work on other unit types, but there is no evidence of the opposite being true.
__________________
_____________________
|May the Force be with you!|
...\/
gap is offline   Reply With Quote
Old 08-09-22, 03:41 PM   #132
Jeff-Groves
Village Idiot
 
Jeff-Groves's Avatar
 
Join Date: Sep 2014
Posts: 5,319
Downloads: 130
Uploads: 0


Default

You can't just 'Throw' a controller in without doing other work.
Not see your test ship with that controller I can't say 'It won't work'.
You have to look at a lot of things that may have an effect.
Even when you think they shouldn't matter? Many times they do!
__________________
I don't do Stupid. So don't ask.
Jeff-Groves is offline   Reply With Quote
Old 08-09-22, 03:48 PM   #133
kapuhy
Grey Wolf
 
Join Date: Oct 2010
Location: Poland
Posts: 873
Downloads: 72
Uploads: 3
Default

Quote:
Originally Posted by gap View Post
Not if you didn't update Ship.aix to use the torpedo controller, but even so I doubt that it would have worked. No doubt, some ship commands work on other unit types, but there is no evidence of the opposite being true.
I did. Or more specifically I updated ship-weapons.aix with a torpedo strategy.

Quote:
Originally Posted by Jeff-Groves View Post
You can't just 'Throw' a controller in without doing other work.
Not see your test ship with that controller I can't say 'It won't work'.
You have to look at a lot of things that may have an effect.
Even when you think they shouldn't matter? Many times they do!
I'm not saying it can't work, merely that I tried these specific things mentioned, to no effect. I might have done it wrong or forgotten to add something crucial, so don't take it as me discouraging others.

I will dig up my test mod to upload here so that everyone can take a look and hopefully find out any mistakes/omissions.
kapuhy is offline   Reply With Quote
Old 08-09-22, 03:50 PM   #134
Jeff-Groves
Village Idiot
 
Jeff-Groves's Avatar
 
Join Date: Sep 2014
Posts: 5,319
Downloads: 130
Uploads: 0


Default

__________________
I don't do Stupid. So don't ask.
Jeff-Groves is offline   Reply With Quote
Old 08-09-22, 07:05 PM   #135
gap
Navy Seal
 
Join Date: Jan 2011
Location: CJ8937
Posts: 8,214
Downloads: 793
Uploads: 10
Default

Quote:
Originally Posted by kapuhy View Post
I did. Or more specifically I updated ship-weapons.aix with a torpedo strategy.
Yes that one, as I said before I have not the game files close by hand

Quote:
Originally Posted by kapuhy View Post
I'm not saying it can't work...
I think the chances of it working are very low, but you never know until you try.
Let's see if Jeff can demonstrate that on this specific subject I am too pessimistic

__________________
_____________________
|May the Force be with you!|
...\/
gap is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 03:43 AM.


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