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

Ship Adjustments

Oh, sorry that's the angle I took the screenshot.
No, he's definitely running, quite far off the bow of the FR_BattleFrigate.
 
I've seen those guys a few times. They seem to take off from the front of a ship and just run away. After a while they come back. They started doing it just in the last month or so.
 
Is there anyone here who knows how to fix walk files? It goes without saying that we need someone to do this. :will


Off topic: I was just wondering about lanterns on ships, and how they don't light up at night.
If lanterns on land light up, then surely we can code lanterns on ships to do the same thing?
Would this actually be possible, even if it involved adding locators to each ship for a lighting effect, or something? :?
 
It'd surprise me if we could get the lanterns working at sea in the same way as ashore.
The only thing I could think of, and I did some experimenting with that but never continued, is to use the steamship code.
If we can generate a particle effect at a certain spot, we could also do that with a light-like particle.
However, the reason I gave up on this one is that the steamship coordinate code needs to be adjusted for pitch and roll,
which is a seriously huge pain and is beyond me to understand properly. :facepalm
 
OK, so how does the code work on land?

Indeed the steamship code sounds very dodgy to use for this purpose, though.
Or is there something in CoAS which would help here? :shrug

EDIT: I'm beginning to think this has to do with locators. Have you noticed all CoAS-type ships have "100n" (n = 1, 2, 3, or 4 in most cases) locators in the positions of their lanterns...?
 
A large part of the light code is somewhere in the game engine files, which we therefore cannot change for PotC.
There does seem to be some related stuff in PROGRAM\Locations\locations_loader.c, but that's also stuff that's far beyond me. :facepalm

Or does anyone understand this stuff and potentially if it can be applied to the sea environment as well?
Code:
	//Lights===============================================================================
string lightPath;
string lightName;
string lightGroupName;
if(Whr_IsLight() == 0)
{
lightPath = "models.day.lights";
}else{
lightPath = "models.night.lights";
}
if(CheckAttribute(loc, lightPath) != 0)
{
makearef(st, loc.(lightPath));
num = GetAttributesNum(st);
//traceif("numLights = " + num);
for(i = 0; i < num; i++)
{
at = GetAttributeN(st, i);
lightGroupName = GetAttributeName(at);
sat = lightPath + "." + lightGroupName;
lightName = loc.(sat);
sat = "locators." + lightGroupName;
if(CheckAttribute(loc, sat) != 0)
{
makearef(lit, loc.(sat));
lnum = GetAttributesNum(lit);					
for(j = 0; j < lnum; j++)
{
lit1 = GetAttributeN(lit, j);
float litX = stf(lit1.x);
float litY = stf(lit1.y);
float litZ = stf(lit1.z);
//traceif("     AddLight: " + lightName + " (" + litX + ", " + litY + ", " + litZ);
SendMessage(loc, "lsfff", MSG_LOCATION_ADD_LIGHT, lightName, litX, litY, litZ);
if(lightName == "lamp")
{
SendMessage(loc, "lsfff", MSG_LOCATION_EX_MSG, "AddFlys", litX, litY, litZ);
}
}
}
}
}
//Particles============================================================================
CreateParticles(loc);
A similar, but reverse, thing I had tried to do was to put the sailors walking around at sea in the port/shore scene.
Although I copied the code and didn't cause any crashes, I didn't manage to make it work, not even after Pirate_KK gave me a hand. :(
 
As confusing as that code seems, if we went through it bit by bit, we may be able to get some sense out of it. Maybe. :mm
At least with locators, this complicated pitch/roll thing doesn't apply, right?
 
I don't think the code for land lantern or similar stuff (candles, etc) would work for ships, because well, land doesn't move... If you look in PROGRAM\Locations\particles.c, for example, it seems that those kind of lines are used : CreateParticleSystemX("stars",stf(locator.x),stf(locator.y),stf(locator.z),stf(locator.vz.x),stf(locator.vz.y),stf(locator.vz.z),0);

meaning it take the coordinates once. Or so I understand...

I don't know how to make some particle effect to move with the ship, and I'm not familiar with the steamship code. The only thing I can think of, is hyjacking the ship-in-fire code. This line especially : SendMessage(arShipObject, "llsslf", MSG_SHIP_ACTIVATE_FIRE_PLACE, iFirePlaceIndex, "ship_smoke", "ship_fire", iSoundID, fFireTime);

you could replace "ship_smoke" and "ship_fire" with the effect you want (likely to be added in RESOURCE\INI\PARTICLES\ship_fire.ini). iFirePlaceIndex refers to one of the fireplace locators, so the lanterns locators would have to be called that way to. And the whole ship in fire code would have to be edited - so that our ship lantern wouldn't be shut off by firedrill procedure, or a fire doesn't start in one of the lantern, or things like that...
 
If the particle system emits only one particle and then dies out,
we can trigger the CreateParticleSystem line very frequently and the particles will follow the ship.
That's basically what the steam ship code does, only it doesn't make use of locators,
because I wasn't sure how to extract the locator coordinates from the ship model through ingame code.
However, doing that might be possible, judging by the similar code from locations_loader.c .
If so, we could make new locator types for ship particle effects.

Basically, the ship moving shouldn't be the main problem.
The two main challenges I imagine we'd need to solve are:
1. Getting a particle effect to be generated at the exact desired position, taking into accoun ship position,
course, roll and pitch, preferrably by extracting locator coordimates from the GM file through code.
2. Making a particle effect that only lives for a very short while and doesn't move from it's initial position.

If we manage to do those, we could get any particle effect following any new locator type on any ship.
The only thing we're not going to manage is a glow around it, but if we've got rays of lighting emitting from a point, I reckon that'll do.
 
When you put it that way, it certainly seems more doable. But still challenging. Yet not impossible. Hopefully. :mm
So am I right in saying that we'd need to invent a new locator group, or could we just use the 'lights' group that CoAS ships have?
And how does the glow effect work, if it won't work with ships? :wacko:
 
So am I right in saying that we'd need to invent a new locator group, or could we just use the 'lights' group that CoAS ships have?
IF we can extract the locator coordinates, I reckon we could just use the "lights" locator type, yes.

And how does the glow effect work, if it won't work with ships? :wacko:
How it does work, I do not know. However, it's not a particle effect and that's all I know how to generate.
 
Fair enough, I think we're all "in the dark" with this idea, anyway. (excuse the pun! :cheeky )
We just need to try and make sense of the current code, then pick out what might be useful, and hope it works! :will
 
Experienced Captain, which of your files are ready for inclusion in a Patch?
I'm leaving later tomorrow, but might try to compile a Patch 5 just before I leave to give you something to work from the coming months.
 
All the recently converted ships are fine, barring a few I'm yet to do.
Surprise and Poseidon are not yet ready. :facepalm
I haven't finished copying the new rigging for the corvettes from way back when I modified it, but a select few have been changed.
I also changed the rigging for FR_SuperiorWarship... er, something. I can't remember which one, but it's more battleship-like for the Belette in NH storyline.
I added some staysails to RN_Warship to make it more typical of the late 18th Century/ early 19th Century.
I did some texture work on RN_Warship and RN_Lineship too, which I can give you.
And of course there's that whole interface screenshots thing. I just need to finish stitching the images together, test them with miklkit's code, and we're done.
That's about 200 images left, mind, but if you need it pretty soon-ish, that can be arranged. :yes

If there's something I've missed, do let me know and I'll post an update.
For now, I'd say to look at my back-up file on the FTP. That contains pretty much all my recent ship-related stuff, including WIP files like Surprise and Poseidon.
Take what is relevant, and let me know if there's any textures missing or anything. Or if there's something I forgot to mention in the file. ;)
 
So could I just take all of your included ship GM files, except the Poseidon and Surprise and include them?
 
Pretty much, yeah. You'll need any other text files plus some of the textures included, too. :yes
Like I said, if there's a model there that I haven't explained, just ask me to.
 
Well, I hope I did everything properly now. Currently uploading Patch 5.
 
Back
Top