[MOD] BetterTurrets. Updated 20.12.2014
Moderators: Moderators for English X Forum, Scripting / Modding Moderators
Thanks! And sounds cool!
Small request though: could you maybe please bump the "neutral/friendly cap NPC's" up to just friendlies? Maybe 10+ relations? Less than that, and it doesn't make sense that they'd care whether I'm boarding or not. Unless we count in humanitarian reasons. That would be valid, maybe. A Universe-wide interdict on firing on ships with non-hostile personnel on board?
edit: meant in your next version! Not now!
Small request though: could you maybe please bump the "neutral/friendly cap NPC's" up to just friendlies? Maybe 10+ relations? Less than that, and it doesn't make sense that they'd care whether I'm boarding or not. Unless we count in humanitarian reasons. That would be valid, maybe. A Universe-wide interdict on firing on ships with non-hostile personnel on board?
edit: meant in your next version! Not now!
Just wanted to get this one "out the door" before leaving on holiday trip for a couple of weeks, so might need some more balancing.
For the impatient - both NPC "friendliness" and hullpercentage trigger can be tweaked in fight.attack.object.capital.xml, line 104
Changing this from:
to:
..should do what you ask (if i remember the relation weight correctly)
For the impatient - both NPC "friendliness" and hullpercentage trigger can be tweaked in fight.attack.object.capital.xml, line 104
Changing this from:
Code: Select all
<do_if value="@$enemies.{$i}.boarder and @this.ship.relationto.{$enemies.{$i}.boarder} ge 0.0 and $enemies.{$i}.hullpercentage le 50">
Code: Select all
<do_if value="@$enemies.{$i}.boarder and @this.ship.relationto.{$enemies.{$i}.boarder} ge 0.0032 and $enemies.{$i}.hullpercentage le 50">
Small request though: could you maybe please bump the "neutral/friendly cap NPC's" up to just friendlies? Maybe 10+ relations? Less than that, and it doesn't make sense that they'd care whether I'm boarding or not. Unless we count in humanitarian reasons. That would be valid, maybe. A Universe-wide interdict on firing on ships with non-hostile personnel on board?
I'm not totally agree with that. It's not just humanitarian reasons. For two factions(consider player as a faction), attack the ship which i have marines on that will cause deplomatical problem. The attack action appears to be a hostile action, not neutral.
As i read through the recode of the fight.attack.object.captial, your script can be separate into two parts,
the first part you can use a code
to add the presetting of DObaseskill and drones swarmsize.
the second part you can use code
to replace the whole do_if function to your own, because you only changed the code in it.
This will be more compatible to other mods instead of replace the whole <attention>
the first part you can use a code
Code: Select all
<add sel="/aiscript[@name='fight.attack.object.capital']/attention[@min='visible']/actions/do_if[@value='$enemies.count']" pos="before">
the second part you can use code
Code: Select all
<replace sel="/aiscript[@name='fight.attack.object.capital']/attention[@min='visible']/actions/do_if[@value='$enemies.count']">
This will be more compatible to other mods instead of replace the whole <attention>
@wanglewis
Don't forget the changes in the drone launch bit as well
Patching the entire attention node is a bit "first mod noobness legacy"/"play safe and patch like CDOAIO" + to help with readability of the code.
Was considering splitting the code up at a later stage (that is partly why those commented <!--****Modified code start** etc. sections), but later reconsidered since patching the entire node has the benefit that it's a bit more futureproof if ego only does a small "cosmetic" change which makes the xpath fail + somewhat securing that it's not run with a conflicting mod which also patches the DO IZ code - which would most likely end badly.
It's about 50 lines of vanilla "padding" at the beginning and end in there now, but if requested it's a quick job to split this one into 3-4 patch segments instead in the next version
Do you have a specific mod in mind here when it comes to compatibility?
Don't forget the changes in the drone launch bit as well
Patching the entire attention node is a bit "first mod noobness legacy"/"play safe and patch like CDOAIO" + to help with readability of the code.
Was considering splitting the code up at a later stage (that is partly why those commented <!--****Modified code start** etc. sections), but later reconsidered since patching the entire node has the benefit that it's a bit more futureproof if ego only does a small "cosmetic" change which makes the xpath fail + somewhat securing that it's not run with a conflicting mod which also patches the DO IZ code - which would most likely end badly.
It's about 50 lines of vanilla "padding" at the beginning and end in there now, but if requested it's a quick job to split this one into 3-4 patch segments instead in the next version
Do you have a specific mod in mind here when it comes to compatibility?
Hi cicero111,
Way off topic, but if you have some time to spare, could you please take a look at this question? Copied and pasted from the XML Tutorial. Wasn't getting an answer, possibly because nobody's following it anymore (and possibly because it really is a dumb question)
Probably a dumb question, but if I started with this:
and wrote this:
would it output this?
or this?
Way off topic, but if you have some time to spare, could you please take a look at this question? Copied and pasted from the XML Tutorial. Wasn't getting an answer, possibly because nobody's following it anymore (and possibly because it really is a dumb question)
Probably a dumb question, but if I started with this:
Code: Select all
<root>
<bar>
<foo a="1"/>
<foo a="2"/>
</bar>
</root>
Code: Select all
<diff>
<replace sel="//bar">
</replace>
</diff>
Code: Select all
<root>
<bar>
</bar>
</root>
Code: Select all
<root>
<bar>
<foo a="1"/>
<foo a="2"/>
</bar>
</root>
Merry Xmas
In this example you are replacing the <bar> node with a empty line, so I guess you would end up with something like this:
Another example:
Should result in this:
..which is in a way relevant to the discussion where I replace the entire attention node here
In this example you are replacing the <bar> node with a empty line, so I guess you would end up with something like this:
Code: Select all
<root>
</root>
Code: Select all
<diff>
<replace sel="//bar">
<bar>
<!--vanilla bits-->
<!--new stuff here-->
<!--vanilla bits-->
</bar>
</replace>
</diff>
Code: Select all
<root>
<bar>
<!--vanilla bits-->
<!--new stuff here-->
<!--vanilla bits-->
</bar>
</root>
@cicero111
it's the automated emergency jump mod, which changed the <wait> code inside the do_if. I dont know if these two mods can use together, i dont have a debuglog to prove it, whether these two are compatible. but according to the patch logic it's difficult for the game to find out which one is first
it's the automated emergency jump mod, which changed the <wait> code inside the do_if. I dont know if these two mods can use together, i dont have a debuglog to prove it, whether these two are compatible. but according to the patch logic it's difficult for the game to find out which one is first
@wanglewis
Ah - that one Had an old extracted version lying at my home server and took a quick peek. It does replace the wait before enemy scan goto/cease fire which I've not changed (other than backported the interrupts which were added in vanilla 3.0). They should be compatible, but depending on the patch load order it will either be appended or overwritten - which is not good..
I'm in on the do a less intrusive patching suggestion, I'll do a rewrite after the holidays
Ah - that one Had an old extracted version lying at my home server and took a quick peek. It does replace the wait before enemy scan goto/cease fire which I've not changed (other than backported the interrupts which were added in vanilla 3.0). They should be compatible, but depending on the patch load order it will either be appended or overwritten - which is not good..
I'm in on the do a less intrusive patching suggestion, I'll do a rewrite after the holidays
Yup, it will only replace/add/remove the nodes which is specified in the xpath, and use vanilla for the rest
The xpath stuff was a bit hard to wrap my head around at first, but looking at similar mods + some trial and error was a good way to learn how to do it. And of course watching the debug.log + adding some debug output in the code to verify it behaves as expected.
If you run with a lot of mods it can get a bit noisy in there, so I recommend for example LogExpert to be able to do some filtering to only see the output you're interested in.
The xpath stuff was a bit hard to wrap my head around at first, but looking at similar mods + some trial and error was a good way to learn how to do it. And of course watching the debug.log + adding some debug output in the code to verify it behaves as expected.
If you run with a lot of mods it can get a bit noisy in there, so I recommend for example LogExpert to be able to do some filtering to only see the output you're interested in.
It would be posible that do not launch drones against a big enemy cap and only launch drones to fight against other drones or wingmen?(Maybe only xl's)
I was watching a battle between a leviathan (supertransport) against xenon K (leviathan wins) but K was empty of drones and no wingmen. Leviathan launched drones but was a total massacre without hurting K
Thanks
I was watching a battle between a leviathan (supertransport) against xenon K (leviathan wins) but K was empty of drones and no wingmen. Leviathan launched drones but was a total massacre without hurting K
Thanks
@antoniut
Sorry for the late reply - It's quite possible, and in the early versions the mod only launced drones to XS/S/M ships. I changed back to vanilla behavior to not neuter the suls - who are a bit helpless against caps without their drones.
If you want to experiment, remove the lines 187-189:
This bit is where the caps are added as valid drone targets.
Sorry for the late reply - It's quite possible, and in the early versions the mod only launced drones to XS/S/M ships. I changed back to vanilla behavior to not neuter the suls - who are a bit helpless against caps without their drones.
If you want to experiment, remove the lines 187-189:
Code: Select all
<do_if value="this.ship.distanceto.{$enemies.{$i}} lt 10000m">
<add_to_group groupname="$dronetargets" object="$enemies.{$i}" />
</do_if>
Hi cicero111,
thought that this might be of interest to you. Was playing around with the drone launch settings to make carriers more viable.
Premises:
carriers, or at least the Arawn, can carry 300 drones.
combinedskill outputs a number from 20-100
So changed the drone swarm size calculation to this:
for carriers, and this:
for non-carriers.
Should allow carriers to launch from 28 to 300 drones, and non-carriers to launch from 2 to 30 drones.
Also doubled the range at which ships launch offensive drones.
I don't know if they'll all be able to get back home though since the drones' go home script appears to be flaky.
edit: Arawn launched 224 drones against a Titurel, and they all made it back. Took a while for all of them to get back though. Maybe some threat analysis? do_if dps gt x?
thought that this might be of interest to you. Was playing around with the drone launch settings to make carriers more viable.
Premises:
carriers, or at least the Arawn, can carry 300 drones.
combinedskill outputs a number from 20-100
So changed the drone swarm size calculation to this:
Code: Select all
<set_value name="$droneswarmsize" exact="this.combinedskill * (1 + (this.combinedskill * 2) / 100)" />
Code: Select all
<set_value name="$droneswarmsize" exact="this.combinedskill * ((1 + (this.combinedskill * 2) / 100) / 10)" />
Should allow carriers to launch from 28 to 300 drones, and non-carriers to launch from 2 to 30 drones.
Also doubled the range at which ships launch offensive drones.
I don't know if they'll all be able to get back home though since the drones' go home script appears to be flaky.
edit: Arawn launched 224 drones against a Titurel, and they all made it back. Took a while for all of them to get back though. Maybe some threat analysis? do_if dps gt x?
Thanks for the tip - did notice the combinedskill parameter was introduced in one of the the later betas but did not do much testing on the output.
The code could probably do good with a less "old school" approach of skill calculations, I'll look in to it and do a less hackish approach on the launch delay as well
Have found a better way to get ship classifications for carriers btw? Ship specific "this.ship.macro.ismacro.{macro.units_size_xl_capital_destroyer_1_macro}" (it just roll off the tounge ) stuff is not very expansion friendly.
The code could probably do good with a less "old school" approach of skill calculations, I'll look in to it and do a less hackish approach on the launch delay as well
Have found a better way to get ship classifications for carriers btw? Ship specific "this.ship.macro.ismacro.{macro.units_size_xl_capital_destroyer_1_macro}" (it just roll off the tounge ) stuff is not very expansion friendly.