1. Dismiss Notice
  2. GOG.com logo

    Thanks to YOUR votes, GOG.com now sells:
    - Sea Dogs - Sea Dogs: Caribbean Tales
    - Sea Dogs: City of Abandoned Ships

    Vote now to add Pirates of the Caribbean to the list!

    Dismiss Notice
  3. Under the Crossbones Podcast

    A Pirate Podcast with Interviews
    Music, Comedy and all things Pirate!

    - Episode Guide - About - Subscribe -
    - Twitter - Facebook - iTunes - Android -
    - Youtube - Fill the Coffers -

    Dismiss Notice
  4. New Horizons logo

    Quick links for PotC: New Horizons
    - Download latest version
    - Wiki - FAQ - Report bugs here
    - ModDB profile

  5. GOF logo

    Quick links for AoP2: Gentlemen of Fortune 2
    - Downloads and info
    - Historical Immersion Supermod
    - ModDB Profile

Dismiss Notice
New to the forum?
Please take a moment to read our Welcome Message and Forum Rules.

New Horizons on JLB Maelstrom 2.8.2 engine

Discussion in 'POTC: New Horizons Mod' started by pedrwyth, Oct 28, 2017.

  1. Levis

    Levis Find(Rum) = false; Staff Member Programmer Creative Support Storm Modder

    Joined:
    Oct 6, 2013
    Messages:
    6,860
    Gender:
    Male
    Occupation:
    ICT
    Location:
    The Netherlands
    so new horizons is now working on this engine?
     
  2. ChezJfrey

    ChezJfrey Master Mariner Storm Modder

    Joined:
    Apr 24, 2015
    Messages:
    249
    I made the position change you offered. I also changed the 'Give Orders' icon to the flag.

    This testing was also good, because during a game load, I occasionally got an obscure bug in a class deconstructor I had never seen before, that caused a CTD. I fixed that and a new engine and script code is available for you:
    MEGA

    NHProgramUpdate2.zip

    First, your storm messages. It looks to me, in battleinterface.c, like those appear under the following conditions:

    if (!IsEntity(&IShipRoll) && Whr_IsStorm() && CheckAttribute(PChar, "Capsize") && GetCharacterShipClass(PChar) < 8)

    However, in that save game with the storm, a trace shows me that Whr_IsStorm() is false, and GetCharacterShipClass equals 8. So two of the criteria don't match and that is probably why those particular messages don't show. I checked Whr_IsStorm() and it is defined in WhrWeather.c, passing back the value of bWeatherIsStorm. I searched the content of the original, untouched NH program files I have and found only two files that use bWeatherIsStorm: WhrGeneration.c and WhrWeather.c. I then compared both of the stock NH files to my versions and both of them are unchanged by me, matching exactly.

    You can't exit the sea, because as soon as you go back to worldmap, the storm is still there, you get caught in it again, and are immediately placed back in sea, during a storm. I didn't know if that was intentional or not, so left it, because I did not change the weather code at all, and looking at my changes to worldmap, they are minimal and have nothing to do with storm generation and/or whether the storms 'stick' like they appear to do. Again, I didn't know if that was by design.

    I also don't know what those 'Give Command' selections are supposed to do, since I've never played NH. I notice if you select a companion ship, nothing happens...but I also don't know what is supposed to happen? I've altered battleinterface.c and loginterface.c to more closely match the original now and don't really see any code for that command in the stock New Horizons that is not also matching in the new version. Perhaps it's a deprecated feature in the engine, that no longer functions? I also noticed that the part of the code to display you companion's icons for selection, is removed from COAS scripts via comment. If this feature is intended for telling your companions to alter sail state, ammo, etc., it may require matching the technique in COAS now, if indeed some feature that used to enact, is deprecated now.
     
  3. ChezJfrey

    ChezJfrey Master Mariner Storm Modder

    Joined:
    Apr 24, 2015
    Messages:
    249
    Yes.
     
  4. Pieter Boelen

    Pieter Boelen (Not So) Old Seadog Staff Member Administrator Storm Modder Hearts of Oak Donator

    Joined:
    Nov 11, 2004
    Messages:
    66,950
    Gender:
    Male
    Occupation:
    Maritime Research: Project Engineer (Analysis)
    Location:
    Wageningen, The Netherlands
    From what I understand, @pedrwyth is working together with @ChezJfrey to test it.
     
  5. pedrwyth

    pedrwyth Privateer Storm Modder

    Joined:
    Jan 8, 2015
    Messages:
    671
    Gender:
    Male
    Ok the rolling messages were my stupidity -sorry for timewasting :mad:, a higher tier ship does show the messages, I will try and make sure I am comparing like with like in any future comment.

    However your comment about Whr_IsStorm() may have relevance to getting stuck in the storm. World map should only appear once the storm abates or moves on hence perhaps the Whr_IsStorm() = false in the saved game. You could occasionally go to world map and immediately encounter a persisting storm again. However in all three instances I have encountered storms the locked into storm scenario has arisen so either I am currently unlucky or something is different with the way the storm persists. I guess since you haven't changed anything there it's something for me to try and resolve.

    With companions I have put together some screen shots of what used to happen when running in the original engine. The choice of companion to order in give order.jpg is as far as we now get in maelstrom 2.8.2. Making the selection you move to the next screenshot. The commands you could give via the icons were attack, defend, sail away, heave to, use ability and hoist flag. So changing their type of ammo would be an additional feature. :)

    In fact ammo charge type is another thing I have noticed not appearing in battle interface, you will see in the screen shots an icon of charge type just below and to the right of the compass
     

    Attached Files:

    Last edited: Nov 20, 2017
  6. Pieter Boelen

    Pieter Boelen (Not So) Old Seadog Staff Member Administrator Storm Modder Hearts of Oak Donator

    Joined:
    Nov 11, 2004
    Messages:
    66,950
    Gender:
    Male
    Occupation:
    Maritime Research: Project Engineer (Analysis)
    Location:
    Wageningen, The Netherlands
    Ah, you had a Tier 8 ship then?
    Indeed I disabled the "capsize" feature for those to prevent it being too evil by capsizing your lifeboat in a storm. :cheeky
     
  7. pedrwyth

    pedrwyth Privateer Storm Modder

    Joined:
    Jan 8, 2015
    Messages:
    671
    Gender:
    Male
    Thanks and you moved the icon across too. :onya So the same thing in landinterface needs something like

    Code:
    objLandInterface.ManSign.(sOffsetIcon) = "70," + (70 + (i-1)*110);
    
    changing to
    Code:
    objLandInterface.ManSign.(sOffsetIcon) = (70 + (i-1)*110) + ",700";
    This will free the space for the landinterface interact icon to go back left with its matching text, and not get log overwrites. The choice icons down the bottom always replaced/overwrote companion icons anyway so that is much as it was.

    You will note I have changed from 680 to 700 because without the ship names the icons look a too far up the screen. Also here the offset was only 110 not the 128 I had assumed so for consistency I would now put the battleinterface to
    Code:
    BattleInterface.ShipIcon.iconoffset1 = "70,700";
        BattleInterface.ShipIcon.iconoffset2 = "180,700";
        BattleInterface.ShipIcon.iconoffset3 = "290,700";
        BattleInterface.ShipIcon.iconoffset4 = "400,700";
        BattleInterface.ShipIcon.iconoffset5 = "510,700";
     
  8. ChezJfrey

    ChezJfrey Master Mariner Storm Modder

    Joined:
    Apr 24, 2015
    Messages:
    249
    After reviewing your screenshots, the ineffect of 'Give Order,' in the new engine to provide similarly, while the COAS feature for similar action does work, but in a different way, with either a down/up movement along the 'shipsign' icons of your companions, it seems clear to me that the older way was deprecated, in favor of the different, COAS-style behavior to issue those same commands to your companions.

    Given the task, I am currently unwilling to try and replicate that old method in the engine, since the code for it no longer seems to exist in the source and I would have to reproduce it from scratch, for no real benefit, since an already existing and workable solution already provides; simply reconfigure the battle interface to more closely match COAS. This would require a little bit of repositioning of those log messages, though, because the player would need to be able to button up/down along the list of companions, rather than have them displayed horizontally.

    Thoughts?
     
  9. ChezJfrey

    ChezJfrey Master Mariner Storm Modder

    Joined:
    Apr 24, 2015
    Messages:
    249
    Yep, that's it.

    I simply added the up/down controls to init_pc.c (2 lines of script code), nothing else, and even with the icons scrolled out horizontally, the commands you are looking for show up with a press of up/down. You just can't tell which companion ship it applies with them lined out right to left, but the structure of that interface was clearly changed in the engine and I don't think the existing source base supports that old method any longer.

    The fastest resolution is to spend a little time reconfiguring some interface positions.
     
  10. pedrwyth

    pedrwyth Privateer Storm Modder

    Joined:
    Jan 8, 2015
    Messages:
    671
    Gender:
    Male
    Fine I don't like change for change's sake which is why I was looking to maintain close to NH screen layout :yes, but if it ain't broke in a COAS arrangement it don't need fixing. :shrug
    For the moment I find the COAS style icons large and intrusive but that will pass, your solution of shifting the "action" icon from the top left was to a good location (although slightly too far right since it overlaps a bit of the wind information I think, it just needs the matching text to go there too - no idea where that is controlled yet. For me the logs should stay left either under the man/ship icons but message heavy actions like loading cargo in the store would swamp the space, so more likely just right of the ship/man icons.

    The only other possible option would be to put the man/ship icons on the right under the compass if there is room for the 5 current limit in NH, leaving action icon and logs as is?:popcorn:
     
  11. pedrwyth

    pedrwyth Privateer Storm Modder

    Joined:
    Jan 8, 2015
    Messages:
    671
    Gender:
    Male
    It is a squeeze for 5 ship icons, but NH only has you and three companions (at present although there was some work on increasing this) so needn't be as tight as I have it here. Without the ship names the man icons can be squeezed up so putting them on the right is do-able. If the ship icons are dropped for four only then the charge icon I referred to earlier would still fit (if it can be restored).

    Simplest leaving logs and action item icons where they originally were?? The downside is the action icons (on pressing return) are put by default at the same screen height as Pchar man/ship icon so right across the screen - this may be controllable separately of course
     

    Attached Files:

  12. ChezJfrey

    ChezJfrey Master Mariner Storm Modder

    Joined:
    Apr 24, 2015
    Messages:
    249
    I'd like to experiment with what you've done here. To save me some time, since you've already done the trial/error positioning values, can you post those setting you used so I can copy?
     
  13. pedrwyth

    pedrwyth Privateer Storm Modder

    Joined:
    Jan 8, 2015
    Messages:
    671
    Gender:
    Male
    Of course, should have done that anyway!

    Code:
    BattleInterface.ShipIcon.iconoffset1 = "1235,240";
        BattleInterface.ShipIcon.iconoffset2 = "1235,360";
        BattleInterface.ShipIcon.iconoffset3 = "1235,480";
        BattleInterface.ShipIcon.iconoffset4 = "1235,600";
        BattleInterface.ShipIcon.iconoffset5 = "1235,720";
     
  14. ChezJfrey

    ChezJfrey Master Mariner Storm Modder

    Joined:
    Apr 24, 2015
    Messages:
    249
    Eh...I went ahead and experimented on my own, prior to your post. There is a slight quirk, in that the design builds the actions left-to-right, with no feature to reverse the order for leftmost placement in our scenario. Perhaps I can alter and add an attribute to reverse order, but that remains tabled for now.

    MEGA

    NHProgramUpdate2.zip

    I also found another issue, unrelated, about the IsSegmentLoaded, that only periodically presents in New Horizons (probably because it more heavily uses the feature), where sometimes it returned negative, albeit erroneously. I fixed that, so the engine was updated again.

    I moved those icons to the right, similar to what you did (though not exactly, but I can adjust later). I also added the two lines that enable up/down, so now you should be able to hit Enter, then up/down along the companion ships to display their respective commands.

    What do you think?
     
  15. pedrwyth

    pedrwyth Privateer Storm Modder

    Joined:
    Jan 8, 2015
    Messages:
    671
    Gender:
    Male
    I can see the functionality and that it works but think if possible the non active command be it return or up/down need locking out when they don't apply. You appear to need arrow to get the order commands but return to get an attack or defend target - and down arrow from the wrong top level icon takes you to the companion command icon bar quite confusing in the heat of a battle.

    I also don't like the menus being centre stage as it were, although that may be just that it's unfamiliar.
    2ND EDIT - forget all the following - if you saw it! I don't know what I was on this morning END 2nd edit
     
    Last edited: Nov 21, 2017
  16. pedrwyth

    pedrwyth Privateer Storm Modder

    Joined:
    Jan 8, 2015
    Messages:
    671
    Gender:
    Male
    OK tried it a bit more and got more familiar with it, I was initially confused by the redundant chooser from give order - which is now superfluous. Intuitively I would prefer the interface to revert to the PChar line on exit after a command or esc since that is where most of the commands apply but I guess it is just a question of acclimatisation. The possibility of adding a reload command to your companions (is this already a COAS feature) could add to gameplay options.

    I wonder if it is feasible to add the green arrow pointing over the selected companion when you have their line active (as in previous NH chooser) since I often use that to identify which of my ships I want to order to act in a given situation - but no big deal.
     
  17. ChezJfrey

    ChezJfrey Master Mariner Storm Modder

    Joined:
    Apr 24, 2015
    Messages:
    249
    Yes, the 'Give Command' is superfluous, since it no longer functions and this new, up/down interface navigation replaces that feature. My concern with leaving the companions horizontal is that it is now difficult to discern whom is receiving the command, but if you prefer to leave them that way, I won't argue. It's just that if they were vertical, I wanted to demonstrate that the command receiver is identifiable by the line of commands lining up against the 'active' companion as you move up/down the list.

    It might be relatively easy to display that arrow above the companion that corresponds, as you navigate up/down the list. I can look into adding that. On escape, the command line reverting back to the last active might also be modifiable to always revert back to the main char...maybe add an attribute to indicate that preference in battleinterface setup attributes; I can look into adding that as well.

    What shot a companion is to load is indeed a feature in COAS, and is achieved in the battleinterface script.
     
  18. ChezJfrey

    ChezJfrey Master Mariner Storm Modder

    Joined:
    Apr 24, 2015
    Messages:
    249
    Oh, I found that. The settings from the original are too far to the right and thus don't display. In BattleInterface.c, change, for 'not bRealBattleInterface' else condition:

    BattleInterface.navigation.chargePos = RecalculateHIcon(160)+","+RecalculateVIcon(174);

    to

    BattleInterface.navigation.chargePos = RecalculateHIcon(52)+","+RecalculateVIcon(174);
     
  19. pedrwyth

    pedrwyth Privateer Storm Modder

    Joined:
    Jan 8, 2015
    Messages:
    671
    Gender:
    Male
    No No not at all, once I had grasped how it functions vertical is fine, actually probably better since if there is any new take up of NH it will probably be through new users having got the other flavours via steam or GOG and looking for further variety so it will be familiar to them, so it's just the die hard NH users who will feel the change and may think the scene intruded upon by icon bars - just get your command out of the way quickly and they dissappear. It is probably clearer than in original NH (I guess that's why they changed it). Under the compass is simplest since it leaves the logs as is.

    Fine I don't want spoon feeding so I can look in the newer game scripts and see how to achieve that (if I decide to add it -it would only be after getting the latest version up on 2.8.2).

    Again easier to ask than to search it out - don't be afraid to tell me not to be lazy if it is not really an engine compilation issue.

    I'm just slowly working through the various interfaces, in game stuff is more problematical for me to comment upon. Well OK The bigee, which you already know about, is particle effects - for example a booby trapped chest originally blows up with a short explosion - the new engine effect is a lasting flame which doesn't stop until you leave the location. I don't think you or I are going to do the work to get XML equivalents but the system to accept XML (even if the effect changes are by trial and error) is for you (if anyone) I think.

    The only other issue, I currently held back, is no secondary interface when you select colonies after pressing F2. Not that that means there aren't other (probably minor /cosmetic) bits. I really am not that familiar with all the effects and different playing choices/styles myself. I haven't played (apart from stock POTC) in a couple of years (yes there's a backstory to that) and then only the main storyline twice and a quick dabble with some of the others.

    I have a sneaking suspicion that Woodes Rogers in pushing the limits of ways the capabilities are used may be a bigger challenge to run successfully, but that's just on impression of how different it seems. It may be the new engine copes with it without breaking sweat.

    Oh and by the way my impression with direct sail (arcade level) was wrong you do arrive where expected, but in a couple of instances M for map had the ship icon in an odd place (still haven't checked the original for that but I presume it will show the same behaviour).
     
  20. Pieter Boelen

    Pieter Boelen (Not So) Old Seadog Staff Member Administrator Storm Modder Hearts of Oak Donator

    Joined:
    Nov 11, 2004
    Messages:
    66,950
    Gender:
    Male
    Occupation:
    Maritime Research: Project Engineer (Analysis)
    Location:
    Wageningen, The Netherlands
    That one does indeed make very creative use of the Storm engine.
    But it's not technically very complex, so hopefully most of it will already work. :onya

    That sounds very familiar, so I doubt that is related to the new engine.
    @LarryHookins can probably confirm.
     

Share This Page