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

Economy and Iron Man stormy start

Hey guys, sorry for the late reply - I went sailing ;)

Have you tried the closest point fix?

I think I managed to do the following:
- I unblocked Sail Ho and Land Ho events even when other ships are in the vicinity
- I teleport nearby ships to the new location along with the player, keeping their relative position

I'm not sure if it works correctly though, I need to playtest it.
 
Have you tried the closest point fix?
I think I included it in the Beta 3.3 WIP, but I can't remember now. :facepalm

I think I managed to do the following:
- I unblocked Sail Ho and Land Ho events even when other ships are in the vicinity
- I teleport nearby ships to the new location along with the player, keeping their relative position

I'm not sure if it works correctly though, I need to playtest it.
Seriously? Wow, that would be amazing! :shock

Do you also get the new ships generated for the next island you reload to?
And when you return to the previous island, are the "coast raiders" still there or did they end up at the "wrong" island?
 
Seriously? Wow, that would be amazing! :shock

Do you also get the new ships generated for the next island you reload to?
And when you return to the previous island, are the "coast raiders" still there or did they end up at the "wrong" island?

Well, I only tried to teleport enemy ships within a certain radius (2 times the radius that was blocking 'land ho' events), but I didn't have much time to test it and I still don't know whether it works or crashes the game ;). I didn't change anything in the generation code, so all the ships in the next island cell should generate the same. If you would immediately go back to the previous island, theoretically the enemy ships would still be inside the 'teleportation' radius, so they should teleport back with you. IF I did everything correctly.

"Coast riders" are pirate ships I presume?

The problem with this is that the situations is quite rare, so testing might take me some time.
 
"Coast Raiders" are the random ships generated around the islands.

Perhaps if you post the code, other people can help testing?

Also make sure Open Sea Mod/Iron Man Mode is OFF, because that would make the situation likelier do the the distances being smaller.
 
Soooo, I tested my changes and here's what happens:

1. Most of the time it doesn't work at all - I need to check for the ships before Sea_ReloadStartDirect() since it delete's the current sea, and I need to recreate the ships after the creation of the new sea, which is apparently asynchronous in Sea_ReloadDirect() - there is no good place for me to place the code.
2. When it does work, apparently x = a - b always equals to a, so the new ships are always on the same spot as the ship of the player and disaster ensues :rofl

And that is why I didn't want to put the code in public :D
Hopefully I will manage to resolve those issues - I finally got a perfect testing save.

And I wanted to ask you about a few more things:
1. What would you say about the occurrence of a storm stopping time compression? It seems like a killer to me.
2. What would you say about the reduction of lightning frequency? Once again in a 2 hour storm I got hit ~7 times and almost sunk because of it. It seems like it's too much for me. I don't know where the code is though. Do you?
3. When traveling south from Eleuthera, I ran into a continent - no land ho or anything. It was seemingly impossible to sail around (sailed east for 20 hours @~10 knots and I couldn't see the end of it). It disappeared when I got a Sail Ho message. A bug I presume? What could be the cause?
4. I changed the code for applying stays, because for some reason it didn't work for me(only turning improvement worked). I limited the closest point to 0.05, to ensure there would be no "sloop + stays = 0 closest point" weirdness. Im not sure if this shouldn't be 0.1 though, since 0.05 feels like you can sail almost straight against the wind - it's weird. What max closest point improvement for stays do you think would be good? If I'm correct KB intended for a -0.1. This along with minimum of 0.05 would make all schooners equal to sloops after upgrade. If we change the minimum to 0.1, it will make the difference between luggers, sloops and schooners low. What are your thoughts?
 
AGH! Was too good to be true, eh? :facepalm

1. Sounds fine to me. I added a bunch of ResetTimeToNormal(); lines a while back to prevent the player from getting messed up when running into danger on time compression.
But I don't think storms are covered, which I agree would be useful too. :yes

2. Looks like PROGRAM\Weather\WhrLightning.c has some code related to that.

3. This is what the Eleuthera island model looks like:
upload_2014-8-31_10-26-12.png

Must have been one of those other islands included. Odd that they would be there, but it is an AoP2 island model and I think they did this to "simulate" DirectSail.
Since we have REAL DirectSail, we don't actually need it.

4. Uhm.... Perhaps @Hylie Pistof or @Armada has something to say there? I'm not sure myself....
 
I managed to correct the errors, but I get no ships created...;/
The code is in the file (search for FlayedOne tags)

I believe it is because of character indices. For example - in my save, there are 2 ships right behind my ship. Before Land Ho, the characters on those ships have indices 2000 and 2001.
After Land Ho on the other hand they still have those indices, but there are also generated other characters with the same indices - that's why a Ship_Login function doesn't work - when invoked it just re-logins ships of those new characters.

It seems to me, that I need to assign new indices to those characters and their ships, but I can't find relevant code.

Additionally - Create_Entity invoked in my TransferShips function crashes, but when I made a separate function LoginTransferredShip it doesn't crash with the same parameters. I don't get this :D

-edit- I almost forgot! One more question! Is the 'help tailor get supplies' quest that is needed to unlock advanced commerce working? How do I get it?

- WARNING - The file contains faulty code and may explode your PC!
 

Attachments

  • CCCdirectsail.c
    65.2 KB · Views: 91
Last edited:
That code stuff is all Chinese to me, so I'm no help there.

1. When in direct sail and running into a storm, 10x speed can indeed be a killer because you are not prepared for it. I like to start off in 1x time and then go to 10x time to get it over faster.

2. Ya gotta get sunk at least one time just to keep the storms interesting.

3. That is a strange case. It is possible to get transported far away during a storm. Did you sail South from Eluethera, get caught in a storm, and then run into Central America? That could indeed happen if you were blown to the other side of Cuba by the storm.

4. I never sail those ships so have no comment. I don't know enough about that part to be able to make them do what I want, which is realistic sailing. What bothers me is that they are faster into the wind than with the wind. And why does the cutter go 14 knots into the wind?

You must still be playing beta 3.2 which is badly messed up. Get the Beta 3.3 and be happy.
http://www.piratesahoy.net/threads/simplified-build-14-beta-3-3-wip-code.23064/
 
That code stuff is all Chinese to me, so I'm no help there.

1. When in direct sail and running into a storm, 10x speed can indeed be a killer because you are not prepared for it. I like to start off in 1x time and then go to 10x time to get it over faster.

2. Ya gotta get sunk at least one time just to keep the storms interesting.

3. That is a strange case. It is possible to get transported far away during a storm. Did you sail South from Eluethera, get caught in a storm, and then run into Central America? That could indeed happen if you were blown to the other side of Cuba by the storm.

4. I never sail those ships so have no comment. I don't know enough about that part to be able to make them do what I want, which is realistic sailing. What bothers me is that they are faster into the wind than with the wind. And why does the cutter go 14 knots into the wind?

You must still be playing beta 3.2 which is badly messed up. Get the Beta 3.3 and be happy.
http://www.piratesahoy.net/threads/simplified-build-14-beta-3-3-wip-code.23064/

Haha, emotional speech is chinese to me. Each has his own problems :)

1. I will post a fix, although Peter knows what to do with it :p

2. So you think those lightning hits are necessary? I believe the rigging damage is a more realistic and better approach (if you lose sails you can't get anywhere and can't turn - get capsized anyway).

3. There was no storm. I just met this landmass out of nowhere...

4. This should not happen anymore with my closest point fix I posted earlier:) I tested it extensively with sloops(0.1 closest point) and schooners (0.15 closest point) with sails :)

I'm playing Beta 3.3 ;) But I'm still looking for places to improve :)
 
2. The lightning strikes aren't that much of a problem for me. My personal record is the 7th consecutive storm sank me. Then again I have been sunk in one storm.
Perhaps our different attitudes are caused by sailing different ships. Storms are deadly in a Lugger but merely an inconvenience in a Treasure Galleon.
 
I managed to correct the errors, but I get no ships created...;/
The code is in the file (search for FlayedOne tags)

I believe it is because of character indices. For example - in my save, there are 2 ships right behind my ship. Before Land Ho, the characters on those ships have indices 2000 and 2001.
After Land Ho on the other hand they still have those indices, but there are also generated other characters with the same indices - that's why a Ship_Login function doesn't work - when invoked it just re-logins ships of those new characters.

It seems to me, that I need to assign new indices to those characters and their ships, but I can't find relevant code.
Don't have time anymore today, but perhaps tomorrow I can have a look into it.
Generally, the characters should be based on their IDs and not any numbers, so that sounds a bit weird.
All the Coast Raiders do have unique IDs, because I know they have their relevant island name in there.

-edit- I almost forgot! One more question! Is the 'help tailor get supplies' quest that is needed to unlock advanced commerce working? How do I get it?
I disabled the "Locked Perks" mod in the Beta 3.3 WIP files, because the "Fetch Quests" don't work 100% right
and they're tied into the new Economy, which really doesn't do what we would want. So.... Nope, not quite working I'm afraid. :oops:
 
Hi guys,

So after a fair bit of trying different approaches, I finally identified the problem.

The characters and ships get replaced in the memory. Even if I save a ref to a character and aref to a ship, after Land Ho they will both be pointing at a new character and a new ship.
Frankly I'm out of ideas... Do you have any?
 
Do their IDs stay the same? Perhaps there is some code that creates new Coast Raiders on a location reload.
If so, you would want to put a stop on that in these instances.
 
Their IDs change, but their indexes stay the same. If I change their IDs before Land Ho they still get replaced.

I tried to stop them from getting replaced by including a check in the function that generates new characters, but then the game crashes, presumably because groups end up with NULL characters.
 
AGH! So close, yet so far. And I'm not very familiar with that code myself. :oops:
 
Back
Top