[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 »

_nox_ wrote: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)
Thats a good idea, and i would not mind supporting it, but since i have no intentions of fixing the defense officer (other peoples are already working on that) and the vanilla one is... shoddy at best xD, it would require other people working on def officer to add a way to "express" a request to other crewmates so to speak

could be very simplistic like, a blackboard variable this.$engineeringStance where this is the defense officer and set the value to things like, retreat, allgunblazing etc. Engineering code not implementing it would simply not be affected, but any engineering reword could check if the value is defined, and act accordingly if they wanted to. (my engineer mod isnt the only one out here either).
foxtrot76
Posts: 75
Joined: Fri, 12. Mar 10, 21:44

Post by foxtrot76 »

andrewas wrote: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.
Copy pasted your code in the place you mentioned but it doesn't seem to work, in fact eng is behaving like vanilla (hull got repaired at a high speed and stopped at 75% I edited Improved Eng to reapir to 100%) and stopped giving updates on repair status... maybe i did something wrong. Also the ships was already repairing when i modified the script. That could be the problem, also using beta 1.19. Will try again
swatti
Posts: 1278
Joined: Sun, 7. Dec 03, 12:03
x4

Post by swatti »

Soooo... How is the 1.19 engi. As in how does it work, mine is a bit odd. Sometimes it fixes up the whole ship in one bang, now it wont do anything to recently capped Balor.

Think i need to go back to this mod for my engi-needs.
User avatar
Ringo7
Posts: 42
Joined: Fri, 29. Feb 08, 17:34
x3tc

Post by Ringo7 »

swatti wrote:Soooo... How is the 1.19 engi. As in how does it work, mine is a bit odd. Sometimes it fixes up the whole ship in one bang, now it wont do anything to recently capped Balor.

Think i need to go back to this mod for my engi-needs.
I've never had a an engineer actually repair anything on a captured ship. Construction drones or not. The engineers just do nothing no matter how long I wait. I've probably captured 50 capital ships and not one was repaired after assigning an engineer. This mod didn't help. Using free play. And yes, waited several hours for ANYTHING to be repaired... but nothing. End up selling the ships.
andrewas
Posts: 1498
Joined: Thu, 10. Mar 05, 21:04
x3tc

Post by andrewas »

foxtrot76 wrote: Copy pasted your code in the place you mentioned but it doesn't seem to work, in fact eng is behaving like vanilla (hull got repaired at a high speed and stopped at 75% I edited Improved Eng to reapir to 100%) and stopped giving updates on repair status... maybe i did something wrong. Also the ships was already repairing when i modified the script. That could be the problem, also using beta 1.19. Will try again
Sounds like you're running the stock engineer script. I have no idea how that happened. Maybe cut and pasting through the forum screwed it up.

Heres a working version:

https://www.dropbox.com/s/vg8224zvq0ijg ... eer.ai.xml

At least, it worked under 1.18, Im doing a mod free playthrough right now so I haven't tested it under 1.19.
foxtrot76
Posts: 75
Joined: Fri, 12. Mar 10, 21:44

Post by foxtrot76 »

andrewas wrote:
foxtrot76 wrote: Copy pasted your code in the place you mentioned but it doesn't seem to work, in fact eng is behaving like vanilla (hull got repaired at a high speed and stopped at 75% I edited Improved Eng to reapir to 100%) and stopped giving updates on repair status... maybe i did something wrong. Also the ships was already repairing when i modified the script. That could be the problem, also using beta 1.19. Will try again
Sounds like you're running the stock engineer script. I have no idea how that happened. Maybe cut and pasting through the forum screwed it up.

Heres a working version:

https://www.dropbox.com/s/vg8224zvq0ijg ... eer.ai.xml

At least, it worked under 1.18, Im doing a mod free playthrough right now so I haven't tested it under 1.19.
Thank you very much, will try it out asap and let you know. :wink:

Edit: Quick question for Jay, I've noticed that when repairs begin all constructor URV's have the status "in use" but they never revert back once repairs complete. Is this intentional? I ask cuz this causes conflictual behavior when a builder ship runs this mod since the drones are used for 2 tasks and not only repairs.

Edit2: Works like charm now thanks for the upload andrewas =)
Jey123456
Posts: 259
Joined: Sat, 23. Nov 13, 09:48
x4

Post by Jey123456 »

my name is Jey not Jay.

As for the repair drones, i never even tested them (never bought any since there were never any available in my save while i worked on this script, hence why i started working on the trader/economy fix)

I also was not sure if they were only visual or if they did actual repair on their own (documentation was pretty much null on that side), so right now, they dont help with anything other than looking cool.

As for the inuse, the call to bring them back in the ship is definitly called, if it doesnt reset their inuse state, then its most likely bugged and ill have to implement a similar workaround than what i did for cargo drone in trades.
flatbush71

Post by flatbush71 »

I'm getting the same "In use bug on the other " Engineering Mod ".
There's something about non-player ships that's bugged.
When a player takes possession of it the problem starts.
Also the docking path of captured ships is also badly bugged.
My Turtle ( or what ever the hell you call it ) sits inside stations when it loads and unloads.

Bugs ,bugs eveywhere :cry:
foxtrot76
Posts: 75
Joined: Fri, 12. Mar 10, 21:44

Post by foxtrot76 »

Jey123456 wrote:my name is Jey not Jay.

As for the repair drones, i never even tested them (never bought any since there were never any available in my save while i worked on this script, hence why i started working on the trader/economy fix)

I also was not sure if they were only visual or if they did actual repair on their own (documentation was pretty much null on that side), so right now, they dont help with anything other than looking cool.

As for the inuse, the call to bring them back in the ship is definitly called, if it doesnt reset their inuse state, then its most likely bugged and ill have to implement a similar workaround than what i did for cargo drone in trades.
Apologies Jey, was 2 am when I wrote your name. In any case the drones don't actually launch on combat ships however they sometimes do on the constructor ship (which looks pretty cool tbh) and fly around it repairing it (visually at least).
However since they never dock back (when/if launched) or revert back to their standby state, the constructor can't access them when you build a station part. I simply avoid putting an engineer on the constructor to avoid this problem. Thought I'd let you know about this little issue.

Cheers

Edit: Concerning the "in use" issue of drones, it doesn't seem to be related whether they are docked or still flying around. The status doesn't update when they dock.
Last edited by foxtrot76 on Tue, 10. Dec 13, 08:55, edited 1 time in total.
Jey123456
Posts: 259
Joined: Sat, 23. Nov 13, 09:48
x4

Post by Jey123456 »

Yea, as soon as im done releasing the mod for the economy/trading stuff. Ill come back to the engineer, fix the drones, the wreckrepair order and some other details that need to be done.
swatti
Posts: 1278
Joined: Sun, 7. Dec 03, 12:03
x4

Post by swatti »

If i want to increase my engineers speed of hull-repair, where do i do it? 1% every 500-1000sec is kinda boring.

Is there an option to stop hull-repairs "in-combat" and maybe add a delay before they start since last hit. Something to compensate for faster hull-repair and not make it a combat-repair. Also im not going for the modern day "duck and heal to full in 3sec", just not wanting to wait for hours to fix my ships.
Jey123456
Posts: 259
Joined: Sat, 23. Nov 13, 09:48
x4

Post by Jey123456 »

hull repair rate is the same as components repair rate. Its somewhat easy to make faster but well, its not the concept of this mod.

For the pause on damage taken thing, no there is no such system implemented in this mod. The engineer work non stop even if the ship is in combat :P.


As for quicker repair you are meant to use the shipyard, the engineer (in this mod) is not made to replace the shipyard in any way and is only here for emergency repairs / keep the ship moving.
swatti
Posts: 1278
Joined: Sun, 7. Dec 03, 12:03
x4

Post by swatti »

Well, at the moment reparing ship at the yard is quite dangerous as it can get stuck, stuck the whole shipyard and it costs a small fortune. Its also pure pain to repair 10+ ships

As long as the game-mechanics are what they are, to me your mod is the only repair im using. Perhaps when player-shipyards are implemented things will change.

What line of code do i need to look for to increase the repair-rate?
Jey123456
Posts: 259
Joined: Sat, 23. Nov 13, 09:48
x4

Post by Jey123456 »

look at the bit that apply bonus from skills, and just set the value to whatever you want.

As for the shipyard, its true that on vanilla its incredibly unreliable. But with my wip economy/trading mod, the shipyard never failed me yet.
swatti
Posts: 1278
Joined: Sun, 7. Dec 03, 12:03
x4

Post by swatti »

I tried to find where the skill is but im too scared to change anything... Soooo, can you paste me a line to CTRL-F and change to my liking.
Jey123456
Posts: 259
Joined: Sat, 23. Nov 13, 09:48
x4

Post by Jey123456 »

<set_value name="$EngineerRepairRate" exact="$EngineerRepairRate * (75+$skillbonusrepair)/100"/>

change the exact="" part to be whatever value you want. base value is 20
swatti
Posts: 1278
Joined: Sun, 7. Dec 03, 12:03
x4

Post by swatti »

Sweet! Thx.

BTW: another engineer-mod has that pause-if-hit thingy so its doable. Nifty balancing-feature for faster repairs out-of-combat.
Jey123456
Posts: 259
Joined: Sat, 23. Nov 13, 09:48
x4

Post by Jey123456 »

i never said its not doable. I just said i do not like the idea :P.

Its incredibly easy to do actually, just an interrupt on damage and a timestamp
seedee
Posts: 78
Joined: Sat, 16. Sep 06, 05:38
x4

Post by seedee »

might have found a bug :

i've capped some taranis (in a kinda plot spot)

engineers started working, ships got attacked, seems they lost some modules
now, engineers all tell someting like that :

"blabla" (Dead Tired)
repairing null (null) about 1% every 0.000xxxxxx seconds, xx parts left to repair

xx parts between 10 and 51, so they still have lots to do
nothing is getting repaired, i've waited 30mins now in a far away zone where no ennemies spawn
tried waiting IS and OOS


i thought about commenting out

Code: Select all

					<!-- First lets check if were still busy or not --> 
					<do_if value="($deltaRepair lt $EngineerRepairDelay) or ($deltaWreckRestore lt $EngineerWreckRestoreDelay)" >
						<do_if value="$deltaMorale gt $EngineerMoralRate" >
							<set_value name="$lastEngineerMorale" exact="player.age"/>
							<set_value name="$morallevel" operation="subtract" exact="$moralDec" />
						</do_if>
						<resume label="iteration" /> <!-- were busy, check back next iteration -->
					</do_if>
but i fear i would break everything has they would only apply a single tick, i'll try to understand your code to see where you define what to repair and check if the thing is still there or not
Jey123456
Posts: 259
Joined: Sat, 23. Nov 13, 09:48
x4

Post by Jey123456 »

mmm, that strange. It would mean that its list of module to repair isnt properly cleaned up (iirc, it should remove them from the list when they are null or nonavailable but apparently something broke on that side heh).

Return to “X Rebirth - Scripts and Modding”