• New Horizons on Maelstrom
    Maelstrom New Horizons


    Visit our website www.piratehorizons.com to quickly find download links for the newest versions of our New Horizons mods Beyond New Horizons and Maelstrom New Horizons!

Need Help Near enemy ship

Myth

Freebooter
Good evening! Is there a function in the game code that will return the identifier of the closest hostile ship to my character?
 
There is in PotC; have a look in the mod Screwface functions file.
You may have to loop through all ships in the scene, check their distance and relation, then return the one you're looking for.
 
Good evening! Is there a function in the game code that will return the identifier of the closest hostile ship to my character?

There is nothing in the game currently, to do this.

You may have to loop through all ships in the scene, check their distance and relation, then return the one you're looking for.

That is slow, and turns out repetitive/duplicate code to what the engine is already doing.

The engine already iterates the ships and finds the closest enemy and stores the distance in rCharacter.SeaAI.Update.Situation.MinEnemyDistance. Since it already does this, I decided to also add the character index as: rCharacter.SeaAI.Update.Situation.MinEnemyIndex.

Myth: Since I know you are using the updated engine, I will let you know when it is compiled and uploaded for you.
 
That is slow, and turns out repetitive/duplicate code to what the engine is already doing.

The engine already iterates the ships and finds the closest enemy and stores the distance in rCharacter.SeaAI.Update.Situation.MinEnemyDistance. Since it already does this, I decided to also add the character index as: rCharacter.SeaAI.Update.Situation.MinEnemyIndex.
Actually, I think that PotC code I referred to does pretty much exactly what you say
It takes those engine-generated attributes and loops through them to find the one needed.
So: right you are! :cheers
 
There is nothing in the game currently, to do this.



That is slow, and turns out repetitive/duplicate code to what the engine is already doing.

The engine already iterates the ships and finds the closest enemy and stores the distance in rCharacter.SeaAI.Update.Situation.MinEnemyDistance. Since it already does this, I decided to also add the character index as: rCharacter.SeaAI.Update.Situation.MinEnemyIndex.

Myth: Since I know you are using the updated engine, I will let you know when it is compiled and uploaded for you.

I am aslo write Email for you. I write about movie deadman & some problems with sea some time.

The fact that I changed the automatic boarding companions. Now if boarding succeeds, the form of cargo exchange will open. Also to the main character. Also, I added the exchange of goods between the companions. We can discuss the details by e-mail.

But now I want to allow my companions to board any close hostile ship, not just the target.

If someone is interested in the result, then I will record a video.
 
Back
Top