mict - no in zone jump customization

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

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

kelmenwong
Posts: 197
Joined: Sat, 17. Mar 12, 17:40
x3tc

mict - no in zone jump customization

Post by kelmenwong »

hello w.evans,

i change the xml diff instead of replace value of those related to in-zone jump, i just removed the nodes, as there is really no point processing them.

i tested it, seems like it's not working, in zone jump still occured.

some changes i tried out myself:

the dependency node in content.xml, i omit the version attribute, in-game it seems to detect version number of urs mod, listing 015 in the extension description.

1)

Code: Select all

<dependency id="ws_478790162"/>
does this really workable? or i must specify the version? the reason i try to omit it, as ur mod will be keep upgrading, and i have to update this version attribute everytime

the other 2 changes using remove node:

2)

Code: Select all

<remove sel="//do_if[@value='$MICT_JumpDrive.isoperational and this.ship.cargo.{ware.fuelcells}.count gt 500 and player.age gt (@$MICT_JumpStartTime + @$MICT_JumpTimer)']" ws="after"/>
this is suppose to remove the whole block of node setting the MICT_JumpActive to true

i look at the xml diff doc, seems like i need to put in ws=after

3)

Code: Select all

<remove sel="//do_if[@value='this.ship.distanceto.{$target} gt this.ship.size + $target.size + 10km']" ws="after"/>
this to remove in-zone jump action code block

the xpath node lookup for the attribute value, does replacing " -> ' should work? or i should use double " ?

do these all looks good?
however they not working as expected, advice?

update:

modding dependency doesn't work as i expected.
the only way to change the mod is directly editing it

code change

these changes are targeted at mict - nexus - ver 022, include few of it's optional features

2 files changed, 2 types of changes:
1) remove show_notification - it keep showing up radar, very annonying
2) remove/change code block involved jump and warp

MICT.move.attack.object.capital.xml
MICT.move.escort.capital.xml

the original code is renamed to *.1.txt
Last edited by kelmenwong on Sat, 15. Aug 15, 10:53, edited 6 times in total.
w.evans
Posts: 2963
Joined: Tue, 18. Nov 14, 16:23
x4

Re: mict - no in zone jump customization

Post by w.evans »

kelmenwong wrote:the dependency node in content.xml, i omit the version attribute, in-game it seems to detect version number of urs mod, listing 015 in the extension description.

...

does this really workable? or i must specify the version? the reason i try to omit it, as ur mod will be keep upgrading, and i have to update this version attribute everytime
It's a minimum version, so you won't have to change it for newer versions of MICT. It's a safety measure: if someone somehow manages to get a hold of your mod, and an earlier version of MICT, it won't run. Probably safest to have it in since I'm not sure how far back I started using $MICT_JumpActive. That said, I believe it was there almost from the beginning of MICT, certainly before the MCT was published, so should be ok without.
kelmenwong wrote:

Code: Select all

<remove sel="//do_if[@value='$MICT_JumpDrive.isoperational and this.ship.cargo.{ware.fuelcells}.count gt 500 and player.age gt (@$MICT_JumpStartTime + @$MICT_JumpTimer)']" ws="after"/>
this is suppose to remove the whole block of node setting the MICT_JumpActive to true
Yes, BUT it will also lock the state of the variable $MICT_JumpActive since that node is where the state of that variable is set. So if $MICT_JumpActive was set to true for any of your ships, it will stay true if you remove that node. If you just replace the command setting the variable to true with one setting it to false (this is what the command I gave you earlier does), it will correctly set that variable to false, and will prevent all ships from jumping while in combat.
kelmenwong wrote:

Code: Select all

<remove sel="//do_if[@value='this.ship.distanceto.{$target} gt this.ship.size + $target.size + 10km']" ws="after"/>
this to remove in-zone jump action code block
Should work. This will remove in-zone jumping completely from the escort script. However, you should know that this was added because vanilla used to tend to separate a squadron's ships far behind their commander, and this code was added to get them together if they drift behind by more than 10km. Come to think of it, should be unnecessary now, though, since most of them move in formation since a couple of updates of MICT back.
kelmenwong wrote:the xpath node lookup for the attribute value, does replacing " -> ' should work? or i should use double " ?
For sel= you mean? No idea. Double quotes work, don't know if single quotes will. Any particular reason why?
w.evans
Posts: 2963
Joined: Tue, 18. Nov 14, 16:23
x4

Post by w.evans »

Huh, just realized that I never set $MICT_JumpActive to false the way I was supposed to. Fixing now.
kelmenwong
Posts: 197
Joined: Sat, 17. Mar 12, 17:40
x3tc

Post by kelmenwong »

i think mct causing something funny, it seems to causing some weird visual effect.

i thought it's due to my changes, but disabled my mod still have that as well.

i trying to cap a ship, doing surface element attack/remove
it seems that at time, probably when my squad mate trying to participate in the fight, there is somekind of big square/target-mark visual effect shown up when i firing at the surface element.

anyway, i believe i found out my changes loophole

the 2nd node manipulation is not proper, because ur script is a do-else block.
what my changes did is removed the do block, but leaving the else block.

now i change my stuffs instead of to remove, i simply replace the value attribute to something that will never invoke the script within, like ur example, set the value to false

Code: Select all

<replace sel="//do_if[@value='$MICT_JumpDrive.isoperational and this.ship.cargo.{ware.fuelcells}.count gt 500 and player.age gt (@$MICT_JumpStartTime + @$MICT_JumpTimer)']/@value">false</replace>
<replace sel="//do_if[@value='this.ship.distanceto.{$target} gt this.ship.size + $target.size + 10km']/@value">false</replace>
i tried without version attribute, it seems to work.
anyway, i will put in 015, as per ur suggestion
w.evans
Posts: 2963
Joined: Tue, 18. Nov 14, 16:23
x4

Post by w.evans »

kelmenwong wrote:there is somekind of big square/target-mark visual effect shown up when i firing at the surface element.
Never seen this. And don't know how MCT could do that since it doesn't touch the graphics nor the UI in any way. I'll keep a look out, though.
w.evans
Posts: 2963
Joined: Tue, 18. Nov 14, 16:23
x4

Post by w.evans »

kelmenwong wrote:the 2nd node manipulation is not proper, because ur script is a do-else block.
what my changes did is removed the do block, but leaving the else block.
Not sure I understand what you mean by this.

This:
kelmenwong wrote:

Code: Select all

<remove sel="//do_if[@value='this.ship.distanceto.{$target} gt this.ship.size + $target.size + 10km']" ws="after"/> 
will remove this whole thing:

Code: Select all

<do_if value="this.ship.distanceto.{$target} gt this.ship.size + $target.size + 10km">
	<do_if value="$MICT_FeedbackAll or $MICT_FeedbackManeouver">
		<show_notification caption="'=== MICT Squad Maneouvering ==='" details="'%1 \n Subordinate of %2 \n\n Warping to Squad. \n Distance to Squadron: %3 \n NODE 1'.[this.ship.knownname, $target.knownname, this.ship.distanceto.{$target} - this.ship.size - $target.size]" queued="false" priority="9"/>
		<write_to_logbook category="general" text="'%1 \n Subordinate of %2 \n\n Warping to Squad. \n Distance to Squadron: %3 \n  NODE 1'.[this.ship.knownname, $target.knownname, this.ship.distanceto.{$target} - this.ship.size - $target.size]"/>
	</do_if>
	<do_if value="$capship">
		<wait min="250ms" max="1s" sinceversion="5"/>
		<jump object="this.ship" zone="$target.zone" skipcharge="true" ignorefuel="true" commandaction="true" sinceversion="4">
			<safepos radius="this.ship.size" object="$target" exact="this.ship.size + $target.size + 1km" allowyaxis="true"/>
			<rotation yaw="0deg" pitch="0deg"/>
		</jump>
	</do_if>
	<do_else>
		<wait min="250ms" max="1s" sinceversion="5"/>
		<warp object="this.ship" zone="this.zone">
			<safepos zone="this.zone" radius="this.ship.size" object="$target" max="this.ship.size + $target.size + 1km" allowyaxis="true"/>
			<rotation value="$target.rotation"/>
		</warp>
	</do_else>
</do_if>
Although this'll work too:
kelmenwong wrote:

Code: Select all

<replace sel="//do_if[@value='this.ship.distanceto.{$target} gt this.ship.size + $target.size + 10km']/@value">false</replace> 
But remember that you're altering two separate files! So, if you're going with that last bit you posted, this:
kelmenwong wrote:

Code: Select all

<replace sel="//do_if[@value='$MICT_JumpDrive.isoperational and this.ship.cargo.{ware.fuelcells}.count gt 500 and player.age gt (@$MICT_JumpStartTime + @$MICT_JumpTimer)']/@value">false</replace>
in \aiscripts\MICT.move.attack.object.capital.xml

and this:
kelmenwong wrote:

Code: Select all

<replace sel="//do_if[@value='this.ship.distanceto.{$target} gt this.ship.size + $target.size + 10km']/@value">false</replace>
in \aiscripts\MICT.move.escort.capital.xml

Also, just so you know, I'm currently working on tightening that 10km condition, so that could change.

.......
ps. Also read up on ws=

I don't think it applies here because that's for nodes that have plain text within them.

Example:
<do_if value="true">
break
</do_if>

Won't apply to things like:
<do_if value="true">
<break/>
</do_if>
kelmenwong
Posts: 197
Joined: Sat, 17. Mar 12, 17:40
x3tc

Post by kelmenwong »

"this.ship.distanceto.{$target} gt this.ship.size + $target.size + 10km""
is a do_if node
the next sibling node is a do_elseif
so this is basically a if + else if block
in programming, if i wanna remove *if*, the *else if* need to be change to *if*, or remove it as well

in my 1st attempt, my changes only remove the do_if node, while leaving the do_elseif, which is incorrect in programming context, not sure how this game handle it

anyway, i tested with latest changes, it still not work
so i back to directly edit in ur code, this seems to work
w.evans
Posts: 2963
Joined: Tue, 18. Nov 14, 16:23
x4

Post by w.evans »

kelmenwong wrote:"this.ship.distanceto.{$target} gt this.ship.size + $target.size + 10km""
is a do_if node
the next sibling node is a do_elseif
so this is basically a if + else if block
Right. Sorry, forgot about the do_elseif.
kelmenwong
Posts: 197
Joined: Sat, 17. Mar 12, 17:40
x3tc

Post by kelmenwong »

testing with new changes
both MICT.move.attack.object.capital, MICT.move.escort.capital
apply same:

Code: Select all

	<replace sel="//do_if[contains(@value,'@$MICT_JumpActive')]/@value">false</replace>
	
	<replace sel="//do_if[contains(@value,'this.ship.distanceto.{$target} gt this.ship.size + $target.size + 10km')]/@value">false</replace>
	
	<remove sel="//do_else[contains(warp/@object='this.ship') and contains(warp/@zone='$target.zone')]"/>
	
	<replace sel="//do_if[contains(warp/@object='this.ship') and contains(warp/@zone='this.zone')]/@value">false</replace>
the changes are focusing nodes that contains jump or warp node.

Return to “X Rebirth - Scripts and Modding”