[MOD] Improved (full rewrite) Engineer

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

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

Jey123456
Posts: 259
Joined: Sat, 23. Nov 13, 09:48
x4

Post by Jey123456 »

once you confirmed a fix, ill be glad to apply it, but until then, i consider the mod functional enough.

The isclass call is too basic to not work. And your other theory (the hullpercentage), doesnt apply to wreck
User avatar
_nox_
Posts: 245
Joined: Tue, 3. Feb 04, 09:52
x4

Post by _nox_ »

Again, as I said - all of the behaviour that I am witnessing would be explained by those two evaluations not working properly (granted I pasted the property check from the damaged list, not the destroyed list)

What I am seeing is :

a) components being repaired to full
b) order of components is arbitrary based on appearance in object persistence
c) engines not being repaired 'all at once' per your 'hullequalization' logic.

just sharing my observations. I can't dig in until this evening but I am happy to assist, I appreciate this kind of modification.
No good deed goes unpunished.
Jey123456
Posts: 259
Joined: Sat, 23. Nov 13, 09:48
x4

Post by Jey123456 »

are you sure you dont have multiple engineer mod going on here ? the order your giving for the componnent sound awfully like the vanilla (and most other engineer mod out here which are heavily vanilla inspired), version.

Also keep in mind, that repair drones repair everything on their own, all the engineer do is give them a list of damaged thing to repair and off they go.
User avatar
_nox_
Posts: 245
Joined: Tue, 3. Feb 04, 09:52
x4

Post by _nox_ »

Ok, this was on a terran frigate without a drone launch bay (I wish they had kept standard X names...)
No good deed goes unpunished.
Koritnaciino
Posts: 319
Joined: Sun, 26. Feb 06, 10:57
x4

Post by Koritnaciino »

In 1.18 beta is not working for me. Yes enginier showing that is working on it but components 64% and hull 12% is stuck for last 20 mins. Also repair drones not working for me. I do something wrong? Have to replace prewious engineer or something?
mitasamodel
Posts: 12
Joined: Tue, 26. Nov 13, 15:01

Post by mitasamodel »

Koritnaciino wrote:In 1.18 beta is not working for me. Yes enginier showing that is working on it but components 64% and hull 12% is stuck for last 20 mins. Also repair drones not working for me. I do something wrong? Have to replace prewious engineer or something?
What engineer report to you? Maybe, 64% for components and 12% for hull is a maximum of what engineer can do?
Koritnaciino
Posts: 319
Joined: Sun, 26. Feb 06, 10:57
x4

Post by Koritnaciino »

mitasamodel wrote:
Koritnaciino wrote:In 1.18 beta is not working for me. Yes enginier showing that is working on it but components 64% and hull 12% is stuck for last 20 mins. Also repair drones not working for me. I do something wrong? Have to replace prewious engineer or something?
What engineer report to you? Maybe, 64% for components and 12% for hull is a maximum of what engineer can do?
Repair capability components 64% hull 12%
But actualy my hull is always on the same percentage. And I think if I get this mod right, then my consruction drones have to fly around ship and do something right?
Katerchan
Posts: 7
Joined: Fri, 29. Nov 13, 18:34

Post by Katerchan »

Same here now:
my Arawn and my Tituriel both have 30 construction drones now, and it says all 30 are in use. but hull of both is still around 60% without any change, even after letting it "work" for over an hour, and the tituriel engines are not completly repaired yet.
csaba
Posts: 1256
Joined: Fri, 26. Aug 05, 22:39
x4

Post by csaba »

Katerchan wrote:Same here now:
my Arawn and my Tituriel both have 30 construction drones now, and it says all 30 are in use. but hull of both is still around 60% without any change, even after letting it "work" for over an hour, and the tituriel engines are not completly repaired yet.
This mod wont allow an engineer to fully repair the ship. The maximums are determined by his/her skills. You can check the % flying close to the ship and then you get a report what is he/she doing and what % is his/her maximum.
Koritnaciino
Posts: 319
Joined: Sun, 26. Feb 06, 10:57
x4

Post by Koritnaciino »

csaba wrote:
Katerchan wrote:Same here now:
my Arawn and my Tituriel both have 30 construction drones now, and it says all 30 are in use. but hull of both is still around 60% without any change, even after letting it "work" for over an hour, and the tituriel engines are not completly repaired yet.
This mod wont allow an engineer to fully repair the ship. The maximums are determined by his/her skills. You can check the % flying close to the ship and then you get a report what is he/she doing and what % is his/her maximum.
Are you shure? My engineer have 4 star in enginiering and other to most important skills 3-4 stars ... finaly can repair only to 16% hull? Also the drones not flying?
csaba
Posts: 1256
Joined: Fri, 26. Aug 05, 22:39
x4

Post by csaba »

Koritnaciino wrote:
csaba wrote:
Katerchan wrote:Same here now:
my Arawn and my Tituriel both have 30 construction drones now, and it says all 30 are in use. but hull of both is still around 60% without any change, even after letting it "work" for over an hour, and the tituriel engines are not completly repaired yet.
This mod wont allow an engineer to fully repair the ship. The maximums are determined by his/her skills. You can check the % flying close to the ship and then you get a report what is he/she doing and what % is his/her maximum.
Are you shure? My engineer have 4 star in enginiering and other to most important skills 3-4 stars ... finaly can repair only to 16% hull? Also the drones not flying?
Check the Op for the formula everything is written down there.
foxtrot76
Posts: 75
Joined: Fri, 12. Mar 10, 21:44

Post by foxtrot76 »

Mod is working as intended with beta 1.18. If you read a couple pages back the author even explains how to remove the limitation and let the engineer repair to 100%.

The only issue currently is the priority of repairs not working, everything else is flawless.
Koritnaciino
Posts: 319
Joined: Sun, 26. Feb 06, 10:57
x4

Post by Koritnaciino »

Ok I was mine that engineer can repair 16% of shield ... not only to 16% :) is that useable?
Neoxan
Posts: 12
Joined: Fri, 29. Nov 13, 20:34

Post by Neoxan »

I overrided that bug by setting the ammount of hull that the engie can repair to 50% ship will repair the same with or without drones, i also increased the repair rate and decreased the morale losing to compensate the lack of drones
andrewas
Posts: 1498
Joined: Thu, 10. Mar 05, 21:04
x3tc

Post by andrewas »

Jey123456 wrote:Well, the thing is they shouldnt. Its most likely something pretty stupid that broke it.
Specifically, the isclass check seems to fail on wrecked components.
User avatar
_nox_
Posts: 245
Joined: Tue, 3. Feb 04, 09:52
x4

Post by _nox_ »

andrewas wrote:
Jey123456 wrote:Well, the thing is they shouldnt. Its most likely something pretty stupid that broke it.
Specifically, the isclass check seems to fail on wrecked components.
Yes, analysing the logic that was the conclusion I had come to - if that test was failing, it would do what it seemed to be doing.

What do you think a good workaround would be? name pattern matching?

We only have to match engine, warp, other major components and let everything else be weapons.
No good deed goes unpunished.
Jey123456
Posts: 259
Joined: Sat, 23. Nov 13, 09:48
x4

Post by Jey123456 »

mmm, i wonder if wrecked object have their own class. (checking the content of the .class value on it would answer that)
andrewas
Posts: 1498
Joined: Thu, 10. Mar 05, 21:04
x3tc

Post by andrewas »

So far, they all return class 'destructible'. I was about to rewrite this to check by name, but its suddenly 4am.

EDIT]

Rewrote it anyway. Seems to work. Bit of a hack.


Code: Select all

				<do_all exact="$wreckedelements.count" counter="$i" reverse="true">
						<do_if value="$wreckedelements.{$i}.iswreck">
							<set_value name="$thisRepairTargetValue" exact="5"/>
							<!-- engines-->
							<do_if value="($wreckedelements.{$i}.knownname == {20104,1101}) or ($wreckedelements.{$i}.knownname == {20104,1201}) or ($wreckedelements.{$i}.knownname == {20104,1301})">
								<set_value name="$thisRepairTargetValue" exact="90"/>
							</do_if>
							<!-- jumpdrive -->
							<do_elseif value="$wreckedelements.{$i}.knownname == {20104,1401}">
								<set_value name="$thisRepairTargetValue" exact="70"/><!-- score are lower on the wrecked, since its going to take longer to restore, we would rather fix a non wrecked one first -->
							</do_elseif>
							<!-- drone bay -->
							<do_elseif value="$wreckedelements.{$i}.knownname == {20104,1501}">
								<set_value name="$thisRepairTargetValue" exact="60"/>
							</do_elseif>
							<!-- shields -->
							<do_elseif value="($wreckedelements.{$i}.knownname == {20104,801}) or ($wreckedelements.{$i}.knownname == {20104,901}) or ($wreckedelements.{$i}.knownname == {20104,1001}) or ($wreckedelements.{$i}.knownname == {20104,1801})">
								<set_value name="$thisRepairTargetValue" exact="50"/>
							</do_elseif>
							<!-- turrets -->
							<do_elseif value="($wreckedelements.{$i}.knownname == {20104,101}) or ($wreckedelements.{$i}.knownname == {20104,201}) or ($wreckedelements.{$i}.knownname == {20104,301}) or ($wreckedelements.{$i}.knownname == {20104,401}) or ($wreckedelements.{$i}.knownname == {20104,501}) or ($wreckedelements.{$i}.name == {20104,1901})">
								<set_value name="$thisRepairTargetValue" exact="25"/>
							</do_elseif>
							<!-- missiles -->
							<do_elseif value="($wreckedelements.{$i}.knownname == {20104,601}) or ($wreckedelements.{$i}.knownname == {20104,701})">
								<set_value name="$thisRepairTargetValue" exact="15"/>
							</do_elseif>
							
							<do_if value="$nextRepairTarget?">
								<do_if value="($hullEqualisationBonus gt 0) and ($wreckedelements.{$i}.knownname == $nextRepairTarget.knownname) ">
								<set_value name="$thisRepairTargetValue" operation="add" exact="$hullEqualisationBonus"/>
								</do_if>
Last edited by andrewas on Wed, 4. Dec 13, 22:29, edited 3 times in total.
User avatar
_nox_
Posts: 245
Joined: Tue, 3. Feb 04, 09:52
x4

Post by _nox_ »

I was in the shower thinking it would be nice if there was a defense guy who could set a bias on the repair order...

like, set a property in the defenseguy's ai for 'most wanted part' - jumpdrive if the defense guy intended to bug out, or specific weapon etc. (specific shield, or whatnot)
No good deed goes unpunished.
andrewas
Posts: 1498
Joined: Thu, 10. Mar 05, 21:04
x3tc

Post by andrewas »

Tested and cleaned up the code above, it now works for engines and jumpdrives, attempting to test it further but PMC keep donating new destroyers to my testing grounds.

If anyone else wants to test it, copy it into engineer.ai.xml replacing lines 367 through 392.

Return to “X Rebirth - Scripts and Modding”