View Single Post
Old 08-09-22, 02:39 PM   #126
Jeff-Groves
Village Idiot
 
Jeff-Groves's Avatar
 
Join Date: Sep 2014
Posts: 5,321
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