[SCRIPT] Military Base Response revamp v2.16 [2011-10-27]

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

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

ThisIsHarsh
Posts: 1135
Joined: Sun, 19. Oct 08, 18:46
x3tc

Post by ThisIsHarsh »

A quick question: does anyone successfully (or not) use Race Response Fleets and/or Improved Races with this plugin? They should be compatible, I was about to test to make sure, but of course it would be easier if someone else could just tell me :) .
There are 10 types of people in the S&M forums - those who understand binary, and those who don't.

Black holes are where God divided by zero.
Troubleshooter11
Posts: 728
Joined: Sat, 8. Nov 08, 02:51
x4

Post by Troubleshooter11 »

I finally got a good set of working scripts and tweaks to weapons/ships etc. Im afraid ill pass on testing that. :o
Hartzaden
Posts: 209
Joined: Thu, 26. Mar 09, 18:26
x3tc

Post by Hartzaden »

ThisIsHarsh wrote:Yeah all ships can be used. Up until recently I was using SRM, which has Cadius's Xtra ships integrated, and saw plenty of those ships flying around. Only works with Rearguard ships though. For normal military ships to use new models you need a mod that changes the jobs to use them. Again, I think SRM's optional jobs mods use the new ships.
humm so i have to push the split/terrans/teladi into a corner or invade one of them before i see any X-tra ships ingame. this is good to know before i try. now the real question is can i push them into a corner with only 3 pirate M2s and a pair of M1s
Troubleshooter11
Posts: 728
Joined: Sat, 8. Nov 08, 02:51
x4

Post by Troubleshooter11 »

ThisIsHarsh wrote:
Troubleshooter11 wrote:A possible suggestion would be to make pirate bases act as military bases, and have them invade sectors. However i understand if you think that comes too close to Pirate Guild or IR
Yeah I'd rather leave Serial Kicked to the pirate side of things. He's working on sector takeover for Pirate Guild and we're trying to keep things compatible, so should go alongside this plugin well.

Fair choice :) just noticed that without any help from scripts the pirate sectors get overrun in mere hours. Pirate Guild should counter that nicely.
ThisIsHarsh
Posts: 1135
Joined: Sun, 19. Oct 08, 18:46
x3tc

Post by ThisIsHarsh »

Hartzaden wrote:
ThisIsHarsh wrote:Yeah all ships can be used. Up until recently I was using SRM, which has Cadius's Xtra ships integrated, and saw plenty of those ships flying around. Only works with Rearguard ships though. For normal military ships to use new models you need a mod that changes the jobs to use them. Again, I think SRM's optional jobs mods use the new ships.
humm so i have to push the split/terrans/teladi into a corner or invade one of them before i see any X-tra ships ingame. this is good to know before i try. now the real question is can i push them into a corner with only 3 pirate M2s and a pair of M1s
Apologies here, I think I made a copy-paste mistake in my original post. So to clarify:

If you have a jobs mod installed, you will see the new ship models flying around normally, whether or not there are any threats.

With or without a jobs mod, you will see the new ships as Rearguard ships spawned by this plugin when there aren't enough normal military ships to respond to a threat or invasion.

Hope that clarifies things.
There are 10 types of people in the S&M forums - those who understand binary, and those who don't.

Black holes are where God divided by zero.
Scoob
Posts: 11180
Joined: Thu, 27. Feb 03, 22:28
x4

Post by Scoob »

Hi,

Not sure if I've spotted a slight bug or not, I'll try to explain...

I've been using MBRV in all of my games for some time now without issue. However recently the new 2.10+ versions have caused me problems. I've tested with with several mod and script variations and always seem to get the same result:

Starting a NEW game with MBRV enabled see my game work fine for a little while. Then, usually soon after a "x has taken over sector y" message my next gate traversal to another sector, either via direct travel or jump drive, results in a game freeze at the point you'd expect to appear in the new sector - screen goes black.

I've tried this several times now, started my game, configured relations to how I like them, then set to doing "stuff" while the universe does it's thing...I usally just go around scavenging and the like early game.

Anyway, this just happened to me once again so I disabled MBRV in game and uninstalled. Game still crashed.

Starting again (same start) but without MBRV installed has seen my game working fine for several hours now.

Is there possibly something wrong with the new sector takeover code, maybe only affecting new starts? Sorry I cannot give further info, my game has several scripts installed (my usual set, nothing new) but only the removal of MBRV sees the error go away.

To recap: it appears that something goes wrong soon after the first sector is taken over by any race in my FRESH START games.

Cheers,

Scoob.
ThisIsHarsh
Posts: 1135
Joined: Sun, 19. Oct 08, 18:46
x3tc

Post by ThisIsHarsh »

A script error almost always results in an infinite loop game freeze, rather than lockup upon entering a sector. Do any sounds play in a loop while the game is frozen? Is it when you enter the recently conquered sector, or any sector?

Are you running any mods that add new ship models to the game? One possibility is a broken ship model. So MBR is sending a new ship model to invade, then when you go into the sector it crashes on trying to load the model.

Out of interest, can you select and look at the sector in the map before you fly into it? I ask because I had a similar symptom, where the game would just stop at a black screen when entering some specific sectors, but also I could not select the problem sector(s) in the map view.

One thing you could try is enable debugging in the config menu. As well as creating a log file (which you could send to me if you're so inclined), it will turn on infinite loop detection. It will slow your game down a bit (not that much), but will protect against infinite loop errors.
There are 10 types of people in the S&M forums - those who understand binary, and those who don't.

Black holes are where God divided by zero.
Scoob
Posts: 11180
Joined: Thu, 27. Feb 03, 22:28
x4

Post by Scoob »

Hi,

Thanks for your reply.

Yes, I've seen this sort of issue too with broken ships etc. I'd been trying Roguey's Mod the first time I got this so assumed that was at fault. I next tried a game with just scripts (rather than mods) and same happened, finally I tried the latest Ship Rebalance Mod and got the error. It was only after removing MBR (but keeping Ship Rebalane + several other scripts) that the issue went away.

The very first time I got the crash was:

I had a message sayer Emperor Mines had been taken by an Argon General. I'd not yet been to EM but had Cloudbase SW explored. I jumped to the South gate of CBSW then flew to EM & got the crash. This seemed consistant.

Reloading and playing around I found that flying through ANY gate saw the crash happen - I get no sound looping or anything.

When I have a moment I'll set up a new test bed game install & try out some of your suggestions.

Cheers,

Scoob.
ThisIsHarsh
Posts: 1135
Joined: Sun, 19. Oct 08, 18:46
x3tc

Post by ThisIsHarsh »

Did you happen to have the player recon uplink command running? This is the only script I can think of that would react to a change in player sector, though I still don't know how it could cause a crash.
There are 10 types of people in the S&M forums - those who understand binary, and those who don't.

Black holes are where God divided by zero.
Scoob
Posts: 11180
Joined: Thu, 27. Feb 03, 22:28
x4

Post by Scoob »

Hi,

The uplink would be set to whatever was default.

I just had another little play...

I've been running a Ship Rebalance Mod (with CMOD3) game perfectly stable for several hours. As a test I just installed MBR and loaded my current save.

I next enabled the race relation settings I like & clicked re-install. Flew around for a bit with not much going on - just flying randomly between sectors, no jump drive.

By pure chance I happened to get a message saying a neighbouring sector (Interworlds) was under attack, I was in Wastelands so changed course.

I entered the sector, it loaded ok, then promptly froze with a sound loop. this was all within 5 minutes of enabling MBR. I will try again but ensure that uplink is OFF.

Sorry but I'd not switched logging on yet, will next time.

Edit: Ok, I reloaded my save, enabled MBR again but this time ensured that uplink was OFF and debug was ON. I flew the exact route I did previously and, once again, Interworlds was being invaded (by paranid) just as I passed though Wastelands. I changed course again to head to Interworlds, entered the sector & NO CRASH...yet :)

Looks like you might be bang on re: the Uplink being the culprit - I will continue play...err, TESTING carefully ;)

Balls. No sooner do I post that and the game freezes once more. I'd docked and saved so will reload & see if it happens consistantly. Anything else you'd like me to try?


Cheers,

Scoob.
ThisIsHarsh
Posts: 1135
Joined: Sun, 19. Oct 08, 18:46
x3tc

Post by ThisIsHarsh »

Thanks for all this testing Scoob.

When it froze, did you have debugging enabled? If it's an infinite loop error and debugging was enabled, then that helps narrow it down, since there are very few places in the code that would not detect infinite loops.

Try this: In the menu enable debugging. Then hit "Uninstall", wait for it to finish, then hit "Install/update". Lets see if you still have problems. Plus that will definitely enable infinite loop detection for almost everything then (some stuff that's already running wouldn't otherwise enable infinite loop detection since it's set at the beginning of the script).
There are 10 types of people in the S&M forums - those who understand binary, and those who don't.

Black holes are where God divided by zero.
Scoob
Posts: 11180
Joined: Thu, 27. Feb 03, 22:28
x4

Post by Scoob »

Hi,

I loaded my game just prior to the freeze, made sure Debug was on (it was) and hit "Uninstall". The second this completed I got an incoming message alert - assumed it was just a "I'm done" type thing but no:

Infinite loop detected, script is terminated!

plugin.mbase.cfg.uninstall:227:1:0:5528003:-1: skip if not $isDebugging
RefObj: Null

Now maybe this is normal if you uninstall with debugging on.

I will re-install MBR and sit in Interworlds & see what happens - the ships that were duking it out are gone for the moment obviously.

Edit: I re-enabled MBR, waiting for a short while and the game still froze, no further messages and nothing in the log file I could identify as suss. Most odd.

Cheers,

Scoob.
ThisIsHarsh
Posts: 1135
Joined: Sun, 19. Oct 08, 18:46
x3tc

Post by ThisIsHarsh »

OK I tried running uninstall in my game with debug on - no infinite loop error. I've added a wait anyway for future versions. You could try running Uninstall a couple of times, hopefully there are less ships to loop through second time round.

Does the game still freeze if you hit Uninstall then don't hit Install/update, just leave it uninstalled? That would narrow it down yet further.

Also, as well as Uninstall try also hitting "Reset sector ownership", if you've got sector takeover enabled.

Hmmmm, like you say, most odd. I left the game running for nearly 24 hours yesterday, with everything enabled, and needless to say no freezes here, so this is puzzling me
There are 10 types of people in the S&M forums - those who understand binary, and those who don't.

Black holes are where God divided by zero.
Scoob
Posts: 11180
Joined: Thu, 27. Feb 03, 22:28
x4

Post by Scoob »

Hi,

Yes the game did still freeze despite running just the uninstall on another test.

It's odd as MBR has been rock solid stable for me until the sector takeover stuff was added. Possibly it's interacting badly with some other script, but I'm not using anything I've not used sucessfully with earlier versions of MBR.

I will run some more tests this eve. Is there any benefit from sending you the last few log entries after a freeze? Nothing lept out at me when reading them myself but what do I know eh? :)

I may try with invasions OFF but everything else as is just to confirm it's definately those invasions as I suspect.

Cheers,

Scoob.
Scoob
Posts: 11180
Joined: Thu, 27. Feb 03, 22:28
x4

Post by Scoob »

Hi,

Quick update:

I wondered if my crash in Interworlds was a timed thing rather than based on me being there. As I'd recreated my steps each time I thought it worth checking out.

If I revert to my save in Black Hole Sun and just SETA'd for a while. Clock starts at 05:55:00, then at 06:11:09 my game froze.

I reloaded, disabled ALL MBR stuff, saved, exited and uninstalled. Reloaded and SETA'd again and game still froze at around the same time.

I did the same for Salvage Claim Software and NPC Bailing Addon and they both froze also within a minute of 06:11:00.

One time my freeze coincided with a Kha'ak fleet jumping in to BHS, they arrived (in my view) fired a couple of shots & game froze. Linked? Dunno.

If I revert to an earlier save before I installed MBR then I get no freeze, but equally a rather dull universe.

Can't figure what's going on exactly, however I don't think uninstalling MBR fully removes things from a prior save.

Will keep testing.

Edit: Ok, so I reinstalled TC from scratch, patched it up, installed BP, installed my usual scripts plus MBR. Enabled MBR from the start and have had 3.5 hrs of trouble-free play with several sector take-overs reported. I'd recently heard about the Argon General taking Emperor Mines (Paranid had previously taken Cloudbase SW) while flying in Faded Dreams. I attempted to enter the West Gate and Freeze. Really not sure what the deal is here - I thought maybe a corrupt install but I've reinstalled everything from scatch. Gonna try to leave the sector by other means & see what happens.

Further update: I could exit Faded Dreams via the south gate (already explored) without issue. As a test I bought an M5 Octopus & sent it through the West Gate remotely. No Problem. I couldn't see anything obviously amiss in this sector, yet when I tried to enter I got the freeze & the sector never appears.


I used my M5 to remotely look around Contorted Dominion further and found something broken! There is a "Strong Arms Military Scorpion Sentinel" which has a pilot yet ship info shows:

Shield ???
Hull ???
Laser ???

Home Strong Arms HQ Thyn's Excavation

Tech Data:

Current Max Speed: ???
Acceleration: ???
Current Max Steering: ???
Current Cargobay: ???

All stats not listed appear to be ok.

There is a Strong Arms Escort Jaguar in the same place with the same issue.

*** Script Killing these two bugged ships sees me enter that sector myself without issue ***



Next problem is to find out what exactly created those two ships - they look like vanilla Corporate ships to me. I've seen other such corporate ships working correctly, so not sure what's different about these.

Just checked the ships debug info:

"Current Stack" lists:
1: !job.wing.protect prio=0
2: !ship.cmd.protect.std prio=0
3: !move.follow.template prio=0

The 2nd stack reads:
1.plugin.mbase.tkvr.spawn.sig prio=10000

Looks like this is an MBR takeover spawned ship, there's nothing in sector for it to follow though so I assume it's leader got killed.

Hope this info is of use


Cheers,

Scoob.
ThisIsHarsh
Posts: 1135
Joined: Sun, 19. Oct 08, 18:46
x3tc

Post by ThisIsHarsh »

You may be on to something there. plugin.mbase.tkvr.spawn.sig is the spawn respawn suppression script - if the ship spawns in a captured sector it is moved to a sector of its own race, if it fails to find a sector, then it is destroyed.

However, that script won't do anything if sector takeover is disabled. I take it your are indeed using the latest version of MBR?

So... when it has crashed in the past, you have had sector takeover enabled at one point, and at least one sector has been taken?

One thing to try is destroy the ships via Cycrow's cheat script, see if you can then enter the sector.

Perhaps the reason I haven't crashed when leaving the game running is because I haven't happened to enter a sector with one of these dodgy ships that the spawn suppression has either attempted to move or destroy.

I'll look more carefully at this. Thanks a lot for all your help and patience narrowing this down.
There are 10 types of people in the S&M forums - those who understand binary, and those who don't.

Black holes are where God divided by zero.
Varek Raith
Posts: 331
Joined: Thu, 23. Aug 07, 21:33
x4

Post by Varek Raith »

ThisIsHarsh wrote:You may be on to something there. plugin.mbase.tkvr.spawn.sig is the spawn respawn suppression script - if the ship spawns in a captured sector it is moved to a sector of its own race, if it fails to find a sector, then it is destroyed.

However, that script won't do anything if sector takeover is disabled. I take it your are indeed using the latest version of MBR?

So... when it has crashed in the past, you have had sector takeover enabled at one point, and at least one sector has been taken?

One thing to try is destroy the ships via Cycrow's cheat script, see if you can then enter the sector.

Perhaps the reason I haven't crashed when leaving the game running is because I haven't happened to enter a sector with one of these dodgy ships that the spawn suppression has either attempted to move or destroy.

I'll look more carefully at this. Thanks a lot for all your help and patience narrowing this down.
I am having the exact same issue.
I, however, have invasions completely disabled. I don't know why, but when I have MBR installed almost all corporate escorts that I've come across have been broken. I have to use the cheat menu to remove them or the game crashes when I enter the sector they are in.
ThisIsHarsh
Posts: 1135
Joined: Sun, 19. Oct 08, 18:46
x3tc

Post by ThisIsHarsh »

Update v2.10.2

:arrow: Updating: open config menu and hit "Install/update".

:arrow: "Install/update" will destroy the reported 'ghost ships'.

:arrow: Fixed respawn suppression bug causing these weird ghosts. Similar problem as I had with previous NPC Bailing Addon versions, where the signal script has broken behaviour if there are waits in the script.

:arrow: A huge thanks to Scoob for helping me narrow this down.

:arrow: Added a bit of compatibility with Improved Races for respawn suppression.

This fix will get rid of the ghosts and they won't come back. However, although this is a bug, I'm not sure it is the bug that has been causing crashes. When I finally detected them, I found I was in the same sector as a ghost, but no freeze whatsoever, so I remain dubious...

Please do let me know if this fixes the freezes or not. Fingers crossed!
There are 10 types of people in the S&M forums - those who understand binary, and those who don't.

Black holes are where God divided by zero.
ThisIsHarsh
Posts: 1135
Joined: Sun, 19. Oct 08, 18:46
x3tc

Post by ThisIsHarsh »

Forgot there is some stuff I was working on for the next feature included in there as well as the bug fix. Although not finished it works fine.

If you have 200 prestige points or more with your ally, then use ECS to comm one of their outposts to find out..
There are 10 types of people in the S&M forums - those who understand binary, and those who don't.

Black holes are where God divided by zero.
Scoob
Posts: 11180
Joined: Thu, 27. Feb 03, 22:28
x4

Post by Scoob »

Hi,

Glad my information was useful though I feel a bit daft for not attempting to remotely scout ahead into a bugged sector previously.

So, the crash when entering a sector with what we now know to be bugged ships present is fixed - I'll eagerly try that shortly as I deliberately kept my save prior to my manual fix.

Could the in-sector freeze I've experienced in my ealier game while SETAing be caused by the same thing? I.e. is it possible that a relocated ship could be relocated to MY sector? When experiencing this I've always had sector takeover on at some point, but not always when the crash has occured - is there some degree of delay here?

I'll download your update & post back any findings if I experience further game freezes.

Cheers,

Scoob.

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