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

I'm not sure i understand what you meant in that reply heh. You want to offer me that ?
csaba
Posts: 1257
Joined: Fri, 26. Aug 05, 22:39
x4

Post by csaba »

I think he used Google translator.

He might be refering to inventory items being used to repair parts of the ship. Like scrap metals and engine parts you can find with Long range scanning and salvaging containers on stations.
Anubitus
Posts: 693
Joined: Fri, 21. Jan 05, 00:44
x4

Post by Anubitus »

G3n0c1de wrote:I also couldn't replace some engineers, so I went into the save file and did this.

Make sure you have room on the Skunk, and back up your save.

Open your save with Notepad++, open the 'find' function, and either search for the engineer by name, or you can cycle through all of your assets by searching for owner="player". Find the engineer you want replaced.

You'll see something like this:

Code: Select all

<connection connection="npcconnection">
<component class="npc" macro="character_ar_female_dv_a_macro" connection="commandroomslot" name="Alison Takahashi" owner="player" page="10110" id="[0x10680d]">
<listeners>
<listener listener="[0x10665c]" event="killed"/>
<listener listener="[0x1067f6]" event="killed"/>
</listeners>
<offset>
<position x="193.682" y="41.4981" z="353.604"/>
<rotation yaw="21.0013" pitch="-8.51871" roll="3.91716"/>
</offset>
<skills visible="1">
<skill type="boarding" value="5"/>
<skill type="combat" value="5"/>
<skill type="engineering" value="5"/>
<skill type="leadership" value="5"/>
<skill type="management" value="5"/>
<skill type="morale" value="5"/>
<skill type="navigation" value="5"/>
<skill type="science" value="5"/>
</skills>
<entity type="engineer" control="1" customconversation="1"/>
<account id="[0xbb]" amount="778672085"/>
<npcseed bodyparts="3205760418" bonescales="2436034311" morphtargetweights="3245637089"/>
<npcanimation currentsequenceid="41" currentanimation="activeaa01"/>
<connections/>
</component>
</connection>
You can cut that whole block of code and the ship will be fine.

Now go find your ship. This is easier if you have employees on your ship. Find the section with the list of those employees, and paste in your engineer outside of those blocks. That would be after another employee's </connection> and before the next one's <connection connection="connection_npc05"> or whatever number it is.

I'm not sure if this is necessary, but delete the <blackboard> block if there is one.

The last thing you have to do is to change the line

Code: Select all

<connection connection="npcconnection">
to look like

Code: Select all

<connection connection="connection_npc05">
Make sure the number is between 01 to 05. And it can't be a number that one of your other employees has.

You can now save the file, and then load it in the game.

You'll now have that employee on the Skunk. Go to the ship they were on and then assign them again so the script will start correctly.
i have tried to do what you said, and i cant load the savegame now..

this is what i put in the file, could you please tell me what is wrong..?

Code: Select all

<connection connection="npcconnection_npc01">
<component class="npc" macro="character_ar_female_engineer_macro" connection="commandroomslot" name="Yannet Poler" owner="player" page="10110" id="[0x35373]">
<listeners>
<listener listener="[0x34d69]" event="killed"/>
<listener listener="[0x3c7b3]" event="killed"/>
</listeners>
<offset>
<position x="-1.23968" y="-0.0014767" z="-0.205711"/>
<rotation yaw="150"/>
</offset>
<skills visible="1">
<skill type="boarding" value="3"/>
<skill type="combat" value="4"/>
<skill type="engineering" value="5"/>
<skill type="leadership" value="4"/>
<skill type="management" value="3"/>
<skill type="morale" value="4"/>
<skill type="navigation" value="3"/>
</skills>
<entity type="engineer" control="1"/>
<account id="[0x5c]" amount="9940478557"/>
<npcseed bodyparts="1346227730" bonescales="747773663" morphtargetweights="3177543644"/>
<npcanimation currentsequenceid="41" currentanimation="activeaa01"/>
<connections/>
</component>
</connection>
<connections>
<connection connection="npcconnection_npc02">
<component class="npc" macro="character_ar_female_dv_a_macro" connection="commandroomslot" name="Natasha Kelly" owner="player" page="10104" id="[0x3c7b7]">
<listeners>
<listener listener="[0x34d69]" event="killed"/>
<listener listener="[0x3c7b3]" event="killed"/>
</listeners>
<offset>
<position x="-1.23968" y="-0.0014767" z="-0.205711"/>
<rotation yaw="150"/>
</offset>
<skills visible="1">
<skill type="boarding" value="3"/>
<skill type="combat" value="4"/>
<skill type="engineering" value="5"/>
<skill type="leadership" value="4"/>
<skill type="management" value="3"/>
<skill type="morale" value="4"/>
<skill type="navigation" value="3"/>
</skills>
<entity type="engineer" control="1" customconversation="1"/>
<account id="[0x5c]" amount="9940478557"/>
<npcseed bodyparts="3128151118" bonescales="3467351722" morphtargetweights="2885918606"/>
<npcanimation currentsequenceid="41" currentanimation="activeaa01"/>
<connections/>
</component>
</connection>
<connection connection="npcconnection_npc03">
<component class="npc" macro="character_ar_male_dv_b_macro" connection="commandroomslot" name="Charles Vasquez" owner="player" page="10101" id="[0x34ebe]">
<listeners>
<listener listener="[0x34d69]" event="killed"/>
<listener listener="[0x34ea9]" event="killed"/>
</listeners>
<offset>
<position x="-179.33" y="99.2293" z="515.917"/>
<rotation yaw="-60.1919" pitch="11.6188" roll="0.607351"/>
</offset>
<skills visible="1">
<skill type="boarding" value="1"/>
<skill type="combat" value="2"/>
<skill type="engineering" value="4"/>
<skill type="management" value="3"/>
<skill type="navigation" value="3"/>
<skill type="morale" value="4"/>
<skill type="science" value="2"/>
</skills>
<entity type="engineer" control="1" customconversation="1"/>
<account id="[0x5c]" amount="9940478557"/>
<npcseed bodyparts="2177810862" bonescales="980041264" morphtargetweights="2006922902"/>
<npcanimation currentsequenceid="2" currentanimation="idleaa10"/>
<connections/>
</component>
</connection>
<connection connection="npcconnection_npc04">
<component class="npc" macro="character_teladi_m_a" connection="commandroomslot" name="Rudilis Tissmaneos Yalamandis IV" owner="player" page="10303" id="[0x354ab]">
<listeners>
<listener listener="[0x34d69]" event="killed"/>
<listener listener="[0x3549e]" event="killed"/>
</listeners>
<offset>
<position x="-1.23968" y="-0.0014767" z="-0.205711"/>
<rotation yaw="150"/>
</offset>
<skills visible="1">
<skill type="combat" value="2"/>
<skill type="engineering" value="5"/>
<skill type="leadership" value="3"/>
<skill type="morale" value="4"/>
<skill type="science" value="3"/>
</skills>
<entity type="engineer" control="1" customconversation="1"/>
<account id="[0x5c]" amount="9940478557"/>
<npcseed bodyparts="591794055" bonescales="242543289" morphtargetweights="696841195"/>
<npcanimation currentsequenceid="2" nextsequenceid="2" currentanimation="idleaa02"/>
<connections/>
</component>
</connection>
<connection connection="connection_npc05">
<component class="npc" macro="character_ar_male_dv_b_macro" connection="commandroomslot" name="Nicholas Lieberwitz" owner="player" page="10105" id="[0x347ab]">
<listeners>
<listener listener="[0x34d69]" event="killed"/>
</listeners>
<offset>
<position x="-0.543898" y="-0.00266337" z="3.16857"/>
</offset>
<skills visible="1">
<skill type="boarding" value="5"/>
<skill type="engineering" value="4"/>
<skill type="leadership" value="5"/>
<skill type="morale" value="4"/>
<skill type="navigation" value="4"/>
</skills>
<entity type="marine" control="1" customconversation="1"/>
<account id="[0x5c]" amount="9940478557"/>
<npcseed bodyparts="1801679585" bonescales="3717795956" morphtargetweights="42347054"/>
<npcanimation nextsequenceid="32" currentanimation="activeaa01"/>
<connections/>
</component>
</connection>
the last NPC is one i hired and was on my ship before i made the changes..

EDIT: even just deleting the engineers from the ships crashes the game.. :(
BelarusBEL
Posts: 2
Joined: Fri, 29. Nov 13, 09:09

Post by BelarusBEL »

T Casada - yes.

if you have fleet - you need parts for fixing problems. This game have many products, parts ...

Engineer can use it .
G3n0c1de
Posts: 11
Joined: Tue, 26. Nov 13, 08:48

Post by G3n0c1de »

i have tried to do what you said, and i cant load the savegame now..

this is what i put in the file, could you please tell me what is wrong..?
Is Yannet Poler the first employee on the list? Because I think you might have pasted her outside the legal area.

Look at the instances of the code

Code: Select all

<connections>
and

Code: Select all

</connections>
Your entire employee list should be inside JUST ONE block of that.

Delete the

Code: Select all

<connections>
that's above the lines

Code: Select all

<connection connection="npcconnection_npc02"> 
<component class="npc" macro="character_ar_female_dv_a_macro" connection="commandroomslot" name="Natasha Kelly" owner="player" page="10104" id="[0x3c7b7]"> 
and put

Code: Select all

<connections>
above what you pasted so it's the first line.
Jey123456
Posts: 259
Joined: Sat, 23. Nov 13, 09:48
x4

Post by Jey123456 »

Ha i understand what you meant now on the parts thing. And while it sound like a cool idea, it would be overly complex to implement due to how cargo work (not all freighter can carry all cargo types), and if a ship ended up captured with no parts, he would be dead in the water without a ship to ship trading system first.


The idea itself is good, but not easily implementable in an usable fashion, thats why i gave limit to the engineer repair capability in this mod, he cant do perfect repairs, he can only patch things up, enough to get to a shipyard to get full repairs (which cost parts from the economy)
swatti
Posts: 1278
Joined: Sun, 7. Dec 03, 12:03
x4

Post by swatti »

Am i doing something wrong here?

Arawn, engineer, constructor-drones, cargo-drones, etc aboard but my engi wont repair its hull. Guns are up and so but hull wont repair... ??
Jey123456
Posts: 259
Joined: Sat, 23. Nov 13, 09:48
x4

Post by Jey123456 »

if you go close to the center of your ship, the engineer report will tell you how high this engineer can get your hull repaired.

Its not a 100% repair, its only emergency repairs, enough to keep people breathing and alive, but for full repairs you must go to a shipyard.
swatti
Posts: 1278
Joined: Sun, 7. Dec 03, 12:03
x4

Post by swatti »

Mind if i request a "full repair mod" since going to a shipyard is NOT an option... I tried, it doesnt work. Takes my money, fixes nothing.

Basicly a VERY SLOW but to a 100% repair once everything else is done. To avoid combat-auto-repair only active when engineer is "full of energy"

But seriously, without this, i cant fix my ships... I used to hate the repair-beam, now i miss it.
Jey123456
Posts: 259
Joined: Sat, 23. Nov 13, 09:48
x4

Post by Jey123456 »

open the extensions\ImprovedEngineer\aiscripts\engineer.ai.xml in a text editor of your choice.

locate

<set_value name="$EngineerRepairHullMaxPerc" exact="$EngineerRepairHullMaxPerc*(75+$skillbonusmaxrepair)/100"/>

and change it by
<set_value name="$EngineerRepairHullMaxPerc" exact="100"/>

tadam, you can fix to 100%. Do the same on EngineerRepairComponentMaxPerc if you want your components to also get fixed up to 100% without repair drones.
Anubitus
Posts: 693
Joined: Fri, 21. Jan 05, 00:44
x4

Post by Anubitus »

instead of hacking this topic for my own problems that have only remotely to do with this great script, i will be opening a topic for this problem of mine..

can be found here:

http://forum.egosoft.com/viewtopic.php? ... 99#4263999

thanks for your help guys, i hope you will help me further in the other topic, couse its still not working.. :(
User avatar
_nox_
Posts: 245
Joined: Tue, 3. Feb 04, 09:52
x4

Post by _nox_ »

Repair order is definitely not right in my experience. It's fixing weapons first - I want it to repair drone bay, jump drive and then shields, then everything else.

Thanks for this mod - it's a game changer.
No good deed goes unpunished.
Jey123456
Posts: 259
Joined: Sat, 23. Nov 13, 09:48
x4

Post by Jey123456 »

Yea i can confirm also having a repair order error, its most likely an inversion in one of the comparison heh. Its pretty constant in being inverted xD.

I just want to finish my WIP first, then ill come back to the improved engineer to add the few features (like engineer leveling and using repair drones on friendly capital ships in range), on both feature, remember that my goal is to keep it balanced, i do not want the engineer to be a set and forget then your ships are always at 100%, they are here to keep things working.
User avatar
_nox_
Posts: 245
Joined: Tue, 3. Feb 04, 09:52
x4

Post by _nox_ »

I'm going to fix it locally and I'll happily send you the diff if you want or not.

I'm nox, from the mount and blade forums, author of the Bandit King mod for M&B and one time Taleworlds dev.

I've been waiting for X:R for a while now =)
No good deed goes unpunished.
balogt
Posts: 773
Joined: Thu, 18. Dec 03, 09:00
x3

Post by balogt »

sadly the mod is not working. the engineer will fix the skunk but not the cap ship he is assignd to..i have construction uavs as well. stil nothing.
mitasamodel
Posts: 12
Joined: Tue, 26. Nov 13, 15:01
x4

Post by mitasamodel »

balogt wrote:sadly the mod is not working. the engineer will fix the skunk but not the cap ship he is assignd to..i have construction uavs as well. stil nothing.
Check if you have mod "Upclose Detailed Monitor v1.2" installed. They don't work together.
User avatar
_nox_
Posts: 245
Joined: Tue, 3. Feb 04, 09:52
x4

Post by _nox_ »

The mod works fine - there's a mod that interferes with it though.

The upclose_detailed_monitor causes engineer AI to break, for some unknown reason.

Once you get the mod you may have to hire new engineers or reassign them.
No good deed goes unpunished.
Jey123456
Posts: 259
Joined: Sat, 23. Nov 13, 09:48
x4

Post by Jey123456 »

i did not check in details, but "Upclose Detailed Monitor v1.2" seem to override the code that assign the script to the engineer (which would break most if not all engineer ai, including the vanilla (non functional that i know off but still) one.
balogt
Posts: 773
Joined: Thu, 18. Dec 03, 09:00
x3

Post by balogt »

i dont have that mod installed. one hint down :)
Jey123456
Posts: 259
Joined: Sat, 23. Nov 13, 09:48
x4

Post by Jey123456 »

well, as i said multiple times, if you go very close to the center of your ship, the engineer will give you a report, its a pretty much foolproof way to test if the engineer is doing his work or not. (if the mod didnt activate properly, then you wont get any message in the bottom right).

Return to “X Rebirth - Scripts and Modding”