[script] Improved Kha'ak 2: The Revenge [Updated: 2013.05.17]

The place to discuss scripting and game modifications for X³: Terran Conflict and X³: Albion Prelude.

Moderators: Moderators for English X Forum, Scripting / Modding Moderators

Post Reply
TechSY730
Posts: 115
Joined: Tue, 26. Jul 16, 02:51
x3ap

Post by TechSY730 » Sat, 13. May 17, 22:05

Version r7:
* Fixes a freeze that could occur if an egg tries to hatch when the number of wild Khaak is already at its limit
* The game should automatically pick up the fix before it triggers the next latent freeze, but if it doesn't, click the "reset egg hatching scripts" option in the configuration menu.

ImprovedKhaak2_IK2_r7_TechSY730_hack.zip:
<Link removed because this is, yet again, broken... :oops:>


I don't think this fixes the crash that can occur when killing eggs, but at least this is one issue down.
Last edited by TechSY730 on Tue, 1. Aug 17, 03:24, edited 1 time in total.

FriendlyFirePhoenix
Posts: 90
Joined: Tue, 14. Feb 17, 10:06
x3ap

Post by FriendlyFirePhoenix » Wed, 17. May 17, 06:25

@TechSY730 I haven't had much time to play in the last week. Will get onto trying r7 as soon as I can. I didn't get a single crash after the 3 in a row I reported despite repeating the behaviour another 10 times or so. That was running r5. Eventually I left that 'scenario' behind and continued with my game.

So it looks like maybe the crashes I did see were a very amazing coincidence. I will keep playing with r7 when I get more time and keep my eyes open. Thanks for the updates too. They are much appreciated.

TechSY730
Posts: 115
Joined: Tue, 26. Jul 16, 02:51
x3ap

Post by TechSY730 » Sun, 25. Jun 17, 04:49

Version r8:

New Features:
* Wild Kha'ak now wander to other sectors occasionally, instead of staying in their birth sector for their entire lives
> You can adjust the chance they will do so in the new section "Wild Kha'ak..." in the options menu.
>> Chances are out of 10000 instead of 100, because even 1% proved to be too often
> There is some degree of organization, wild Kha'ak will be more likely to wander if another ship near it is wandering, and if that ship is bigger than it, it will escort it
> They will (usually) only wander to a new sector if there are enough other Kha'ak left over to guard eggs and enough wild Kha'ak in the universe total
> For this feature to apply to existing savegames for an upgrade from r7 or before, you will need to select the "Reset fight scripts" option in the Debugging options in the options menu
> Balance of the default wandering rates is experimental; let me know if you think it is too often or too rare

* The self-upgrade and reset egg laying/hatching option logic will now also reset player ships/eggs

* The "decorative" eggs spawned when creating a hatchery (there so the hatchery maintains a unique appearance of a lot of eggs, much more than the normal caps) are no longer "stillborn", they can hatch now (with 3x the gestation time, so the deluge of eggs doesn't overwhelm the player early on)
> "Decorative" eggs do not count towards the total egg counts.
> For this feature to apply to existing savegames for an upgrade from r7 or before, you will need to select the "Reset egg hatching scripts" option in the Debugging options in the options menu
>> A word of caution, when upgrading from r7 or below using the method above, "decorative" eggs in the hatchery will start hatching with normal gestation time, not 3x. This is because by the time the eggs have finished being created, whether it was a "decorative" egg or not has been lost, so it is too late to tell retroactively.
> The queen, when in the current hatchery, is also able to replenish hatched "decorative" eggs (these eggs will also have the 3x gestation time and not count towards the egg type caps)

Balance tweaks:
* Reduced enemy scan ranges to less absurd values (some of them were up to 150km long, now they are down to more reasonable 30-80km, depending on the context, which is still a long ways, but no longer crazy long)

Bug fixes:
* Fixed Kha'ak ships getting "stuck" if their current target docked at a station or just got way out of its range
* Fixed Kha'ak ships rarely getting upgrades (Engine tuning, rudder optimization, etc)
> This was because the check whether to upgrade (only apply the ship not being mobile) was done against the ship building the new ship, not the ship being built. When the builder is an egg, most of the time eggs aren't mobile, so the check would always fail even though what is hatching is mobile
> This will not apply retroactively to existing ships, but with the new wild wandering logic, over time, the ships will naturally cycle out as they get killed

Planned future improvements:
* Make the queen cheat less, but still keep the original "spirit" of the fight
> The queen will still "cheat", but will do so a bit less blatantly

ImprovedKhaak2_IK2_r8_TechSY730_hack.zip:
<Link removed because this is, yet again, broken... :oops:>
Last edited by TechSY730 on Tue, 1. Aug 17, 03:24, edited 2 times in total.

FriendlyFirePhoenix
Posts: 90
Joined: Tue, 14. Feb 17, 10:06
x3ap

Post by FriendlyFirePhoenix » Sun, 25. Jun 17, 08:09

Nice update TechSY730, that's a big one! I've been using r7 for a while with no observed problems, though I haven't gone queen hunting or anything like that. Installing r8 now for fun and profit!

Iceciro
Posts: 40
Joined: Sat, 23. Jul 11, 14:37
x3tc

Post by Iceciro » Sat, 15. Jul 17, 20:56

Hey I've got Readtext errors in the IK options now:

Readtext 8974-152

Readtext 8974-155

Readtext 8974-156

readtext 8974-602

I don't see either of them in the t file itself, either.

TechSY730
Posts: 115
Joined: Tue, 26. Jul 16, 02:51
x3ap

Post by TechSY730 » Wed, 19. Jul 17, 02:53

Version r9:

Bug Fixes:
* Fixes readtext issues in the settings
> Turns out I forgot to include the updated t file in my last version. :oops:

Balance Tweaks:
* Reduced default wander chances to about 0.75x (except for huge ships, which were reduced by a factor of 3)
* Halved chance that ships will bypass population checks to suppress wandering behavior
> The defaults I had were too aggressive, leading to too much attrition and small ships wandering out alone with not much happening
* Significantly increased chances of small ships to join ships already wandering Kha'ak
> When bigger ships wander, small ships should now escort them more consistently, and small ships more "swarmy" than just going out by themselves to die
* For Kha'ak already wandering, improved responsiveness to move onto a new planet

ImprovedKhaak2_IK2_r9_TechSY730_hack.zip:
<Link removed because this is, yet again, broken... :oops:>
Last edited by TechSY730 on Tue, 1. Aug 17, 03:24, edited 1 time in total.

SirDeathwalker
Posts: 385
Joined: Fri, 6. Aug 10, 03:15
x4

Post by SirDeathwalker » Wed, 19. Jul 17, 08:49

Looks interesting, I had a small contribution to the original version of this (it was my idea to be able to change the ships the swarm uses)

I Encouraged him to make this mod to give me a 'random' force wreaking havoc on the verse. I like using Jorkins B5 Shadow vessels for the swarm. (Black on black crab/spider make a terrifying force (had to keep the numbers low or they became way OP), I just need a way to replace the engine sound with the 'scream' from the series)


I would like to watch this MOD to butt heads with the revamped version of Litcube's Revelation.... the battles should be epic, though the numbers will need to be tweaked upwards to make it more even.

Especially if you can get it to occur where the Terrans are Attacking ( a four-way 'purge' of a sector), would also be even more interesting if we can get the Yaki Armada to also attack at the same time (or even delayed a bit)


Glad to see this one lives...

Iceciro
Posts: 40
Joined: Sat, 23. Jul 11, 14:37
x3tc

Post by Iceciro » Sat, 29. Jul 17, 20:54

Thanks for that, no more readtext issues!

Now I'm just having issues with getting my Military Transport to lay Kha'ak eggs... it just sits there with Unknown Command! in the ship commands list after I push the button.

TechSY730
Posts: 115
Joined: Tue, 26. Jul 16, 02:51
x3ap

Post by TechSY730 » Tue, 1. Aug 17, 03:36

Version r10:

Bug fixes:
* FIXES A CRITICAL ISSUE THAT CAUSES ALL EGG LAYING SCRIPTS TO FAIL AND TERMINATE
> You NEED to use the "Reset egg laying scripts" option in the config menu to unbreak the queen and any wild Kha'ak (existing swarming Kha'ak are a lost cause, but those should cycle pretty quickly)
> I made a critical mistake in the utility script that queries ship size. (Why did XStudio's warning about uninitialized variables not catch this? :evil:)
> The reason I didn't catch this earlier is that this "brokeness" occurs after the check for "are there any egg slots left?". This means the script idled fine until there was room to lay an egg, and then promptly died before doing so. In my current game, egg counts are almost always full.
* Fixes the player egg laying command to be represented by "Unknown command!" instead of the proper "Lay Kha'ak Eggs"
> Turns out XStudio corrupts the "command" field if it was pointing to a COMMAND type object defined in a t file (as opposed to a string), so I had to fix that using the in game editor.
>> As a side effect, some of the scripts have been marked as AP version scripts, but they should still work fine in TC

New features:
* You can now set the wild wandering chances to -1 to reset them to the defaults.

Known Issues:
* The command displayed for eggs is "Default Combat" or "Idle" or similar, not "Hatch into Kha'ak ship".
> If you go into the command console (if the game will let you for that ship type), then you will see the right command under "additional commands"
* If you reissue (with or without clearing the slot first) the "Lay Kha'ak eggs" command to your ship, you will lose all progress to your next egg.

ImprovedKhaak2_IK2_r10_TechSY730_hack.zip:
https://drive.google.com/open?id=0B80_E ... UhmZVVzSWc
Last edited by TechSY730 on Tue, 1. Aug 17, 05:19, edited 3 times in total.

Iceciro
Posts: 40
Joined: Sat, 23. Jul 11, 14:37
x3tc

Post by Iceciro » Tue, 1. Aug 17, 04:01

I would just like to say, thank you TechSY730 for being so response on this script for an ancient game! I really do appreciate you fixing the bugs I've tagged, you're awesome.

TechSY730
Posts: 115
Joined: Tue, 26. Jul 16, 02:51
x3ap

Post by TechSY730 » Tue, 1. Aug 17, 05:22

Sorry for the quick release, but just had to throw in some last minute improvements. :)

@Iceciro No problem. I am a programmer by trade, and I like extending functionality, fixing bugs, and optimizing for fun.

Bug Fixes (from r10):
* FIXES A CRITICAL ISSUE THAT CAUSES ALL EGG LAYING SCRIPTS TO FAIL AND TERMINATE
> You NEED to use the "Reset egg laying scripts" option in the config menu to unbreak the queen and any wild Kha'ak (existing swarming Kha'ak are a lost cause, but those should cycle pretty quickly)
> I made a critical mistake in the utility script that queries ship size. (Why did XStudio's warning about uninitialized variables not catch this? :evil:)
> The reason I didn't catch this earlier is that this "brokeness" occurs after the check for "are there any egg slots left?". This means the script idled fine until there was room to lay an egg, and then promptly died before doing so. In my current game, egg counts are almost always full.

Bug Fixes:
* Fixed a display bug in egg hatching remaining time where 1 hour left would render as "0:60" instead of "1:00"

Balance Tweaks:
* After ship has been taken down to 1 HP, you will no longer be able to progress in laying the next egg until you have repaired the ship beyond <self damage amount per tick>
> No more repairing marginally to get "free-ish" progress.
* When player Kha'ak ships hatch, they are assured to get at least some shields and weapons (1/4 of the turret's capacity, 1/3 of the shield capacity), so they aren't completely useless. (And getting Kha'ak weapons "legit" is enough of a pain as it is without total RNG)
> Exception, if the ship has only 1 shield slot (regardless of the shield's size), then there is a chance it will spawn with no shield.
> Reminder, in a previous version, I made it ships can no longer kill themselves laying eggs; this is still the case.

Known Issues:
* The command displayed for eggs is "Default Combat" or "Idle" or similar, not "Hatch into Kha'ak ship".
> If you go into the command console (if the game will let you for that ship type), then you will see the right command of "Hatch into Kha'ak ship" under "additional commands"
* If you reissue (with or without clearing the slot first) the "Lay Kha'ak eggs" command to your ship, you will lose all progress to your next egg.

ImprovedKhaak2_IK2_r11_TechSY730_hack.zip:
https://drive.google.com/open?id=0B80_E ... U5qV2dQMEE

FriendlyFirePhoenix
Posts: 90
Joined: Tue, 14. Feb 17, 10:06
x3ap

Post by FriendlyFirePhoenix » Sat, 19. Aug 17, 15:55

Hi TechSY730 - Reporting another crash. Same cause as last time. I killed a Kha'ak laser tower medium egg and the game crashed. I killed about 5 other medium eggs earlier and there were no issues. Sector was Asteroid Belt. This was a few hours into a new game start using R11.

All the eggs I killed where there was no crash exploded in the normal way a thing dies in X3. The one that caused a crash went invisible at around the 0 - 2% health mark, my shots hit nothing for a while, then there was the expected explosion, then crash a split second later.

Must be annoying to get this report, especially as I have no real new information from last time. I'll try again a couple of times tomorrow to try and repeat it.

UPDATE: Tried again and caused a crash in the same way 3 more times. Sometimes the medium egg dies, the model stays visible for a few seconds afterwards, then crash. Some times the medium egg dies, the model stays visible for a few seconds afterwards then disappears then game keeps going.

My last run, I killed two medium eggs, the model stayed visible for a few seconds afterwards, game kept going, then two wares appeared on my radar. 2 of each ware in the two positions, Different IDs to the eggs, no name, worth no credits, S size, blank in every way, untargetable and in the exact positions the two eggs were at. I left the system heading south for a Terran plot mission, at Circle of Labour 5-10 minutes later, the game crashed.

meppo
Posts: 29
Joined: Tue, 13. Oct 15, 02:45
x4

Post by meppo » Thu, 24. Aug 17, 13:01

are there any working xenon related mods for AP like this?

FriendlyFirePhoenix
Posts: 90
Joined: Tue, 14. Feb 17, 10:06
x3ap

Post by FriendlyFirePhoenix » Thu, 24. Aug 17, 13:28

@meppo I'd suggest taking a look at Military Base Response Revamp. Along with updating this script, TechSY730 has also updated that one. It has organised Xenon invasions along with invasions by all the other races.

meppo
Posts: 29
Joined: Tue, 13. Oct 15, 02:45
x4

Post by meppo » Thu, 24. Aug 17, 22:45

all right, thanks
also is there a way to turn off kha'ak P2P jumping, i don't think i like it all that much

meppo
Posts: 29
Joined: Tue, 13. Oct 15, 02:45
x4

Post by meppo » Thu, 24. Aug 17, 23:48

like shouldn't this have an on/off option? i actually cant tell if i turned it on or off and thousands of kha'ak just phase towards me

http://i.imgur.com/9ElwG0q.png

SirDeathwalker
Posts: 385
Joined: Fri, 6. Aug 10, 03:15
x4

Post by SirDeathwalker » Fri, 25. Aug 17, 02:03

there used to be a setting in game to modify that behavior in AL settings for this mod
there was one for the swarm and a separate setting for wild.
main page for the mod's AL life setting

(its one that wont become available until after second save and re-launch as I recall)

meppo
Posts: 29
Joined: Tue, 13. Oct 15, 02:45
x4

Post by meppo » Fri, 25. Aug 17, 07:02

no i know that, i see the swarm stuff and wild settings, p2p jumping is just there without an on/off switch, i just dont know if i have it turned on or off

SirDeathwalker
Posts: 385
Joined: Fri, 6. Aug 10, 03:15
x4

Post by SirDeathwalker » Fri, 25. Aug 17, 13:22

it should say enabled or disabled next to the item swarm or wild, unless the update broke it. Clicking on the item switches it.

meppo
Posts: 29
Joined: Tue, 13. Oct 15, 02:45
x4

Post by meppo » Fri, 25. Aug 17, 22:04

i guess the update broke it then. because P2P jumping says nothing when i click on it or not

Post Reply

Return to “X³: Terran Conflict / Albion Prelude - Scripts and Modding”