[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 »

supahfly wrote:
ThisIsHarsh wrote:Updating: simply open the config menu. Opening the config menu will create a couple of new variables. No need to hit "install/update" or anything.
does this mean there is no need in following uninstall instructions on the first page?
Yeah, precisely. Most of the time an update doesn't need an uninstall - only a major update/bugfix requires that. I always make sure to give instructions for updating along with the notification post, as above.
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.
supahfly
Posts: 405
Joined: Thu, 3. Jun 10, 08:03

Post by supahfly »

ThisIsHarsh wrote:
supahfly wrote:
ThisIsHarsh wrote:Updating: simply open the config menu. Opening the config menu will create a couple of new variables. No need to hit "install/update" or anything.
does this mean there is no need in following uninstall instructions on the first page?
Yeah, precisely. Most of the time an update doesn't need an uninstall - only a major update/bugfix requires that. I always make sure to give instructions for updating along with the notification post, as above.
but still it is necessary to uninstall the plugin in plugin manager and then install new version, right?
ThisIsHarsh
Posts: 1135
Joined: Sun, 19. Oct 08, 18:46
x3tc

Post by ThisIsHarsh »

logician wrote:The only (minor) issues I've noticed thus far, could occur under certain race relation settings - In the following scenario, Argon military forces respond to an attack on a nearby Teladi core sector, just after Teladi actually reported "no military forces available to defend", regarding the same attack:

1) a Xenon PX (M6) and a couple small fighters invade Teladi core sector "Grand Exchange";

2) Teladi's nearby military outpost at "Merchant Haven" reports a possible attack on "Grand Exchange" and states that "no military forces are available to intervene";

3) Argon outpost at "Black Hole Sun" reports the same attack and orders two M6 Centaurs to engage the enemy.

The similar alerts are probably no bug, but just Argons "helping out" their Teladi friends, which is perfectly fine & configurable in MBRR's race relations.

Just the message log (screenshot available here) might get a little confusing with such reports in certain situations, for instance if a user sets several race relations to "friend", or if several attacks take place at once.

I'm not sure if it's worth changing, but one way could be to alter the incoming message, to something along the lines of..

"Our good friends, <sector owner>, are currently under attack at <sector>, where they appear to have no military forces available to fight off the attack, hence we are moving to engage with <ships> to assist."

..that would make it a bit clearer, why Argons are suddenly moving to engage enemies in a foreign sector, or why there are two reports concerning the same event.
I like that idea. The problem with it is technical. I've naturally had to trade-off between intelligent response and CPU usage. Each military outpost operates independently, there is no communication between races - not even communication between outposts of the same race (except the implicit communication of token sharing for Rearguard ships). To have that higher level of reasoning would require more CPU time.

However, although the system doesn't recognize other race's military assets in a sector (except enemies), I can create a different message for sending forces to an allied sector. The only issue I have with that is I would rather move all notifications to the Galactic News System and (possibly) ECS. I didn't actually think anyone would bother with the normal messages once the galactic news system was in place. I'm open to suggestions/opinions on this point.

logician wrote:In the above scenario, I also noticed that the two relevant sectors (Teladi's "Grand exchange" & Argon's "Black Hole Sun") are actually 5 sectors apart - In case the defending military ships do not use jumpdrives, it could take them a bit (too) long to arrive. Sorry if that's documented somewhere, I had to switch computers and couldn't test it further. :)
That won't be an issue - only ships equipped with a jumpdrive and with enough energy to jump will respond. Ships restock with energy (and install a jumpdrive, if necessary) every time they dock at their home outpost.
Last edited by ThisIsHarsh on Wed, 25. Aug 10, 15:41, edited 1 time in total.
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 »

supahfly wrote:
ThisIsHarsh wrote:
supahfly wrote:
ThisIsHarsh wrote:Updating: simply open the config menu. Opening the config menu will create a couple of new variables. No need to hit "install/update" or anything.
does this mean there is no need in following uninstall instructions on the first page?
Yeah, precisely. Most of the time an update doesn't need an uninstall - only a major update/bugfix requires that. I always make sure to give instructions for updating along with the notification post, as above.
but still it is necessary to uninstall the plugin in plugin manager and then install new version, right?
No, you can just install the spk without uninstalling the package first. In general the plugin manager is intelligent enough to remove residual scripts from older versions etc.
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.
supahfly
Posts: 405
Joined: Thu, 3. Jun 10, 08:03

Post by supahfly »

thanks, good to know
User avatar
Serial Kicked
Posts: 3823
Joined: Fri, 12. Aug 05, 20:46
x3tc

Post by Serial Kicked »

Glad to see you're back in the pirate killing business :)
X3:TC/AP Pirate Guild 3 - Yaki Armada 2 - Anarkis Defense System

Anarkis Gaming HQ
Independent Game Development
X3 Scripting and Modding Station
ThisIsHarsh
Posts: 1135
Joined: Sun, 19. Oct 08, 18:46
x3tc

Post by ThisIsHarsh »

Serial Kicked wrote:Glad to see you're back in the pirate killing business :)
Lol, yeah had quite a hiatus.

I've tried to ease up on the poor pirate guild by preventing recon ships and stations in pirate sectors from calling in a fleet. However, if those pirates dare destroy a military ship while it is enroute through the sector, then they may as well tuck their head between their legs and kiss their ass goodbye :twisted: .
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.
User avatar
Serial Kicked
Posts: 3823
Joined: Fri, 12. Aug 05, 20:46
x3tc

Post by Serial Kicked »

Don't worry about the guild being underpowered, correcting that is (the only) part of the 1.6x releases ;)
X3:TC/AP Pirate Guild 3 - Yaki Armada 2 - Anarkis Defense System

Anarkis Gaming HQ
Independent Game Development
X3 Scripting and Modding Station
ThisIsHarsh
Posts: 1135
Joined: Sun, 19. Oct 08, 18:46
x3tc

Post by ThisIsHarsh »

Update v2.9

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

:arrow: Xenon Emissary mode: use ECS to comm a Xenon Military Outpost and you can ally yourself with the Xenon. You become friends with the Xenon, but enemies with everyone else. Use the player ship "Reconnaissance uplink" to call Xenon down on the other races. As a reward, any ship you dock at a Xenon outpost will be repaired and resupplied. Check the OP for more details.

:arrow: A bit of a rethink of info showed in ECS menu, e.g. giving Rearguard stats for your ally.


Barring bugfixes, next step, finally, is sector takeover. I said a few times I would only implement it if someone found a way to do it properly - and now it can. Just need to browse RRF, IR and STO scripts to see how they handle it, then rip off the best bits of all three :wink:
Last edited by ThisIsHarsh on Sat, 28. Aug 10, 22:43, edited 1 time in total.
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 »

ThisIsHarsh wrote:Update v2.9

:arrow: Xenon Emissary mode: use ECS to comm a Xenon Military Outpost and you can ally yourself with the Xenon. You become friends with the Xenon, but enemies with everyone else. Use the player ship "Reconnaissance uplink" to call Xenon down on the other races. As a reward, any ship you dock at a Xenon outpost will be repaired and resupplied. Check the OP for more details.

:arrow: A bit of a rethink of info showed in ECS menu, e.g. giving Rearguard stats for your ally.


Barring bugfixes, next step, finally, is sector takeover. I said a few times I would only implement it if someone found a way to do it properly - and now it can. Just need to browse RRF, IR and STO scripts to see how they handle it, then rip off the best bits of all three :wink:
Whoohoo, good to hear :) good luck, ill certainly try it out once you got sector takeovers implemented.
Troubleshooter11
Posts: 728
Joined: Sat, 8. Nov 08, 02:51
x4

Post by Troubleshooter11 »

After playing with your latest version id like to state that i find your script the most 'elegant' of all the warfare/response scripts out there.

Nothing over the top. Does what it reads on the label without adding too many needless gimmicks and seems to offer stable performance.

One question though, wouldnt it be more fitting to use M5 scouts insted of recon drones? That is pretty much the only thing i feel that is a bit 'out of place'.
djrygar
Posts: 1842
Joined: Mon, 10. Aug 09, 02:09
x3ap

Post by djrygar »

ThisIsHarsh wrote:and now it can. Just need to browse RRF, IR and STO scripts to see how they handle it, then rip off the best bits of all three :wink:

LOL

As a reward for your discovery (signal_changesector) I could write it for you for free :D :D :D (seriously this is amazing thng)

both RRF and IR use the same method - keeping 2 dimensional array [sector][previous owner] in global. The actual takeover logic in IR is something giving me headaches, and steer away from it if you care for yourself :D I will change it very soon anyway - it is not reliable

in IR, I also added backup feature. I think it very good idea. It happened that for some different reasons (uninstalling, bugs, other scripts messing with sector owners, other unforeseen cases) that takeover array was sometimes out of sync with current universe state, causing races to launch attack against itself or friendlies and other strange things

So I designed this backup feature, also with your script and RRF in mind. I think it would be great if you could use the very same backup.

how it works:

when IR is installed, AND it does not detects previous IR instllations (there is global var for that) AND there is no backup array - it creates one. After that - it does not alter or delete it - even if you remove IR
This array is separated from all other IR's globals.

So, if for example your script will behave the same way - both script would benefit from it, having information about vanilla universe state.



if you are interested here are details:

global name:
plugin.ir.vanillasectorowners (an array containig 3 arrays)

$vanillaSectorOwners[0] = $sectorlist
$vanillaSectorOwners[1] = $owners
$vanillaSectorOwners[2] = $plotprotection


$sectorlist - obviously a sector
$owner - vanilla owner
$plotprotection - BOOL that is supposed to be set to true when given sector is used for plots

about last one:
currently t is not being altered in any way, it's just empty. You may ignore it, but it should be created
I have added for future plot protection that will be controlled from Mission Director, Mission DIrector can launch a script that may set this field to true when certain mission cues are finished/unfinished. Havent even started this tho ;) If I ever finish it it will be also independent from IR
ThisIsHarsh
Posts: 1135
Joined: Sun, 19. Oct 08, 18:46
x3tc

Post by ThisIsHarsh »

@Troubleshooter11: thanks for that, good to hear. You hit the nail on the head with exactly how I wanted this plugin to be. Nice to hear good reports - usually you only get posts from people when there's a problem :) .

The recon scout ships are indeed M5s. Vanilla X3TC has response from military outposts called by M5 Recon scouts - but it's rather badly written and not very intelligent or comprehensive - so MBR was created to replace that functionality with something better (hence the rather uninspired name for the plugin, which I now regret).


@djrygar: thanks for the info. The backup array is definitely something I'll pursue - the plot protection idea via MD is quite ingenious. I always try to make sure my scripts are compatible and complementary. I don't have any qualms using 3rd party scripts so I don't reinvent the wheel (the rather extensive prerequisite list for MBR is evidence of that!).

In theory (not tested recently) both RRF and IR can be used alongside MBR. In fact I originally created MBR to complement IR, before 7ate had added response ships. [RRF should also be compatible, since MBR only uses military ships owned by outposts, so RRF could still use the other military ships.]

Sector takeover muddles things a bit though, since any two plugins together would likely conflict on that issue. I'm yet to browse fully through the sector takeover methods (in-particular I'm interested in how sectors are repopulated with stations), but I'll probably end up asking you some questions along the way :wink: .
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.
dpadula
Posts: 242
Joined: Tue, 15. Aug 06, 18:47
x4

Post by dpadula »

I think that leaving Sector Takeover out of this script is the best idea. There are already a few others out there. I use Lazacorp's because it is nice and simple. It will work with any sector too.

But no need to add that to this script. It is as Troubleshooter11 already said. A great script that does what it says and nothing more.
-----
Dell Precision 3600
12 gb ram
Nvidia 1060
256 gd boot ssd and 1 tb data ssd
Windows 10
djrygar
Posts: 1842
Joined: Mon, 10. Aug 09, 02:09
x3ap

Post by djrygar »

ThisIsHarsh:

as for compatibility, (un)fortunatelly your topic about signal_changedsector forced me to finally take interest in those beasts (signals, scriptmaps) and I wonder, if extensive usage of those may create compatibility problems (two signals trying kill jobs-spawned ship? hijacking signal_attacked?). Maybe it's easily solvable with PRIOs,
I just don't know
ThisIsHarsh
Posts: 1135
Joined: Sun, 19. Oct 08, 18:46
x3tc

Post by ThisIsHarsh »

dpadula wrote:I think that leaving Sector Takeover out of this script is the best idea. There are already a few others out there. I use Lazacorp's because it is nice and simple. It will work with any sector too.

But no need to add that to this script. It is as Troubleshooter11 already said. A great script that does what it says and nothing more.
It shouldn't be a problem, since I pride myself on the fact that every aspect of this plugin is configurable through the menu. I would certainly be sure to make sector takeover entirely optional and have absolutely no bearing on the rest of the plugin's functionality if disabled.

djrygar wrote:as for compatibility, (un)fortunatelly your topic about signal_changedsector forced me to finally take interest in those beasts (signals, scriptmaps) and I wonder, if extensive usage of those may create compatibility problems (two signals trying kill jobs-spawned ship? hijacking signal_attacked?). Maybe it's easily solvable with PRIOs,
I just don't know
I'm not sure what would happen if two signal handlers for the same signal both tried to destruct a ship. I would think that it's ok, with the second destruct command just not having any effect. The destruct command could cause premature termination of the other signal handler(s) once called, which might be an issue.

I'm not sure if secondary signals are called in prio order, I doubt they are though, its not their primary function, but I've not tested so cant be sure.

As for compatibility in general, like I say sector takeover muddles things, but I'll to my best to read through the scripts of STO, RRF and IR, find the appropriate variables and handle the case that MBR's sector takeover is about to interfere.
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.
User avatar
hartza76
Posts: 156
Joined: Sun, 18. Jul 10, 21:46
x4

Post by hartza76 »

I have used MBR in past few time and versions, and i think i was month ago last time.

I know you have the setting for racial behaviour to each other as default in your menu.
I was just thinking to should i spice up my universe again a bit not that much as (RFF and IR right now) want to make some steam achis on the way.

Question is, i usually end up problem with "my" relation ie. to Paranid to be problematic. When i would use the general setting from "Default" to from cold war to Argon vs Paranid etc.
I end up situation that i cant even fart in near their ships or space when my reputation start to drop.

Would it work if i just dont touch the default race settings and the MBR will keep the setting as they are in my universe for relations?
i would never put argon and paranid as friends :twisted: for achi sake.

So should they just skirmis each other time to time when they meet or do the vanilla we will rape(paranid, happens in my vanila about every time when i start new game sooner or later, and argons send single ship to paranid prime to be killed) the cloudbase southwest thing. Or that military bases just respond better to incursions?
Edit: i know they will be better anyway, but the reputation thingy.

Heh, sorry for really long way to ask simple thing but im me and cannot do anyting about it :shock:
If a girl seems as shy as a mouse, you still have to look out for the tiger within her.
muttertron
Posts: 23
Joined: Fri, 1. Dec 06, 10:09

Post by muttertron »

Just how many additional ships will this create in the universe? I was a tiny bit bored because RFF seems a little slow, so uninstalled it and gave this script a go, only to have the pirates quickly get smacked around even with the Pirate Guild installed.

I know it says not to do this, but ehhhh I "crossed the streams" and threw RFF back into the mix, disabled RFF's sector take over, but left the diplomatic incidents option on. This worked fine...(great actually) for about 10 hours of game time, until the game slowed to crawl. Removed RFF, waited for awhile, saved. Still slow. Went to the option to disable your script from the menu and during its clean up the Paranid and Split military were numbering over 2000 ships each!

Shame we cant force you, LV, and Serial Kicked into a locked room to develop some kind of mega-AL plugin. >_>
ThisIsHarsh
Posts: 1135
Joined: Sun, 19. Oct 08, 18:46
x3tc

Post by ThisIsHarsh »

hartza76 wrote:I have used MBR in past few time and versions, and i think i was month ago last time.

I know you have the setting for racial behaviour to each other as default in your menu.
I was just thinking to should i spice up my universe again a bit not that much as (RFF and IR right now) want to make some steam achis on the way.

Question is, i usually end up problem with "my" relation ie. to Paranid to be problematic. When i would use the general setting from "Default" to from cold war to Argon vs Paranid etc.
I end up situation that i cant even fart in near their ships or space when my reputation start to drop.

Would it work if i just dont touch the default race settings and the MBR will keep the setting as they are in my universe for relations?
i would never put argon and paranid as friends :twisted: for achi sake.

So should they just skirmis each other time to time when they meet or do the vanilla we will rape(paranid, happens in my vanila about every time when i start new game sooner or later, and argons send single ship to paranid prime to be killed) the cloudbase southwest thing. Or that military bases just respond better to incursions?
Edit: i know they will be better anyway, but the reputation thingy.

Heh, sorry for really long way to ask simple thing but im me and cannot do anyting about it :shock:
I'm having a bit of trouble figuring out what you are asking.

If relations are set to -10, then they wont attack each other, but you can freely destroy their ships in each others sectors and the police won't attack you (you will even gain notoriety).

If set to hate each other, then they will invade each other, attempting to wipe out all ships and stations.


muttertron wrote:Just how many additional ships will this create in the universe? I was a tiny bit bored because RFF seems a little slow, so uninstalled it and gave this script a go, only to have the pirates quickly get smacked around even with the Pirate Guild installed.

I know it says not to do this, but ehhhh I "crossed the streams" and threw RFF back into the mix, disabled RFF's sector take over, but left the diplomatic incidents option on. This worked fine...(great actually) for about 10 hours of game time, until the game slowed to crawl. Removed RFF, waited for awhile, saved. Still slow. Went to the option to disable your script from the menu and during its clean up the Paranid and Split military were numbering over 2000 ships each!

Shame we cant force you, LV, and Serial Kicked into a locked room to develop some kind of mega-AL plugin. >_>
RRF should be compatible, though I haven't tested the combo since the early versions of MBR. RRF should use the leftover ships that aren't assigned to military outposts (and thus used by MBR). You should even be able to use RRF's sector takeover without problems.

As for creating ships, the only ships that are created are the Rearguard ships you see. You can disable Rearguard altogether in the menu, or just lower the token values/recharge rate and see if it helps.

When it's uninstalling it cycles through ALL ships of each race, not just military ships. I think 2000 is about right.

As for the slowdown, I'll have to investigate. The log file (log01002.txt) generated when debugging is enabled logs the amount of ships owned by a race whenever a base is called (e.g. "number of Split Big Ships = 114"), so it should be easy enough to check if the amount of ships is increasing over time when RRF is enabled.

I'm upgrading the config menu right now, but I'll check this issue out asap.
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.
User avatar
hartza76
Posts: 156
Joined: Sun, 18. Jul 10, 21:46
x4

Post by hartza76 »

yeah sorry about the long shit :)

i ment if i let the race relations be on your setup menu was it "default"
should the game be relatively vanilla expect they will really act on incursions when needed.
No major reputation problems ie Argon Vs. Paranid.(for me)

or did you change the menu what you had lately? i remember you had
all races liste and default setting was default.
(now i remeber you had +- 10 to 100000000xxx, race settings when changed from default)
If a girl seems as shy as a mouse, you still have to look out for the tiger within her.

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