• 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!

Sword of triton

Ok now i can try to rewrite and test it :doff

// PB: Queen Anne's Revenge -->
case "BI_QARSword":
BI_retComValue = 0;
break;
case "BI_QARSword":
BI_retComValue = 0;
"BI_KrakenAttack":
BI_retComValue = BI_COMMODE_ENEMY_SHIP_SELECT + BI_COMMODE_ALLLOCATOR_SELECT;
BattleInterface.Commands.KrakenAttack.EffectRadius = 1.5*MIN_ENEMY_DISTANCE_TO_DISABLE_MAP_ENTER;
break;
// PB: Queen Anne's Revenge <--


// PB: Queen Anne's Revenge -->


case "BI_QARSword":
if(IsPerkIntoList("QARSword"))
{
pchar.Ship.Impulse.Rotate.z = 0.0;
DelPerkFromActiveList("QARSword");
PChar.ship.speedburst = "QARSword";
PostEvent("SpeedBurstFinished",120000, "i", pchar);
}
else
{
AddPerkToActiveList("QARSword");
PChar.Ship.Impulse.Rotate.z = 0.16; // = 8 knots max
}
break;
case "BI_QARSword":
BI_retComValue = BI_COMMODE_ENEMY_SHIP_SELECT + BI_COMMODE_ALLLOCATOR_SELECT;
BattleInterface.Commands.KrakenAttack.EffectRadius = 1.5*MIN_ENEMY_DISTANCE_TO_DISABLE_MAP_ENTER;
break;
case "BI_QARSword":
float fDamageMultiply = 0.5;
ref rShip = GetShipByType(GetCharacterShipType(&Characters[targetNum]));
float fBaseSailHP = stf(rShip.SP);
MakeSailDmg(targetNum, fDamageMultiply * (fBaseSailHP / 100.0) * 0.05);
break;

I don't understand were...please be patient with me
 
Last edited:
So I can only overwrite on yhe speed burst...my hope was to have this as a secondary effect...like the flying dutchman...tha it can submerge and call the kraken...my hope was to have the speed burst and this effect for the sword of triton
 
Replacing is far easier to start with.
Once that works, it should not be too difficult to have it in addition instead.
 
i tried even a new game...but every single time i push the icon of the sword of triton don't produce any effect anymore...it's like pushing nothing
 
i tried even a new game...but every single time i push the icon of the sword of triton don't produce any effect anymore...it's like pushing nothing
Looks like the code ended up in the wrong spot.
Try attached version instead.
 

Attachments

  • BattleInterface.c
    106.2 KB · Views: 159
ok better than before in fact :) but i can't finde any damage to the sail, the enemy ship have always the same numeber of % for the speed and sail hp...maybe the dmage must be aumented I guess...but targetting the ship is perfect...like i had intended to be.
 
Last edited:
ok better than before in fact :) but i can't finde any damage to the sail, the enemy ship have always the same numeber of % for the speed and sail hp...maybe the dmage must be aumented I guess...but targetting the ship is perfect...like i had intended to be.
PROGRESS then! :woot

Then this section of code will need to be tweaked:
Code:
case "BI_QARSword":
float fDamageMultiply = 0.5;
ref rShip = GetShipByType(GetCharacterShipType(&Characters[targetNum]));
float fBaseSailHP = stf(rShip.SP);
MakeSailDmg(targetNum, fDamageMultiply * (fBaseSailHP / 100.0) * 0.05);
break;
Applying sail damage seems to be quite tricky and that there was just a very quick shot.

Would have been nice if it worked, but apparently not, so we'll have to do some debugging.

Put attached file in your game. This does not change the functionality, but DOES add some extra debug lines.
Now, try to use it again. You should, at the very least, get one message on your screen.
If you do, post the compile.log file from your main game folder here.
This should at least give us some more information.
 

Attachments

  • BattleInterface.c
    106.5 KB · Views: 183
The message appear and here is the compile log you asked
Good news!
Code:
BI_QARSword: targetNum = 2050, fDamageMultiply = 0.5, fBaseSailHP = 200.
MakeSailDmg: HMS Courier with dmg = 5.e-002
Actually applying damage...
This means the code is actually already fully functional. The only real problem is this:
dmg = 5.e-002
That means the damage being applied is just a tiny bit.

Try replacing this:
Code:
MakeSailDmg(targetNum, fDamageMultiply * (fBaseSailHP / 100.0) * 0.05);
With this:
Code:
MakeSailDmg(targetNum, fDamageMultiply * fBaseSailHP);
That should give 2000 times more damage. Hopefully then you will indeed notice it doing something.
 
Ok I will test it tomorrow...if it'is really working we can tink to a possibile crew damage in addiction...for now tank you sir bolen...yomorrow i eill bring news :doff
 
Sir execelent news!!!! The damage function is peerfect and is not oveporvered....absolutly perfect...so i think we are ready for the nex step...add a crew damage with this sail damage...and again the other ability of the speed burst...in this way we can have two or tre different abilities for the sword of triton...not overpowered and perfectly balanced :monkeydance
 
I assume, right now, you can repeat the command as many time as you want without a time limit, right?
Probably something like that should still be added.
Can't remember now how the Speed Burst version works though; is that with a time limit or is it on/off?
The only thing I remember is that the Sword of Triton works slightly different from the Black Pearl Sweeps ability.

For crew damage, you can use a function call like this one:
Code:
Ship_ApplyCrewHitpoints(GetCharacter(targetNum), fDamageMultiply * GetCrewQuantity(GetCharacter(targetNum)));

To keep the previous functionality, search BattleInterface.c for all instances of "QARSword" .
Make copies of all those sections, but replace "QARSword" with "TritonAttack" (for example).
Then put the NEW code in those new sections and restore the OLD code to the "QARSword" sections.

Then in RESOURCE\INI\TEXTS\English\commands_name.txt, you should replace this:
Code:
sea_QARSword {Sword of Triton}
With something like:
Code:
sea_QARSword {Speed Burst}
sea_TritonAttack {Rigging Attack}
This is for the text that displays in addition to the icon.

Can't remember which file contains the texture for that icon, but it should be in RESOURCE\Textures\BATTLE_INTERFACE .
It might be cicons_command.tga.tx , but I can't check right now and I'm not sure if there is still space available in there for a new one.
 
If I remember in the past speed burst of the sword of triton had a time limit...now you can push the icon and then push the icon again to make the speed burst stop...then tge sword of triton must recharg itself before use it again.
 
Ok but how can i open the tx file? because if I cannot make a new icon the secodn power of the sword will not be activated right?
 
Back
Top