[MOD] Miscellaneous IZ Combat Tweaks

The place to discuss scripting and game modifications for X Rebirth.

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

w.evans
Posts: 2963
Joined: Tue, 18. Nov 14, 16:23
x4

Post by w.evans »

rainking2020 wrote:My starter fleet will probably only be 3 or 4 ships, anyone recommend a good combination?
Really depends on what you want to do with them. In my last long game, I had several squadrons with deliberately different combinations of ships, and the rule was that I had to find each of them fun, and they should all be useful for something. That is, admittedly, a very subjective set of criteria, but you should be able to find some use for any combination of ships, and it should be possible to tailor particular squadron make-ups for particular uses.
debstar2610
Posts: 143
Joined: Fri, 29. Nov 13, 18:43
x4

Post by debstar2610 »

Hi,
Since 4.0 beta 6, the flee behaviour is implemented in the base game.
Are you going to do something with it later ?
I noticed that, if a squad leader is using the 'flee jump' , then its subordonates follow him

So making a big squad is not a good idea. And i manually force the quad leader to move away before it will attempt to flee jump

it depends on the ennemy, fighting against MICT Ships (especially balors) and CES drones can completely wipe out a 6M shield !
w.evans
Posts: 2963
Joined: Tue, 18. Nov 14, 16:23
x4

Post by w.evans »

nothing planned at the moment.

that said, i don't think vanilla flee applies to MICT ships that are in combat. (does it?) MICT does have a retreat function that's been there for ages. what you described sounds like it's working as intended. when the squadron leader flees, the whole squadron breaks off and forms up on the squadron leader. the squadron then resumes what they were doing before going into combat.

i guess easiest way to distinguish between them doing vanilla flee and MICT retreat is that retreating MICT ships will tell you that they're retreating on the event monitor.
debstar2610
Posts: 143
Joined: Fri, 29. Nov 13, 18:43
x4

Post by debstar2610 »

w.evans wrote:nothing planned at the moment.

that said, i don't think vanilla flee applies to MICT ships that are in combat. (does it?) MICT does have a retreat function that's been there for ages. what you described sounds like it's working as intended. when the squadron leader flees, the whole squadron breaks off and forms up on the squadron leader. the squadron then resumes what they were doing before going into combat.

i guess easiest way to distinguish between them doing vanilla flee and MICT retreat is that retreating MICT ships will tell you that they're retreating on the event monitor.
The vanila 'flee jump' always go to a jump beacon according to the move.flee.jump.xml . I did not find the keyword ' beacon ' in the mict folder yet .
i did not understand modding yet, it should work if I put the move.flee.jump.xml in a new folder like my_mod/aiscripts, and add a 'player IZ check' . So that only OZ ships or NPC ships use it

i am testing new changes to the missile_turret_dumbfire_macro.xml , so that succelus can fire it in range with the IHC canon ! actually it became useless with the vanila spec default range I am using a container ship to manually reload my cap ships after a battle !
THe missiles are only used as defensive weapons, if a mict ennemy is boosting or jumping to the big gun,
w.evans
Posts: 2963
Joined: Tue, 18. Nov 14, 16:23
x4

Post by w.evans »

debstar2610 wrote:The vanila 'flee jump' always go to a jump beacon according to the move.flee.jump.xml . I did not find the keyword ' beacon ' in the mict folder yet .
that would be an easier way to see if they're using vanilla flee or MICT retreat. MICT ships that are retreating will not use jump beacons. they will stay in the same zone but retreat away from the hostile ship that they're targeting.
debstar2610 wrote:i am testing new changes to the missile_turret_dumbfire_macro.xml , so that succelus can fire it in range with the IHC canon ! actually it became useless with the vanila spec default range I am using a container ship to manually reload my cap ships after a battle !
THe missiles are only used as defensive weapons, if a mict ennemy is boosting or jumping to the big gun,
Oho! A Sucellus missile cruiser! Let me know if you want any help with that project.
User avatar
Marvin Martian
Posts: 3614
Joined: Sun, 8. Apr 12, 09:40
x4

Post by Marvin Martian »

w.evans wrote: that said, i don't think vanilla flee applies to MICT ships that are in combat. (does it?)
<handler ref="AttackHandler"/> is in player.default and scripts like move.patrol, so yes vanilla coward handler is always present

and yes ship will not flee on a 1vs1 combat because of that in interrupt.attacked

Code: Select all

<check_value value="not (this.command.value == command.attackobject and this.command.param == event.param)" />
BUT what will be happend if a Squad-fighter of the actual (only valid) enemy will attack the ship too?

RIGHT -> Bye-bye!
w.evans
Posts: 2963
Joined: Tue, 18. Nov 14, 16:23
x4

Post by w.evans »

Stimmt. Hm.
w.evans
Posts: 2963
Joined: Tue, 18. Nov 14, 16:23
x4

Post by w.evans »

2.April 2016 - Miscellaneous IZ Combat Tweaks updated to v0.63

Ships that are engaged in combat will no longer be distracted by piffling things such as impending doom.

All ships (regardless of whether they are MICT ships or not) that are engaged in combat will no longer use vanilla flee. Note that this does not include ships that have a "patrol" or "attack all enemies" order before they acquire and actually start attacking a target.

Many thanks to debstar2610 for asking about this, and to Marvin Martian for pointing out the fact and why it, in fact, does happen.

.....
also updated MCT (Steam) and the CES Edition to latest.
User avatar
Simoom
Posts: 1110
Joined: Sat, 30. Oct 10, 14:14
x4

Post by Simoom »

So are combat ships that are engaged in battle basically "Firing until destroyed"? (Unless it's an MICT ship that will jump away when criteria is met?)
w.evans
Posts: 2963
Joined: Tue, 18. Nov 14, 16:23
x4

Post by w.evans »

Yup. Opinions?
w.evans
Posts: 2963
Joined: Tue, 18. Nov 14, 16:23
x4

Post by w.evans »

2.April 2016 - Miscellaneous IZ Combat Tweaks updated to v0.64

Changed the tweak in v0.63 to only apply to MICT ships. MICT ships that are in combat will not vanilla flee.

Also fixed a bug in 0.63.
debstar2610
Posts: 143
Joined: Fri, 29. Nov 13, 18:43
x4

Post by debstar2610 »

w.evans wrote:2.April 2016 - Miscellaneous IZ Combat Tweaks updated to v0.64

Changed the tweak in v0.63 to only apply to MICT ships. MICT ships that are in combat will not vanilla flee.

Also fixed a bug in 0.63.
Héhé ! nice, i will be do some battle to test it !!


I may need your help to figure out something strange.
I am using CWIR, and there is another version of the Succelus there.
Blackrain added an init script to this MD folder (brlongrange.xml)
I also added manually this code to the mict_init.xml

Code: Select all

<!-- Succelus V2 from CWIR -->
<append_to_list name="global.$MICT_LR_Ships" exact="macro.units_size_xl_van_destroyer_macro"/>

The ship is not using MICT LR moves ..

Code: Select all

 this.ship.macro.ismacro.{global.$MICT_LR_Ships} 
the new ship macro does not seem to be in the list .

If i do :

Code: Select all

			
<set_value name="$MICT_PATCH_TEST" exact="(this.ship.macro.name == macro.units_size_xl_van_destroyer_macro.name)"/>
and add $MICT_PATCH_TEST in every LR_Ships conditions in MICT.move.attack.object.capital.xml, the new ship is doing the correct moves.

So maybe, the new macro is not in the list LR_Ships , or there should be another explanation. I do not know how to log a list yet !
Last edited by debstar2610 on Sun, 3. Apr 16, 13:27, edited 1 time in total.
w.evans
Posts: 2963
Joined: Tue, 18. Nov 14, 16:23
x4

Post by w.evans »

probably because mict_init is only set to run once per game start. BR's init should work though. I'll take a look.

edit: possible reason is if CWIR loads before MICT does so global.$MICT_LR_Ships doesn't exist yet. Should be fixed the next time you load a save though.
debstar2610
Posts: 143
Joined: Fri, 29. Nov 13, 18:43
x4

Post by debstar2610 »

w.evans wrote:probably because mict_init is only set to run once per game start. BR's init should work though. I'll take a look.

edit: possible reason is if CWIR loads before MICT does so global.$MICT_LR_Ships doesn't exist yet. Should be fixed the next time you load a save though.
The load reaload, does not work :/ ! my first md script \o/ !

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<!-- Checks for presence of Blacrain/Rubini CWIRs mod.  Copy of mict_carriercompat.xml . -->
<mdscript name="MICT_CWIRCompat" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
	<cues>
		<cue name="MICT_CheckCWIRs">
			<conditions>
				<check_any>
					<event_cue_signalled cue="md.Setup.GameStart"/>
					<event_game_loaded/>
					<!--<event_player_created/>-->
				</check_any>
			</conditions>
			<delay min="1s" max="9s"/>
			<actions>
				<do_if value="md.CM_Config.Settings.$Builder?" >
					<append_to_list name="global.$MICT_LR_Ships" exact="macro.units_size_xl_van_destroyer_macro"/>
				</do_if>
												
				<reset_cue cue="this"/>
			</actions>
		</cue>
	</cues>
</mdscript>
Now the new Succelus is using MICT LR Range . It is just a quick fix but is it the correct way to do it ?
w.evans
Posts: 2963
Joined: Tue, 18. Nov 14, 16:23
x4

Post by w.evans »

cool!

only problem is:
debstar2610 wrote:

Code: Select all

<reset_cue cue="this"/>
will make the script run every time you load the game, and will append the entry every time. I think lists allow duplicate entries, but am not sure. Worst case, it'll bloat your save file.

mict_carriercompat is set to check every time you load in case anyone, for some strange reason, decides to uninstall the Carrier mod later. And in that case, it's fine to do over again because it sets a variable rather than adding to a list.

If you want it to check every time you load anyway, I think you could do:

Code: Select all

<do_if value="global.$MICT_LR_Ships.indexof.{macro.units_size_xl_van_destroyer_macro}" negate="true">
  <do_if value="md.CM_Config.Settings.$Builder?">
    <append_to_list name="global.$MICT_LR_Ships" exact="macro.units_size_xl_van_destroyer_macro"/>
  </do_if>
</do_if>
That way, if it's already listed, it shouldn't append the entry anymore.
debstar2610
Posts: 143
Joined: Fri, 29. Nov 13, 18:43
x4

Post by debstar2610 »

w.evans wrote:cool!

only problem is:
debstar2610 wrote:

Code: Select all

<reset_cue cue="this"/>
will make the script run every time you load the game, and will append the entry every time. I think lists allow duplicate entries, but am not sure. Worst case, it'll bloat your save file.

mict_carriercompat is set to check every time you load in case anyone, for some strange reason, decides to uninstall the Carrier mod later. And in that case, it's fine to do over again because it sets a variable rather than adding to a list.

If you want it to check every time you load anyway, I think you could do:

Code: Select all

<do_if value="global.$MICT_LR_Ships.indexof.{macro.units_size_xl_van_destroyer_macro}" negate="true">
  <do_if value="md.CM_Config.Settings.$Builder?">
    <append_to_list name="global.$MICT_LR_Ships" exact="macro.units_size_xl_van_destroyer_macro"/>
  </do_if>
</do_if>
That way, if it's already listed, it shouldn't append the entry anymore.
Oh thanks ! you saved my save, i ve checked with a count value and it s fine now !

in the MICT Ces Edition, you added

Code: Select all

<do_elseif value="this.ship.units.maxcount gt 300 and this.ship.availableunits.{unitcategory.defence}.count gt 0">
				<set_value name="$MICT_MaxAimDist" exact="8000m"/>
				<set_value name="$MICT_MinAimDist" exact="8000m * 0.5f"/>
				<set_value name="$MICT_MaxJumpDist" exact="8000m * (1.9f - ((this.skill.navigation + this.skill.morale)f / 10.0f))"/>
				<set_value name="$MICT_MinJumpDist" exact="8000m * (0.3f * (1.0f + (1.0f * ((this.skill.navigation + this.skill.morale)f / 10.0f))))"/>
				<set_value name="$MICT_MaxShortAimDist" exact="3570m * (2.0f - ((this.skill.navigation + this.skill.morale)f / 10.0f))"/>
				<set_value name="$MICT_MinShortAimDist" exact="3570m * (0.1f * (1.0f + (1.0f * ((this.skill.navigation + this.skill.morale)f / 10.0f))))"/>
				<!--<set_value name="$MICT_MaxShortAimDist" exact="this.ship.maxcombatrange.turrets"/>
				<set_value name="$MICT_MinShortAimDist" exact="this.ship.maxcombatrange.turrets * 0.75f"/>-->
			</do_elseif>
Actually, some carriers has only 150 units :/ ( Sul and Heavy Sul ). So what if I change it to 'gt 149' , and add a new variable like {global.$Carrier_Ships}

it would be nice to add unitcategory.attack too condition too ?

From unitmaps.xml

Code: Select all

<unit category="attack" mk="1" macro="units_size_xs_wardrone_macro"/>
  <unit category="defence" mk="1" macro="units_size_drone_attackdrone_impulse_mk1_macro"/>
  <unit category="defence" mk="1" macro="units_size_drone_swarm_xen_interceptor_drone_macro" factions="xenon" restricted="true"/>
  <unit category="defence" mk="2" macro="units_size_drone_attackdrone_impulse_mk2_macro"/>
  <unit category="defence" mk="3" macro="units_size_drone_attackdrone_plasma_mk1_macro"/>
  <unit category="defence" mk="4" macro="units_size_drone_attackdrone_plasma_mk2_macro"/>
  <unit category="defence" mk="5" macro="units_size_drone_missiledrone_dumbfire_mk1_macro"/>
  <unit category="defence" mk="6" macro="units_size_drone_missiledrone_dumbfire_mk2_macro"/>
I think , there may be a bug in the base game, either Intrepid or Overrun MK2 may be in the attack category.
I ve loaded a heavy sul with assault, interpid and overrun. the assault urvs are not launched :s
w.evans
Posts: 2963
Joined: Tue, 18. Nov 14, 16:23
x4

Post by w.evans »

debstar2610 wrote:Actually, some carriers has only 150 units :/ ( Sul and Heavy Sul ). So what if I change it to 'gt 149' , and add a new variable like {global.$Carrier_Ships}
That was added as a request. Apparently, someone made a drone carrier with a huge number of drone bays, and that was to take those ships into account. Reducing it to 149 would include things like the Taranis that has 150 drone capacity. I guess another way would be to check and see if a ship has a certain number of combat drones, thus implying the drone carrier role. Could be hard to communicate the change in behavior for people who load close-ranged combat ships with huge numbers of drones though.

Could be done with another list, but didn't want to add another list unnecessarily. Of course, feel free!
debstar2610 wrote:it would be nice to add unitcategory.attack too condition too ?
Are Assault URVs in CES good enough that you'd consider loading just those without other combat drone types? If they are, change is easy enough to do. Wouldn't mind adding the condition.
debstar2610 wrote:I think , there may be a bug in the base game, either Intrepid or Overrun MK2 may be in the attack category.
I ve loaded a heavy sul with assault, interpid and overrun. the assault urvs are not launched :s
Pretty sure they're classified defence drones. Otherwise, vanilla would either not launch Mk2 combat drones, or would launch Assault URVs.

If you're running CES, drone launch would be covered by that.
debstar2610
Posts: 143
Joined: Fri, 29. Nov 13, 18:43
x4

Post by debstar2610 »

w.evans wrote:That was added as a request. Apparently, someone made a drone carrier with a huge number of drone bays, and that was to take those ships into account. Reducing it to 149 would include things like the Taranis that has 150 drone capacity. I guess another way would be to check and see if a ship has a certain number of combat drones, thus implying the drone carrier role. Could be hard to communicate the change in behavior for people who load close-ranged combat ships with huge numbers of drones though.
Maybe this : http://postimg.org/image/a4jy5osnt/ from cwir

i did not used yet, i do not know if my CPU will handle 3600 drones lol !

As only Arawn and Hermod has 300 units (and xenon I) :/ , so i have to add little changes to use sul and heavy sul as 'real' carrier.

I ll check around to see if there are interesting other carriers ships mods to play.
debstar2610
Posts: 143
Joined: Fri, 29. Nov 13, 18:43
x4

Post by debstar2610 »

Hi,

I found a possible feature to add.

When doing order attack from a station's Infopoint, MICT ship does not know how to escape !
One of the escaping condition is neither set to true.

Code: Select all

(this.ship.distanceto.{$target} le (@$target.maxcombatrange.all + $target.size))
It seems that an Infopoint does not have turrets so that, the value of

Code: Select all

@$target.maxcombatrange.all
is always null.
The size of the infopoint is about 238m

So the Mict Ship is just staying there waiting to death ! and targets elements can not be listed, as they don't exist.

So a possible fix is to set the current target as the stationmodule from the Infopoint.? someone do know how to get it ?
w.evans
Posts: 2963
Joined: Tue, 18. Nov 14, 16:23
x4

Post by w.evans »

Hi debstar,

that should already be taken into account. These bits:

Code: Select all

<do_if value="$target.container.exists">
	<set_value name="$MICT_MaxEscapeJumpDist" exact="($target.container.maxcombatrange.all + $target.size) * (1.0f + ((this.combinedskill)f / 100.0f))"/>
	<set_value name="$MICT_MinEscapeJumpDist" exact="($target.container.maxcombatrange.all + $target.size) / (1.9f - ((this.combinedskill)f / 100.0f))"/>
</do_if>

...

<set_value name="$isstation" exact="$target.isclass.station or @$target.container.isclass.station"/>

...

<!-- MICT: If target is a station, move relative to station modules 
	Problem: This will make sure that a station's modules are in range, but won't make sure that they're in line of sight. -->
<do_if value="@$isstation">
	<find_object_component name="$MICT_StationModule" object="$target" class="class.destructible" functional="true" indestructible="false" surfaceelement="false"/>
	<do_if value="not $MICT_StationModule and $target.container.isclass.station">
		<find_object_component name="$MICT_StationModule" object="$target.container" class="class.destructible" functional="true" indestructible="false" surfaceelement="false"/>
		<do_if value="$MICT_StationModule">
			<set_value name="$target" exact="$MICT_StationModule"/>
			<do_if value="@$MICT_FeedbackAll or @$MICT_FeedbackTargeting">
				<show_notification caption="'=== MICT Combat Targeting ==='" details="'%1 \n Attacking station %6 \n Now targeting: %2 \n Min distance to Target: %3 \n Max distance to Target: %4 \n Distance to Target: %5 \n NODE 2'.[this.ship.knownname, $target.knownname, $MICT_MinAimDist, $MICT_MaxAimDist, this.ship.distanceto.{$target}, $target.container.knownname]" queued="false" priority="8"/>
				<write_to_logbook category="tips" text="'%1 \n Attacking station %6 \n Now targeting: %2 \n Min distance to Target: %3 \n Max distance to Target: %4 \n Distance to Target: %5 \n NODE 2'.[this.ship.knownname, $target.knownname, $MICT_MinAimDist, $MICT_MaxAimDist, this.ship.distanceto.{$target}, $target.container.knownname]"/>
			</do_if>
		</do_if>
	</do_if>
	<do_elseif value="$MICT_StationModule">
		<set_value name="$target" exact="$MICT_StationModule"/>
		<do_if value="@$MICT_FeedbackAll or @$MICT_FeedbackTargeting">
			<show_notification caption="'=== MICT Combat Targeting ==='" details="'%1 \n Attacking station %6 \n Now targeting: %2 \n Min distance to Target: %3 \n Max distance to Target: %4 \n Distance to Target: %5 \n NODE 1'.[this.ship.knownname, $target.knownname, $MICT_MinAimDist, $MICT_MaxAimDist, this.ship.distanceto.{$target}, $target.container.knownname]" queued="false" priority="8"/>
			<write_to_logbook category="tips" text="'%1 \n Attacking station %6 \n Now targeting: %2 \n Min distance to Target: %3 \n Max distance to Target: %4 \n Distance to Target: %5 \n NODE 1'.[this.ship.knownname, $target.knownname, $MICT_MinAimDist, $MICT_MaxAimDist, this.ship.distanceto.{$target}, $target.container.knownname]"/>
		</do_if>
	</do_elseif>
	<set_value name="$MICT_MaxEscapeJumpDist" exact="10km * (1.0f + ((this.combinedskill)f / 100.0f))"/>
	<set_value name="$MICT_MinEscapeJumpDist" exact="10km / (1.9f - ((this.combinedskill)f / 100.0f))"/>
	<remove_value name="$MICT_StationModule"/>
</do_if>
unless it doesn't work anymore.

Return to “X Rebirth - Scripts and Modding”