Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Qwerry, St.

8
Posts
2
Topics
A member registered Aug 19, 2021

Recent community posts

Found in some scripts attempts to forcefully damage the sails of the ship in order to pretend that it was battered by some events.
But they all don't work.
=
For the basis, I took the way in which damage is done in storms
function MakeSailDmg (chr_idx, dmg)
But nothing came of it, there are no errors in the log and there is no result.
Apparently, this feature only works in BattleInterface.
=
So, Is there a way to forcefully damage sails with scripts?

as expected, it didn't work when the mast fell.
=
if (sMastName!="#")    
{
arSail.mastFall = sMastName;
if(CheckAttribute(chref, "mastFalls." + sMastName))
chref.mastFalls.(sMastName) = sti(chref.mastFalls.(sMastName)) + holeCount;
else   chref.mastFalls.(sMastName) = holeCount;
}
code doesn't work at all. Probably the name of the mast is never different from *.
I checked breakage of mast with another ship collision and from shelling. And this section of code has never been executed.

So I don't have any new information for recalculations.

(3 edits)

OK. I'll check tomorrow, but I'm pretty sure it won't work.
Because after mast falling, when recalculating SP - all sails and ropes that were assigned to that mast are considered completely destroyed.
And in the ProcessSailDamage function, I can remember only one last element that was hit.
So, if I don't have information about all sails, rigs, ropes... holes/triangles quantity, then I can't correctly calculate SP.

=

just remind you that you can break the bowsprit against another ship or land
There will be no holes on it, but the ship will lose a significant part of the SP immediately

discrepancies occur when the mast falls.

 all information about how many sails are considered attributed to this fallen mast is not available in the script part

but nevertheless, when mast falls, chr.ship.sp data is instantly updated in BattleInterface and this is not done by the calculateshipsp function.

I need information about what percentage of all ship sails the engine subtracts when the mast falls. and how I can get this persent in scripts. 

just  forget about sail holes. 

OK
Now I realize that you completly didn't understand what I need. 
:(

(2 edits)

I can't agree with this.
I remove from scripts all sails SP recalc and all work even better. All damages correctly update in sea(sail status bar) and in interface tables.
And BattleInterface somehow recalc all damages even not in battle after new damage, but just with ship model loading.
And I don't see in scripts BI code for changing.
-
And on the other hand, if I try to force scripts to set the percentage of the ship's sails to 100% and remove all damage except for broken masts, then, when I go out to sea, the percentage is instantly recalculated by BI depending on the number of broken masts.
-
My question is exactly how I can get this information about how many percent of SP game subtracts for each broken mast.

And I cite the results of my research in the script part.
===
1. for the test I shell the ship
2. after shelling, I save all available information about masts and sails:
Engine calculate that ship have 26/100 sails


3. Seems like last digit on reygroup - mastnumber. OK. I just repair damages on broken masts, And result on right side of picture. 
I go out to sea and engine not recalc sail percentage, so... all correct. This holes was on broken masts.
4. I try repair just remaining damage, i.e. holes in the sails, but not restore broken masts.
Sum of damage on this holes: 4.35+12.5+4.63+3.37+15.1 = 40%
26+40 = 66%
Then I go out to sea and engine states that on ship 50/100 sails. NOT 66.

What's wrong? How I can get right percent of repair?

(1 edit)

My goal is to make it possible to repair each fallen mast separately at the shipyard.
At first glance, this is not difficult.
But in practice, it is not possible to correctly calculate the state of the sails (percent) after repair.
=
I make repairs, I count how much damage I removed from sails, 
then I go out to the sea and the engine recalculates ANOTHER percentage of sail condition.
=
Is it possible to add the output of the percentage of sails belonging to a particular mast to scripts?
Or fix the engine recording damage to masts and sails so that there are no discrepancies.