As I’ve been making so many random changes, it was deemed a good idea to make a thread for them.
Listed here will be changes such as...
Each upload will be applied to the original files for the most recent build, so they will need to be merged if necessary. This is with the single exception of the companion and officer max settings, these will always be applied in all files (because it’s too much hassle to change them).
I have also attached a full compilation which includes most of the changes. If you use this and increase the companion limit then you must extract the CompanionMax files first and apply the compilation on top of them (if you don’t then expect problems). [Link] (00:00, 12th May)
Follows the list of current stuff...
For clarity, the following have been recently changed or added...
Listed here will be changes such as...
- Those which are likely to be included in the next build release
- Those which could, but require further discussion and/or testing
- Those which are for amusement only and not intended for the mod
Each upload will be applied to the original files for the most recent build, so they will need to be merged if necessary. This is with the single exception of the companion and officer max settings, these will always be applied in all files (because it’s too much hassle to change them).
I have also attached a full compilation which includes most of the changes. If you use this and increase the companion limit then you must extract the CompanionMax files first and apply the compilation on top of them (if you don’t then expect problems). [Link] (00:00, 12th May)
Follows the list of current stuff...
Increasing the Fleet Limit
Interfaces for Increasing Fleet Limit
New Passenger Transfer Interface
Ship Speed & Turn on Transfer Screens
Boarding Loot Crash Fix
Reinforced Hull Upgrade - Calibre Fix
Rebalanced Upgrade Costs
Skip Equip
Increasing the Maximum Skill
Increasing the Officer Limit
Save/Load Interface
Miscellaneous Functions
Spawning a Random Officer
- Priority: High
- Status: Work-in-Progress
- Intention: Build
- Filename: CompanionMax.7z
- Last Edit: 04:00, 12th May
- Forum Discussion: [link]
- Screenshot: [link]
- This will allow for increasing the maximum permitted non-berthed ships the player may control. Feedback is required in respect of; if this should be done at all and if so then how many ships. I am personally leaning towards a maximum of eight - more could slow things down.
- I have substantially played with 6+ ships and it works just fine, although daily updates can be slower. It also goes without saying that if you have umpteen ships and then waltz into the middle of two scratch fleets having it large, you’d better be expecting a fair drop in performance!
- The files may need some validating, but currently this should not need testing. The only testing would be in checking how the game reacts to more than four ships, but this only applies if the limit is actually raised. If the limit is kept at 4 then nothing should be affected in any way whatsoever, at least if there are any effects just by including these files alone then it would probably need to be rectified.
Having said all that...
Once you have some "final" versions for this, I think it would be good if players would test it with COMPANION_MAX still set to 4 to see if everything still behaves "as normal". If it does, then hopefully we can set it to 8 instead and have that as the new Build Default.
That'll be cool! - Thus, the attached download includes only the changes to functions which loop through the ships. It does not increase the limit by itself, only allows for it; this is done by changing COMPANION_MAX, which is in Program\Characters\characters.h - set this to your heart’s content. There are other files I have modified which will facilitate more than 4 ships, but they will be listed separately.
- Note that this also applies the same change to function loops relating to officers, in that OFFICER_MAX has also been applied. This will most likely go unused but it is there in case anybody cares to use it, and it also makes things simpler for people like me because I can tell at a glance that it is for officers, not companions. As with COMPANION_MAX, it requires this setting to be applied in characters.h (failing to do this will result in a lot of problems) - default is 4, best to leave it that way for now.
- Please bear in mind that there are many story modes and quests which require attention. Some of them are not configured to look past the first four ships so there could be areas which won’t work unless a ship is moved. For example, if there is a check for contraband then there is a possibility that such would not be found on ships in the fifth slot or higher. It is also possible for some to believe the player has the maximum number of ships if the first four slots are occupied.
Interfaces for Increasing Fleet Limit
- Priority: High
- Status: Work-in-Progress
- Intention: Build
- Filename: CompanionMax - Interfaces.7z
- Last Edit: 16:00, 11th May
- Ship interface - Adds two buttons to switch the companion offset so that the next four ships can be displayed. This is rudimentary at the moment and requires work. I also intend to do the same for the shipyard interface.
- Ship transfer interface - Empty slots are now being displayed. It has also been configured so that two companions may be selected and even the player to be selected on the right, thus allowing companions’ passenger lists to be accessible. Again, this is in a fairly immature state at the moment and I have been having issues with berthed ships being randomly sunk. Selecting active ships doesn’t seem to be much of an issue but I do advise caution if selecting a berthed ship.
New Passenger Transfer Interface
- Priority: Medium
- Status: Work-in-Progress
- Intention: Build
- Filename: TransferInterfaces.7z
- Last Edit: 22:00, 11th May
- Forum Discussion: [link]
- Screenshot: [link]
- A brand new interface for use when transferring passengers between the player’s ships.
- Specific features...
- Supports transfers where a companion is selected first
- Officers and captives in the passenger list are labelled
- Officers have icons denoting their role
- Their role can also be changed here
- Skills summary has been activated
- This currently requires substantial testing and debugging. It is currently buggy in respect of transferring the captain; due to this, it is not possible to transfer the captain while the sea can be seen. However, it works flawlessly with officers.
- By default the main interface leads to the original one which does not actually support companion-to-companion transfers. As such, the attached transfer_main.c file is instead pointing to the new ones, although ransack_main.c will still use the originals (because it is currently not compatible while capturing ships, for the above reason). I’m not entirely sure, but it might be the case that a new game is required in order for the new interface to be loaded in this manner (either that or the save file or the game memory will need hacking).
Ship Speed & Turn on Transfer Screens
- Priority: N/A
- Status: Final
- Intention: Build
- Filename: SpeedTurn.7z
- Last Edit: 15:30, 6th May
- Screenshot: [link]
- This simply adds the icons and stats for the ships’ speed and turn on the transfer or ransack screen.
Boarding Loot Crash Fix
Reinforced Hull Upgrade - Calibre Fix
- Priority: Low
- Status: Stable
- Intention: Build
- Last Edit: 04:00, 14th May
- Forum Discussion: [link] [link]
- The reinforced hull upgrade is supposed to increase the ship’s cannon calibre by one, but due to an error this does not occur.
- Note that if an existing ship already has the upgrade then it will not be possible to increase the calibre because the upgrade cannot be removed. However, if you buy or capture a new ship and it has the upgrade applied then it will be able to use the higher calibre. In other words, if the ship exists with the upgrade before making the change, it’s too late (unless you force it at the console).
- The fix is as simple as adding stats to _char.ship.maxcaliber in KB_routines.c as below...
Code:void applytunupcaliber(ref _char, string _improvement, int inc) { ... if (cal != -1) { cal=cal + inc; _char.ship.stats.maxcaliber = Cannon_Calibers[cal]; } }
- The shipwright also requires a fix so that those randomly receiving the upgrade correctly apply it.
In ships.c, add this just before the loop on line #300...
Code:arShip.MaxCaliber = refShip.MaxCaliber
Rebalanced Upgrade Costs
- Priority: Low
- Status: Work-in-Progress
- Intention: Build
- Filename: RebalancedUpgrades.7z
- Last Edit: 18:45, 15th May
- The prices for ship upgrades have been rebalanced. I felt they were costing way too much in some cases, and too little in others. Quite frankly, they were very erratic. I believe these new values are much more appropriate. This also applies the calibre fix.
- Currently the changes are made to KB_routines.c alone and this should not be the case, they need to be properly applied to InternalSettings.h as well and will be done in due course.
- I would also like to hear feedback on merging the two gun upgrades together while moving the calibre upgrade off the hull upgrade onto one of them.
Skip Equip
- Priority: Low
- Status: Work-in-Progress
- Intention: Personal
- Filename: SkipEquip.7z
- Last Edit: 17:00, 11th May
- This adds a button to the main inventory screen which allows the player to toggle a weapon for auto-equipping. At present it will work on anything which is in the inventory, but will only really affect weapons and armour.
- If for example a blade is set to “OFF” then upon pressing either “1” or the auto-equip button that item will be skipped. I find this useful because I love to use a boarding axe, but if I accidentally hit the equip button then it will change if I have a “better” blade.
- Note that, for example, a “fine” weapon is essentially a different weapon to the same one if it is “average”, so the setting would therefore need to be applied individually.
- This works as intended, but caution is advised because it has been suggested that this could prevent NPCs being properly equipped. I have actually seen enemy crew members repeatedly punching my boarders in the face, so this could indeed be an issue (not that I care, they can punch by bosuns all day long if they like since my officers have muskets). I intend to apply a separate attribute to check the setting, which would avoid any such problems altogether.
- I would like to have this in a good enough condition to be useful for the mod, but at the moment that is not the case.
Increasing the Maximum Skill
- Priority: Low
- Status: Unstable
- Intention: Build
- Filename: SkillMax.7z
- Last Edit: 17:00, 11th May
- This will properly display the skill values on the character and officer screens should the SKILL_MAX setting in characters.h be set to 20.
- This does not in itself increase the limit. The SKILL_MAX setting has been applied in both files where it should have been done in the first place, with the duplicate #DEFINE being removed. This has not been tested in respect of increasing the limit, but so long as it remains at 10 then the changes will not actually do anything so there shouldn’t be any testing to do unless it is indeed changed. There may be other files which require attention, I will deal with those should there be a necessity.
- I’ve marked this as “build” but I am not suggesting to increase it, at least not right now... this is just for putting the changes in place in case anybody does want to alter it (like with companion/officer max).
- Marked as “unstable” due to potential stack errors if increasing the actual limit. Simply applying the variables is fine but raising the limit will likely be problematic in some places. I’m not sure, but in hindsight I think that whatever the problem is it might actually be more to do with increasing the officer limit - see below.
It’s working fine for me now, so I dunno.
Increasing the Officer Limit
- Priority: Low
- Status: Unstable
- Intention: Personal
- Last Edit: 04:00, 12th May
- The companion max files have applied the same method to officer limits. Therefore, if you were to change the OFFICER_MAX setting (assuming you have set this, which you should have if you have downloaded the companion files else the game won’t work), then you might find that by recruiting an officer while you already have 3 active will cause them to be added to the list. Generally speaking the interface doesn’t support this, but you will be able to swap them around the first few slots using the passenger list.
- While the officer icons will be displayed, those in the fifth slot or higher do not have a texture for some reason so they appear blank. I don’t know why that is, hopefully I’ll sort this out.
- It would be immensely useful if people could test this. While there are no intentions to increase the limit, any feedback would at least be able to be looked at and other modders might also consider doing so.
- Marked as “unstable” due to potential stack errors if increasing the actual limit. Simply applying the variables is fine but raising the limit will likely be problematic in some places.
Save/Load Interface
- Priority: N/A
- Status: Final
- Intention: Build
- Filename: SaveLoad.7z
- Last Edit: 19:30, 15th May
- This alters the behaviour of the movement keys. I changed this because I was getting annoyed with not being able to navigate the saves with ease, and I feel that it is now better than it was before.
Miscellaneous Functions
- Priority: Low
- Status: Stable
- Intention: Personal
- Last Edit: 17:00, 11th May
- Random functions which could be included in the build (some may already be in my files)...
Code:int GetNotCaptivePassengerNumber(ref _refCharacter, int findCharacterIdx) { int psgQuant = GetNotCaptivePassengersQuantity(_refCharacter); int cn; ref cr; for(int i=0; i<psgQuant; i++) { cn = GetNotCaptivePassenger(_refCharacter,i); if(cn==-1) break; cr = GetCharacter(cn); if(findCharacterIdx==sti(cr.index)) return i; } return -1; } int ChangeNotCaptivePassenger(ref _refCharacter, int idx, int psngIdx) { int retVal = GetNotCaptivePassenger(&_refCharacter,idx); if(idx>=0) { string PsgAttrName = "id"+(idx+1); _refCharacter.Fellows.Passengers.(PsgAttrName) = psngIdx; Characters[idx].passenger = true; if (CheckAttribute(&Characters[psngIdx], "passenger")) DeleteAttribute(&Characters[psngIdx], "passenger"); } return retVal; } int RemoveNotCaptivePassenger(ref _refCharacter, ref _refPassenger) { int i; RemoveOfficersIndex(_refCharacter,sti(_refPassenger.index)); int PsgQuantity = GetNotCaptivePassengersQuantity(_refCharacter); int psgNum = GetNotCaptivePassengerNumber(_refCharacter,sti(_refPassenger.index)); if(psgNum==-1) return PsgQuantity; aref tmpRef; makearef(tmpRef,_refCharacter.Fellows.Passengers); string inPsgAttrName,outPsgAttrName; for(i=(psgNum+1); i<PsgQuantity; i++) { inPsgAttrName = "id"+i; outPsgAttrName = "id"+(i+1); tmpRef.(inPsgAttrName) = tmpRef.(outPsgAttrName); } outPsgAttrName = "id"+PsgQuantity; DeleteAttribute(tmpRef,outPsgAttrName); PsgQuantity--; tmpRef.Quantity = PsgQuantity; if (CheckAttribute(_refPassenger, "passenger")) DeleteAttribute(_refPassenger, "passenger"); // KK for(i = 0; i < 10; i++) { string skillName = GetSkillName(i); ResetPartySkill(_refCharacter, skillName); } return PsgQuantity; }
Code:bool IsAnOfficer(ref refShip, ref refChar) { if(CheckAttribute(refChar,"index")) { int indChar = sti(refChar.index) if (indChar > 0) { for (i=1; i<OFFICER_MAX; i++) { if (GetOfficersIndex(refShip,i) == indChar) { return i } } } } return false } void MakeOfficersCaptive() { for (i=0; i<GetNotCaptivePassengersQuantity(refShip1); i++) { ref refChar = GetCharacter(GetPassenger(refShip1,i)) if (IsOfficer(refChar)) { if (CheckAttribute(refChar,"prisoned")) { if (refChar.prisoned == "1") { refChar.chr_ai.group = refChar.prisoned } } refChar.prisoned = true } } } void MakeOfficersFreed() { for (i=0; i<GetPassengersQuantity(refShip1); i++) { ref refChar = GetCharacter(GetPassenger(refShip1,i)) if (IsOfficer(refChar) && refChar.chr_ai.group == "0") { refChar.chr_ai.group = "player" refChar.prisoned = false } if (IsOfficer(refChar) && refChar.chr_ai.group == "1") { refChar.chr_ai.group = "player" } } }
Spawning a Random Officer
- Status: Final
- Intention: Personal - Cheat
- Last Edit: 18:00, 11th May
- Suffice to say, this spawns a random officer in front of the player.
- Simply add this to the bottom of the final function in console.c and then hit F12...
Code:CreateOfficerType(GetRandomOfficerType(),rand(SKILL_MAX))
For clarity, the following have been recently changed or added...
Rebalanced Upgrades - I uploaded the original file by mistake, updated. (15th May)
Companion Max - A few unoriginal and irrelevant files crept in there, updated. (15th May)
Calibre upgrade fixed (14th May)
Transfer/Ransack screens displaying the speed and turn for the ships - added. (13th May)
CompanionMax files updated. My “original files” are not always so - seems that I replaced Screwface with Pieter’s dodgy version.
I have also found a fair number of files which did not have OFFICER_MAX applied (again, the stories/quests have been skipped for now). (12th May)
Maximum officer limit may now be increased, but this is entirely untested and should be used with extreme caution. (12th May)
Mostly edited over the course of tonight. Check again if you looked earlier. (00:30, 12th May)
Attachments
-
SkillMax.7z14.7 KB · Views: 228
-
SkipEquip.7z42.1 KB · Views: 199
-
CompanionMax - Interfaces.7z13.9 KB · Views: 233
-
TransferInterfaces.7z17.6 KB · Views: 232
-
Compilation.7z101.3 KB · Views: 224
-
SpeedTurn.7z14.3 KB · Views: 224
-
RebalancedUpgrades.7z4.2 KB · Views: 211
-
CompanionMax.7z302.4 KB · Views: 207
-
SaveLoad.7z12.8 KB · Views: 202
Last edited: