[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: Moderators for English X Forum, Scripting / Modding Moderators

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

Post by TechSY730 » Wed, 2. Aug 17, 02:40

No, I haven't been able to reproduce it. It may be something that only triggers in XRMs loadouts.
But the script uses the built-in command "add default items to ship" to load up ships, so if he is seeing it for MBRR Paranid ships, I would expect that naturally spawning ships would be hitting similar issues.

I think I can add a workaround to check to see if the ship had at least some of the most powerful laser it can mount, and if not, give it a few of them.
But I just haven't had time until recently to be able to devote to this.

CloneSargaent
Posts: 68
Joined: Wed, 16. Jul 14, 19:27
x4

Post by CloneSargaent » Wed, 2. Aug 17, 14:07

Thanks for looking into my issue :) TechSY, but i might have figured it. There is a post on this thread on page 66 by risbosix, he attempted to put MBRR into XTC which already has integrated rrf and that caused ALL the MBRR ships to mount m3 class weapons. Unfortunately I didn't see this statement about MBRR on the main page XRM about XRM-AP(my setup that I'm having the problem with) before downloading MBRR:
MBRR is not necessary for XRM in Albion Prelude. AP includes its own race response system which XRM fully utilises
It never occurred to me that XRM-AP's rrf may be in conflict with MBRR so this may not be solvable problem. :(
Last edited by CloneSargaent on Thu, 17. Aug 17, 00:27, edited 1 time in total.

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

Post by TechSY730 » Thu, 3. Aug 17, 17:02

I am curious about what change in XRM causes loadouts from MBRR spawned ships to be so suboptimal. MBRR's ship spawning and loadout logic is completely standalone; I can't see how it would conflict.

Sadly, I don't play XRM, nor do I have any interest in installing it just to test this. But if anyone knows what is going on, I may be able to implement a workaround.

But as mentioned, on the main page, MBRR is sort of redundant with any mods that expand upon RRFs, so maybe this is no big loss. If you want the sector takeover functionality, there should be other mods that let you do that.

rhine770
Posts: 6
Joined: Sat, 24. Oct 15, 20:42
x3tc

Post by rhine770 » Wed, 16. Aug 17, 22:51

I also have CloneSargaent's issue and also have XRM (AP) installed. The problem seems to really only hit the Paranids. Exactly like Clone said, their M2s are popping into the sector with measly HEPTs. Every other MBRR faction's troops so far have equipped decent to pretty mediocre weapons for their fleets.

I have only a couple of scripts/mods with this installation, but I don't see how they could interfere too much: MARS, Yaki/Pirate Guild, XRM Phanon, a couple of minor scripts and TechSY's MBRR, and IR 2.0 (I heard I.R conflicts with MBRR because they do pretty much the same thing, but I wanted to see for myself, so I made a separate folder to test them. Apart from just making everything more chaotic I don't see any noticeable issues, yet.)

The reason I even considered merging those two, was because MBRR has a much more interesting and customizable invasion system compared to IR. I like everything else about IR, but IR's assault fleets only bother Xenon and Pirate sectors and often take them over and it's very annoying. Apart from the lame loadouts, though, MBRR's spawn fleets are causing mayhem here and there. It's cool to see the Boron invade a Split Sector and mess everything up for once. I'm not sure I'm going to keep this installed, though.

Does anyone have any recommendations on a better mod that has factions invade each other? Or at least where I could begin to modify the loadouts of MBRR's spawned ships, or keep IR's assault fleets but stop them from complete overrunning Xenon and Pirate sectors. One of the things I like about MBRR is that it allows you to disable factions from overrunning pirates. Really, that's a pretty understated feature.

CloneSargaent
Posts: 68
Joined: Wed, 16. Jul 14, 19:27
x4

Post by CloneSargaent » Thu, 17. Aug 17, 00:20

I haven't tested MBRR with XRMTC to see if happens with TC yet. But Rhine its most likely because it is in conflict with AP's built in RRF scripts. Which has killed any use RRF type scripts with AP without lag or major bug (which sucks imo). IR/IR2.0 and LV's RRF (for TC) are only other plugins I can think of, but they not as optimized as MBRR and XTC's RRF. Outside those 4, I have not seen a plugin that had invasions and/or an RRF that worked as intended.

rhine770
Posts: 6
Joined: Sat, 24. Oct 15, 20:42
x3tc

Post by rhine770 » Fri, 18. Aug 17, 05:51

Actually I think I fixed the issue. I don't know single lick of this code stuff so I had to "reverse engineer" (lol) a solution.

I was messing around with the script editor in game and decided to spawn myself a Paranid destroyer while using the "add default items to ship" command to outfit it. Lo and behold, the ship spawned with HEPTs.
I looked for an mbase script that created ships (mbase.spawn.create.ship.rand or something), and there was the same command outfitting ships. I had another mod using its own self contained script that decked out its ships with the most expensive weapons available to them so I added it in right before the "add default items..." command. Now, the new ships that spawn are using the best weapons XRM has to offer. The old ones with the crappy HEPTs are still around, but I believe that's because MBRR ships don't just vanish, they go back to their base.

I don't know anything else about this scripting business, though. I could easily be wrong. Also, I'm expecting my game to blow up soon since I combined MBRR with IR and XRM. It's a pretty hilarious combo, however. IR's response fleets are absurd. Sometimes, they try to deal with MBRR's invasions by spawning in even more dudes to lagtastic levels. So it's like World War II in space in a few sectors right now.... I don't recommend it, just because it is so damn laggy. I haven't noticed any bugs other than the former yet, but there's prob a lot of stuff going wrong underneath the hood that I haven't realized yet. Honestly, I just want to see what happens

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

Post by TechSY730 » Fri, 18. Aug 17, 06:18

Ah ha, so XRM does indeed break the "Add default items to ship" command.

Also, I was going to try the kind of work around you described, but I have been busy IRL and haven't gotten around to it. Do you mind posting the code you did and letting me fold it into the next version of the script?

rhine770
Posts: 6
Joined: Sat, 24. Oct 15, 20:42
x3tc

Post by rhine770 » Sun, 20. Aug 17, 06:39

Code: Select all

$turret.cnt = $ship-> get number of turrets
while $turret.cnt
    dec $turret.cnt
    $weapon.type = 6
    = $ship-> call script 'anarkis.lib.armturret' : turret.nb=$turret.cnt weapon.select=$weapon.type disable.ion=[FALSE] disable.ammo=[FALSE]
end
I put that before the "add default items to ship" command in mbase.create.ship.rand. I don't know any script so I had to go by gut (i just copy and pasted).

It calls the Anarkis's Pirate Guild script that arms their men, so it needs anarkis.lib.armturret. I'm not sure if that script itself is dependent on anything else. It seems like its standalone, but idk. Putting the weapon type at 6 tells the script to give everyone the most expensive stuff. It has more options but I haven't tried them yet.

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

Post by TechSY730 » Mon, 21. Aug 17, 03:58

@rhine770
Thanks for that, but I went ahead and wrote my own code to loop through and find the "best" lasers, and give some of those.

It isn't as sophisticated as anarkis' script, but at least I don't have to add a dependency onto another library this way.

Version 3.05:

Bug fixes:
* Introduced logic to ensure that ships generated for MBRR have at least some of the "best" weapons they can mount in their various turrets.
> This is a workaround for mods that "break" the "add default items to ship" command and cause it to generate sub-optimal layouts (XRM is a notable example of this for Paranid ships)
> Currently, "best" means find the weapon with the best shield damage, best hull damage, and best laser speed (that isn't impulse ray emitter, unless that is the only thing the turret can mount), and gives some of each of those.
> This will not fix ships already spawned, but they should naturally cycle over time as conflicts ensue

Known issues:
* The way the laser augmenting script currently works means that extra weapons may be added, potentially so many that the normal cargo capacity of the ship is exceeded, or they get more weapons then they have mounts to put them in
* Finding the "best" weapon uses very simple logic
> When finding the "fastest" laser, it will choose the fastest even if there is another one that is only slightly slower but much more powerful
> When determining the best weapon for hull and shield damage, it only looks at damage of the projectile, and does not consider rate of fire. A more accurate measure would be DPS. However, so far I have not found a way to get the fire rate of a weapon through scripting. This is somewhat mitigated by weighting OOS damage heavier than IS damage (which is my understanding the OOS damage doesn't care about fire rate; let me know if I am wrong).
* The logic for "best" weapon probably won't work for missile turrets, but MBRR already has logic in place for stocking ships with missile turrets

MilitaryBaseResponseRevamp-V3.05-20.08.2017.spk:
https://drive.google.com/open?id=0B80_E ... Gc2QTYyRms

User avatar
joelR
Posts: 2008
Joined: Mon, 9. Jul 07, 23:33
x3tc

Post by joelR » Mon, 2. Oct 17, 04:43

I know im a little late to the party here but I wanted to say thanks for doing this. One of my favorite scripts and so glad to see you got it working right with XRM

Private Hix
Posts: 5
Joined: Sat, 18. Nov 17, 00:05
x4

Post by Private Hix » Tue, 28. Nov 17, 00:20

Hey there, I posted this as its own topic but I haven't received any replies.

I'm having an issue with this mod, my 'Military Prestige" rating has changed to "Null" (from 153). Now whenever I gain more prestige it tacks the number on to the end of the "Null". For example, if I kill a pirate and gain +8 prestige, my new total prestige will be Null8. Currently it is sitting at Null8144123 haha.


Is there a fix to this? I tried uninstalling & installing the script in-game, but that didn't change anything...

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

Post by TechSY730 » Mon, 16. Jul 18, 02:54

Hey, I'm still around. Just got distracted with other games. :P

Anyways, another big release here.

@Private Hix Sorry it took me so long to get to this, but I found your issue and have a fix for it. See the release notes for details.

Version 4.0:

New Features:
* Missile boats (M8s and M7Ms, or anything with a missile turret) have greatly revamped logic
> The previous logic relied on turret scripts to do the firing, which tended to result in rather anemic barrages, especially when compared to the missile boat logic that the Rapid Response Fleet logic uses. Now the script will "pull the trigger".
> Missile boats are willing to jump back to base if they run out of missiles. Don't be surprised if a M8 jumps in, dumps a ton of missiles, and then jumps right back out. (There is logic in place to detect cases like the Xenon I which can still have plenty of bite even if they run out of missiles; they won't retreat so readily)
> M8's are wiling to attack other corvette sized classes instead of always beelining to the capital ships. M7Ms will still beeline to fellow capital ships
> They will no longer try to kite ships that are significantly faster then it
> Missile boats are now willing to attack stations. :twisted:
* There is now a small chance that a race will call in ships to a sector that they have neutral relations with (such a unowned sectors), if encounter something "sufficiently scary" and are adjacent to a sector they own or are friendly with.
> This may be relevant to other scripts that spawn in "baddies" in otherwise unoccupied, unowned sectors
* The Terran race now has a small chance of choosing some ATF ships (about 10% for each ship chosen)
> A reminder, the ATF Valhalla is explicitly blacklisted from being selected, so no easy Valhallas for you. ;)
* Fighters that belonged to a destroyed carrier will now seek out a new carrier to become fighters of.
* Integrated the standard fight logic with the Mosquito missile defense and Missile Safety scripts. If you don't one of these, that's fine, it just won't do anything.
* The threshold of danger before races will honor calls for defense is now lower for core sectors then it is for border sectors
* Probably lots of other little things that I don't remember at the moment.

Bug Fixes:
* Fixed an issue where if you cancel out of "exchange prestige for credits" screen, your prestige would be set to null, and then will act weirdly from there. Now canceling the screen will act as if you entered 0 (aka, nothing changes)
> If your save file is affected by this issue, you can click "Install/Upgrade" on the options menu and it will fix it. It will try to extract a meaningful number out of it, but there is a good chance it will fail, and will have no choice but to reset it to 0.
* Fixed an exploit where you could enter a negative amount of prestige to exchange to gain prestige for paying credits. Now your attempts at bribery will be caught and prevented. ;)
* Fixed ships that are retreating not considering how much jumpdrive energy they had before trying to jump, leading them to move slowly to the destination sector instead of the intended response of not trying to jump and doing an emergency jump in the case of an emergency.
* Recon scouts will now scan as soon as they enter a sector before they start patrolling, so they don't blindly dart into an enemy that is right on the other side of a gate
* Disallowed the script from "taking over" race owned TLs that happen to dock at military bases, since they are usually used for other things and MBRR would just interfere with this. This will NOT fix TLs that have already been affected by this.
* Reworked the "give best lasers" logic so it won't overstock with way more lasers when it already had enough lasers from the default equipment
* Probably lots of other little things that I don't remember at the moment.

Planned features:
I wanted to integrate with LIFE's fork of the Galactic News System just like it would with the standalone version, but LIFE made some important changes in how it deals with race specific news that makes this difficult.
> In more detail, they added a way to add a specific news item to a per race's array of articles, but didn't add a way to remove a specific news item from a specific race's array of articles. This means when you call the remove script, it tries to remove it from the last race's news you looked at and not any other the others. This could lead to orphaned news items.
I'm currently investigating ways to work around this.

Version 4.01:
* Fixes a minor packaging mistake I made

MilitaryBaseResponseRevamp-V4.01-15.07.2018.spk:
https://drive.google.com/file/d/1AdQyi4 ... sp=sharing
Last edited by TechSY730 on Thu, 19. Jul 18, 06:54, edited 3 times in total.

michtoen
Posts: 67
Joined: Mon, 22. May 06, 20:09
x3

Post by michtoen » Mon, 16. Jul 18, 19:58

Hi, nice you are still there! And nice update.

I just released this, a modding package for XRM:

https://forum.egosoft.com/viewtopic.php?t=399184

This script is part of the original "what to install with XRM" suggestions of XRM.

I give it a quick test and there are no hard conflicts but it seems there are some problems with other scripts.

Thats sad, because i think in that package, which use only main scripts and mods, it would fit really good.

Problem is also, that there is a good chance that other players run in same problems, also without LxXRM but today no one play XRM really vanilla.

The included invasion scripts are the point, i think.
I noticed in the setup invalid race names like "8" and "unknown" and i noticed that the this script removed ships from the Revelation script, i would guess because it took over the xenon station.

But at all, it seems to me just internal setting and config problems.
If you like, you can give LxXRM a test run, it will also give you a good test enviroment.

How btw. this script works together with the build in race respond fleet of AP?

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

Post by TechSY730 » Tue, 17. Jul 18, 00:17

Just make sure you mention that you want the versions released later in the thread.
The version in the OP is significantly behind my changes.
In fact, I probably should make a new thread for my forks...

Anyways, the original version conflicted with AP's rapid response fleets, but I've updated it so they will work along side each other, so long as they still use the built in !fight.global.call.defencebase script.

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

Post by TechSY730 » Wed, 18. Jul 18, 21:32

Version 4.02:

Bug Fixes:

* Fixes an issue with the laser equipping logic that would sometimes cause it to give more Impulse Ray Emitters then intended, possibly leading to some good lasers getting "left out"

EDIT: Minor fix not worth bumping the thread over
Version 4.03:

Bug Fixes:

* Fixes a minor issue where missile turrets would be counted as "turrets that can only mount IREs" and thus extraneous IREs would be given to the ship,

EDIT2:
Version 4.04:

Bug Fixes:

* Fixes an issue where MBRR ships would be called on by the vanilla "defend base" scripts, which interferes with the MBRR logic.
> This unfortunately had to be done by overwriting the built in script "!lib.fight.defencebase.start". So if you have a mod that changes that script, you will need to "un-overwrite" it when you install this script. Or bug me for a compatibility patch ;) (I will need a copy of the original script your other mod provided).

MilitaryBaseResponseRevamp-V4.04-19.07.2018.spk:
https://drive.google.com/open?id=1eqvlD ... 3do3S75rDB

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

Post by TechSY730 » Mon, 23. Jul 18, 17:18

Finally, a fix worthy of a thread bump

Version 4.05:

Bug Fixes:
* Fixes wings searching for a new carrier idling for a long time before docking
> It may take a while for existing wings to pick up on the new script version

New Features:
* Ships jumping to a sector to defend it will now state that sector as their destination in their info box (this is mostly to help debugging)


From Version 4.04:

Bug Fixes:

* Fixes an issue where MBRR ships would be called on by the vanilla "defend base" scripts, which interferes with the MBRR logic.
> This unfortunately had to be done by overwriting the built in script "!lib.fight.defencebase.start". So if you have a mod that changes that script, you will need to "un-overwrite" it when you install this script. Or bug me for a compatibility patch (I will need a copy of the original script your other mod provided).

MilitaryBaseResponseRevamp-V4.05-23.07.2018.spk:
https://drive.google.com/open?id=1gl24m ... N-j5noXa2Q

+JAZZ+
Posts: 64
Joined: Tue, 10. Feb 04, 14:50
x2

Post by +JAZZ+ » Tue, 24. Jul 18, 07:25

your reworked script does not seem to work correctly with me.

Races not invading sectors, get no subtitle messages or galactic news system messages about invations.
Ships don't get marked by race militaries.
Can join a race at a military outpost, but nothing else happens.
All settings for the script are on standard, i just press install.

Tried the original script and all these things are working, but it's very outdated, especially for AP.

Only other mods are TC plots for AP, official bonus pack and the scripts taged as required in the first post.

Have i missed something or am i doing something wrong?

I would really like to use your script. It is great that someone brings one of my favourite scripts up to date.

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

Post by TechSY730 » Tue, 24. Jul 18, 18:08

1. Looking at it, yeah, it seems I did break invasion calling in my 4.0 scout changes. I'll test out a fix.

2. Ship renaming to mark by race militaries is now an option in the settings under "Military Prestige Scoring". I can't remember if I made it default to on or off (though it sounds like off by default), but if you want that feature, turn it back on.

3.I honestly don't know what is supposed to happen when you join a race at a military outpost. What is supposed to happen that isn't?

Mountain_Puncher
Posts: 87
Joined: Mon, 23. Apr 12, 06:07
x3tc

Post by Mountain_Puncher » Tue, 24. Jul 18, 22:23

I have the same problem as no invasions occurring. Well Actually a Split general always spawns in the sector Soul star at the start and claims it, but that is off tangent. I am using the LxXRM compilation and adding this last. Even though I am not using any plots, revelation, or phanon scripts, once I install this and reinitialize the scripts or save and load the races get messed up for this too. Argon turns into 1, Terran into 8 and Yaki into unknown in the plugin manager menu for this.

Also using the extended comms on a base allows one to join a faction but you receive 0 prestige points from destroying enemy ships.

I used the old version with XRM and it worked, the invasions and prestige anyway. I'm not very good at this and was wondering what I am missing.

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

Post by TechSY730 » Tue, 24. Jul 18, 23:17

Just to clear up a few things.

The script has two levels of "messing with enemies".
1. Invasions. Invasions is merely "willingness to send ships into enemy territory". It does not mount any specially organized attack beyond sending a collection of ships. No commander, no news items declaring an organized invasion, no attempt to claim the sector for themselves.
2. Sector takeovers. As above, but in addition will send a special task force headed by a commander, and will attempt to take ownership.


I am not finding anything especially broken with only invasions. Are you talking about sector takeover logic being broken?

Post Reply

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