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

Mod Release [REL] Cursed Pearl fog

AdmiralPitt

Landlubber
Hello everyone,

can you make this effect on the black pearl

http://www.moddb.com/mods/new-horizons/images/curse-of-the-black-pearl1#imagebox

In the passage congratulation has to Pieter Boelen for this success

Best Regards

Admiral Pitt
 
I think in their version they have two Pearls, pre-curse and post-curse. The one in CoAS is the post-curse ship.

It might be doable, if we have one of our coders check it out, they can provide a more detailed answer than I can. I assume it's a question of sprites and linking the effect to the ship but I don't really know much about the code.

It does look cool though. :sail
 
Let me put it this way: if *I* can do it in PotC, I'm sure it's just as possible in CoAS. :yes
I'm quite convinced that pretty much everything we have done for PotC is pretty much just as possible in CoAS.

For the PotC Build Mod, in PROGRAM\SEA_AI\AIShip.c is a function that is called every second. I put this in it:
Code:
	// PB: Black Pearl -->
if(sti(GetAttribute(rCharacter, "ship.type")) == SHIP_CURSED)
{
int puffs_per_second = 10;
if(SeaCameras.Camera == "SeaDeckCamera")	puffs_per_second = 1;
for (i=0; i < puffs_per_second; i++)
{
PostEvent("CreateCursedPearlFog", delay, "i", rCharacter);
delay = delay + 1000/puffs_per_second;
}
}
// PB: Black Pearl <--
Then the following function can go in any file, but we've got it in PROGRAM\NK.c:
Code:
#event_handler("CreateCursedPearlFog", "CursedPearlFog");
void CursedPearlFog()
{
aref rCharacter = GetEventData();
float fX, fY, fZ, fAY;
fX = 0; fY = 0; fZ = 0;

if(CheckAttribute(rCharacter,"Ship.pos.x")) fX=stf(rCharacter.Ship.pos.x);
else return;
if(CheckAttribute(rCharacter,"Ship.pos.y")) fY=stf(rCharacter.Ship.pos.y);
else return;
if(CheckAttribute(rCharacter,"Ship.pos.z")) fZ=stf(rCharacter.Ship.pos.z);
else return;
if(CheckAttribute(rCharacter,"Ship.Ang.y")) fAY=stf(rCharacter.Ship.Ang.y);
else return;
float gX, gY, gZ;
gX = 0; // Width
gY = 0; // Height
gZ = 10; // Length
CreateParticleSystemX("pearlfog",fX - gX*cos(fAY) + gZ*sin(fAY), fY + gY, fZ + gX*sin(fAY) + gZ*cos(fAY), 0.0, 0.0, 0.0, 2);
}
The only thing is that I think particle systems work a bit different in CoAS, so that might be annoying.
 
Thanks Pieter,

I worked on this project what you think of it?

Best Regards

Admiral Pitt
 

Attachments

  • bp.jpg
    bp.jpg
    427.4 KB · Views: 378
What did you have to do to get it working in CoAS? I'd be interested to know the differences between both games.
 
Hello Pieter,

I made some test and then I shall put on-line the modifications for all interested

Best regards

Admiral Pitt
 
Hello everybody

Here are files concerning this effect

This is for gof 1.1.2 for the blackpearl of Bonjourmonami

Search "Pitt" to locate the changes.


Best regards

Admiral Pitt
 

Attachments

  • PearlFog.zip
    39.7 KB · Views: 289
Very cool! Looks like there's a small typo though:
Code:
PostEvent("CreateCursedPearlFog, delay, "i", rCharacter);
Should read as:
Code:
PostEvent("CreateCursedPearlFog", delay, "i", rCharacter);
Why do you have so many CreateCursedPearlFog events though? I just needed the one. If you need more fog, you can increase the puffs_per_second value.
The second camera-related line is intended to decrease the amount of fog when you're standing on the ship's deck to prevent lag and not being able to see anything.
 
In fact if I puts only the event only one the effect will look like has that

To have only the event only one it would be necessary to be able to modify the file pearlfog.xps and I do not find program for that I was thus in the simplest

Thank you for the error i change the file

Best regards
Admiral Pitt
 

Attachments

  • BP2.jpg
    BP2.jpg
    27 KB · Views: 439
In PotC, with just one event, it does take a minute or so to get the full fog because it has to build up first. But after that, it's fine.
It could be that the CoAS particle effect just disappears very quickly again, which wouldn't help, of course. :facepalm
 
Back
Top