Those locking scripts sound fine to me. Nice 'black box' implementation abstraction, rather than accessing the array(s) directly. Plus, extensible if further flags need adding. Sounds good to me, sign me up.
Roger. I'll start writing the lib. But I'd like the input from LV and LiteCube also, just in case they have special needs related to this. I'm pretty sure it will work for RRF, but i don't know about revelation and phantom, never studied the code behind those two.
In short, no, that lib is definitively not designed for your script. The goal of the lib is to tell others "hey there's an invasion going on in that sector, come back when the sector is conquered (or not)".
Moreover, you can't possibly lock a sector before the player start to invade a sector because you can't monitor him as we can monitor our troops/factions. That's also why i've not cited your name in the original topic. It's no big deal as the user usually know when a plugin is already attacking a sector as we're kind enough to warn him in a way or another.
well, core/borders is something I forgot about, I shall include it.
anyway, you need plot protection. For example Hub plot takes a lot of time to complete, then unlocks next ones. If you want users to disable half of your plugin until they finish plots, then there is no point in using it, flankly, unless you aim directly at RTS approach with custom map (in this case other plugins should be even banned)
I play ALWAYS plots with takeovers enabled. Makes every game different and interesting. You should play sometimes instead of scripting
I said someone in his right mind, not someone who think that TC is something else than a development platform
Nah more seriously. In fact, nope this lib doesn't need it, it's out of the scope. BUT you need it, and others too, and as I now realize the system described above could very well be used for plot protection too without any modification, why not.
The lib just has, on new game, to determine if it's a vanilla map, and if so, it add the list of protected sectors to the array.
Code: Select all
$plot.sector = Array, alloc: size=2
$plot.sector = Unknown Xenon Sector
$plot.sector = "plot.protection"
call script 'plugin.sk.sector.lock' arg=$plot.sector
(and do the same for each plot protected plugin)
So, when a plugin ask if the HUB sector is available for conquest using "plugin.sk.sector.islocked", the lib will tell him to find another sector.
Here you go, plot protection, without the need for an additional array
Consider that done (well, included in first release). You'll have to provide me with the list of plot sectors.
actually telling other scripts that you are going to attack something kinda contradicts with what you said once about relying on game-state. To know that given sector is under attack, you should drop patrols there[...]
Hehe. Well, it still relates on game state granted you're not playing with the library to f*ck with other scripts' logic
. Yes it's probably cheaper than patrol ships which try to determine what's going on (and nothing prevent THEM from checking the array when a nearby sector is full of 3rd party ships).
But the final effect is the same, it saves a lot of CPU, and ensure a better compatibility. The pros outweighs the cons. And TBH, the only other valid solution is to find what your plugins are doing is to pick in your own arrays (different for each plugin, may change from a version to another, etc.).
interesting topic anyway, could be renamed to Takeover Caffe Corner
The topic was supposed to be renamed something like that instead:
[Library] Temporary Sector Locking v1.00
But, yes I guess I could let you guys go wild (as i apparently can't prevent you from doing it anyway
) with your "common sector takeover system" and create a new release topic when done with the lib.
Just 2 words on that matter:
- I'm not gonna use a 3rd party takeover script/lib myself no matter how good it is. I've my reasons for that, one is that none of my scripts will use the same method to take over sectors. F:AI related factions will use their own stations/ships, completely ignoring what the game will spawn or not (yes it's designed to be used on a blank map). The invasion itself won't be based on stations. PG will use something somewhat similar to STO (kill the Trade Station, build a PB) but will be limited to border sectors around pirate ones. YA will be fleet based only, etc.
- There's no incompatibility with your idea(s) and this lib, it's rather complementary tbh. You use whatever method you want to takeover sectors and log them (or not) even a common lib, but you could still use this lib for keeping track of the original map, of protected sectors, and telling others that an invasion is going on.
- There's also a few unrelated usages that could be made out of this library. As an example, a 3rd party script could allow the player to protect his sector(s) from invasions for a fee.
I now realize that i should have let the word "takeover" out of the title (it was here to drag your attention in the first place
). But it's a bit too late for that, so yes, if you want to continue the discussion on sector takeover issues, feel free to proceed (i'll follow it anyway)