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

Fixed No salary screen when skip past paydate

An alternate solution might be to move the "PChar.LastPayMonth = GetDataMonth();" line INTO the Salary Interface.
If that is added to ExecuteSailorPayment() and SkipSailorPayment(),
then the salary screen should keep appearing EVERY day until the player actively presses the either the "pay" or "skip" buttons.
Right?
That was my plan, yes.
And that "if (CalcSquadronPayment(GetMainCharacter()) == 0) return;" would have to go deeper as well, as not to prevent PChar.LastPayMonth from being updated.
 
Ah, yes; hadn't thought of that! Then I'll leave this one up to you.
Thanks again for looking into it. :bow
 
I'm hoping the fix being discussed in this topic will fix this as well, but it's apparently possible to skip the crew payment screen by resting in the tavern on payday. Found that out just now. Not sure what kind of consequences it has, but i do have a savegame for beta 3.4 here. Just rest in the tavern and see what happens.
 

Attachments

  • -=Player=- Puerto Rico. San Juan. Trade Square May 1st, 1751 1.zip
    1,023.6 KB · Views: 86
Just rest in the tavern and see what happens.
I do not have 3.4 installed. What happens? The salary screen appears and then you get transferred to your room before you can pay? If so, that yes, that's part of
what we are discussing here.

Not sure what kind of consequences it has
No consequences, as far as I can tell. The payment just gets skipped without any morale drop. You'll get another chance to skip it next month. :)
 
Done. I've tested shops, taverns, crewmember's time skip, just sitting at sea, and moving on the worldmap. All work.
I haven't played long enough to check whether the morale drop works. I see no particular reason for it not to, assuming it worked before.

Notes on the implementation:

I wasn't sure what will happen if I interrupt InitInterface halfway through, so I've left the check for zero payment where it was.
Because of that I replace InitInterface with InitInterface_I. I know the sum anyway, so why not to pass it down.
That eliminates half of "Calculate" form CalculateInfoData. And removing that unnecessary global var eliminates the second half. So that function doesn't really calculate anything at present. Still, it's doing some work so I left it be.
Even after reading @Levis' "Programming102" I have no idea what those "1", 0 arguments to PostEvent do (not much, if I'm to guess), but they worked well enough for mutiny, so I've just copy-pasted them. :oops:
There is a bit of commented out code in worldmap_events.c (everything related to "Event_CheckMoneyData"), that I think can be removed completely. But it's commented out and I wasn't making any other changes to that file, so I left it there.
 

Attachments

  • salaryscreen.zip
    20.4 KB · Views: 65
Can't test it now but good Job if it really works right now!
Did you also test it in the shipyard?
 
Did you also test it in the shipyard?
Oops, forgot about this one. But I've tested it right now and it works.

One potential problem I see with this solution is that 2.5 sec delay is arbitrary. On my current PC is feels a bit long, but I fear it might be not enough on weaker hardware.
 
I do not have 3.4 installed. What happens? The salary screen appears and then you get transferred to your room before you can pay? If so, that yes, that's part of
what we are discussing here.

Yep, pretty much. I hadn't had the chance to test it further until now, but if you've fixed it, no worries there.

One potential problem I see with this solution is that 2.5 sec delay is arbitrary. On my current PC is feels a bit long, but I fear it might be not enough on weaker hardware.

Yeah, and too long might give the player the chance to make the loading screen to another area conflict with it. :rumgone Guess this is just one of those things where you'll have to wait until someone complains about it.
 
Guess this is just one of those things where you'll have to wait until someone complains about it.
Guess so. Anyway, it's the same delay that is used already for the mutiny screen. If there are problems, we'll have to adjust mutinies as well. And those are complex beasts.
 
Looking at that code now, my suspicion is that using InitInterface should be fine and there is no need to rename it.
I'll add it like that to the mod and then we'll find out soon enough.... :wp
 
Could be... I don't know much about interfaces in Storm. :)
No, I stand corrected. Changing it back actually prevents the game from starting altogether.
So it is back to how you had it. :bow
 
Back
Top