[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

seedee
Posts: 78
Joined: Sat, 16. Sep 06, 05:38
x4

Post by seedee »

i've searched my save file, here is the script part of one of the two bugged engineers :

Code: Select all

<script id="3596" name="engineer.ai" label="iteration" time="212927" index="1">
<command type="repair"/>
<vars>
<value name="$damagedelements" type="group" value="2963"/>
<value name="$debugoutputchance" type="integer" value="100"/>
<value name="$lastEngineerDebug" type="string" value="715"/>
<value name="$lastEngineerDrone" type="time" value="212898"/>
<value name="$lastEngineerMessage" type="string" value="32311"/>
<value name="$lastEngineerMessageTime" type="time" value="212725"/>
<value name="$lastEngineerMorale" type="time" value="212926"/>
<value name="$lastEngineerRepair" type="time" value="212919"/>
<value name="$lastEngineerStatus" type="time" value="212897"/>
<value name="$lastEngineerWreckRestore" type="time" value="207181"/>
<value name="$morallevel" type="float" value="25"/>
<value name="$networkid"/>
<value name="$nextRepairTarget" type="component" value="[0x0]"/>
<value name="$nextRepairTargetValue" type="integer" value="4305"/>
<value name="$repairrate" type="float" value="776.25"/>
<value name="$thisRepairTargetValue" type="integer" value="5"/>
<value name="$welderdronesLaunched" type="integer" value="1"/>
<value name="$welderdronesScore" type="integer"/>
<value name="$wreckedelements" type="group" value="2400"/>
</vars>
i tested deleting
<value name="$nextRepairTarget" type="component" value="[0x0]"/>
and in
<value name="$nextRepairTargetValue" type="integer" value="4305"/>
the value="4305" part
engineer starts working again





the other one is quite different as it lacks "lextrepairtarget" var, but is stuck too
this one is OOS since a long time ago

Code: Select all

<script id="3497" name="engineer.ai" label="iteration" time="212927" index="1">
<command type="repair"/>
<vars>
<value name="$damagedelements" type="group" value="904"/>
<value name="$debugoutputchance" type="integer" value="100"/>
<value name="$lastEngineerDebug" type="string" value="1197"/>
<value name="$lastEngineerDrone" type="time" value="212926"/>
<value name="$lastEngineerMessage" type="string" value="32321"/>
<value name="$lastEngineerMessageTime" type="time" value="190964"/>
<value name="$lastEngineerMorale" type="time" value="212922"/>
<value name="$lastEngineerRepair" type="time" value="212927"/>
<value name="$lastEngineerStatus" type="time" value="212925"/>
<value name="$lastEngineerWreckRestore" type="time" value="200747"/>
<value name="$morallevel" type="float" value="25"/>
<value name="$networkid"/>
<value name="$nextRepairTargetValue" type="integer"/>
<value name="$repairrate" type="float" value="1181.25"/>
<value name="$thisRepairTargetValue" type="integer" value="5"/>
<value name="$welderdronesLaunched" type="integer" value="1"/>
<value name="$welderdronesScore" type="integer"/>
<value name="$wreckedelements" type="group" value="385"/>
</vars>
here, i tried deleting
<value name="$nextRepairTargetValue" type="integer"/>
didn't do the trick
i deleted everything but
<vars>
<value name="$morallevel" type="float" value="125"/>
<value name="$networkid"/>
<value name="$repairrate" type="float" value="1181.25"/>
<value name="$welderdronesScore" type="integer"/>
</vars>
and it started repairing the hull (some elements are still wrecked)
seedee
Posts: 78
Joined: Sat, 16. Sep 06, 05:38
x4

Post by seedee »

i think i found the "smudge"

as the nextrepairtargetvalue on the two IS bugged guys were skyrocking high, maybe it comes from there :

<!-- Alright, now our menial tasks are done, lets get cracking -->
<set_value name="$hullEqualisationBonus" exact="0"/> <!-- when an object sharing the same class as the current repair target has less shield percentage than itself, it will gain this much bonus score to encourage its selection-->
<do_if value="$nextRepairTarget?">
<set_value name="$nextRepairTargetValue" operation="add" exact="10"/>

i'm wondering if the <do_if value="$nextRepairTarget?"> is only checking if value exist ?
maybe add a statement to check if value is different from null ?
(don't remember how to do that)


edit :
btw, seems like the NPCs are on strike too, the HoA guys who were fighting near me are also screwed :')
seedee
Posts: 78
Joined: Sat, 16. Sep 06, 05:38
x4

Post by seedee »

found a way to fix that kind of infinite loop
it's the hard and crappy way, by the way, there may be some better way to do that, but it's something ! :p

i added this just after your "check if we're busy" lines :

Code: Select all

					<do_if value="$nextRepairTargetValue gt 3000"> <!-- PROBLEM ? -->
						<remove_value name="$nextRepairTarget"/>
						<set_value name="$morallevel" exact="100f"/> 
						<remove_value name="$nextRepairTargetValue"/>
						<resume label="iteration" /> <!-- ALARM ! let's try again -->
					</do_if>
"if anything breaks, reset everything !"

currently testing that thing, it seems to work, the bugged arawn started to rebuild its turrets
(i'm wondering why they're rebuilding turrets and shields before engines that get rebuild last, it's not consistent with the values :x)

btw, funny thing :
that poor HoA engineer has 123 parts and 80% hull to repair on that arawn. I think he's gonna die :p
andrewas
Posts: 1498
Joined: Thu, 10. Mar 05, 21:04
x3tc

Post by andrewas »

Turrets get rebuilt first because wrecked components are all of class 'destructible' rather than 'engine', 'turret' or so on, which breaks the component prioritization code. Theres a patch for that on page 10.
Nikita
Posts: 21
Joined: Mon, 9. Feb 04, 11:34
x2

Post by Nikita »

Okay, I'm a noob at mods and this is the first one I've installed - but nothing seems to be happening at all - what am I doing wrong?

I didn't have an 'extensions' folder, so made one in the right place, downloaded and upzipped the mod folder into it and it shows up okay in the games 'extensions' menu. It's also turned 'on'.

(For info I'm using ver 1.21 of the game and the save games I'm loading are from that version - the mod I downloaded was supposed to be ver 0.98 but on the extensions screen is says 0.00 - is that correct?)

However, I have about 20 ships in my fleet so far and not one of them appears to be doing any repairing at all - even those with construction drones.

I really wanted this to work as most of my ships are captured and have damaged engines and 75% hulls - but nothing so far (after around 45mins in game after mod installation). I've made a back-up of my save files just in case but can anyone let me know what I might be doing wrong?

I've even taken into account the stock timings on repairs - between 8-15 minutes for 1% repair (I believe that's what it is from an earlier post) so after 45 mins would have expected to see the engines or hull on at least some ships getting 'repaired'.

All the ships have engineers but on the 'info' tab - every engineer apart from the one on the Skunk have orders as 'none' - the AS one has 'repair' - and in the comm menu for the engineer, there is no option to change it.

Jey - I've read all of this thread and the trade one - you're the first person who's extensions I've trusted - good work! (hope I can get this working)
Nikita
Posts: 21
Joined: Mon, 9. Feb 04, 11:34
x2

Post by Nikita »

Just checking back in after about an hour today in game - it would appear that since installing the mod, repairing seems to have stopped all together.

My Balor was attacked by a Reiver ship - dropped to 71% hull and has now stopped on 71% since the attack. I even replaced the engineer with a better one - but this didn't work either.

I'm hoping someone will tell me it's something simple - or does it not work with 1.21 patch?

*edit

Disabled the extension and removed the line from save game file, reloaded and Balor engineer showing 'repairing' status and repair commences and finishes at 75%. With the mod on, nothing happens at all. Would the fact that the version showing installed lists as 0.00 rather than 0.98 or is that just 'cosmetic'? I want to make sure I got the correct version off the nexus website.
Wana
Posts: 274
Joined: Sun, 27. Jun 10, 15:46
x3ap

Post by Wana »

Do not use this mod right now, 1.21 or 22 repaired the non-working engineers, but killed that mod.

as modders are now away from XR, be extremely careful when you intall a mod. check if this works, and check the logfile for errors.

for example, i have crashes due to even Fight reloaded (before i patched it) or More ennemies. i uninstalled More Ennemies, but i don't know what caused crashes, and modders don't work on these titles anymore.

Removing the mod's line in your savegame is not guaranteed a full uninstallation. that's why i aked mad_J to kindly provide us an uninstall script for UFO, which he did quite fast.

so, yes it's sad, but many mods are non-working, or bugfest.

This mod seems legit, but right now, stick with the natural super-engineer from Egosoft. ;)
Nikita
Posts: 21
Joined: Mon, 9. Feb 04, 11:34
x2

Post by Nikita »

That's a real shame as I was looking forward to getting my ships up to 100%. However, now that the campaign has unlocked due to the station being built, I haven't looked at my fleet for hours - I'm over trying to find the Split base!

I was looking forward to Jey's full re-write of the trading / economy script though as it is truly broken - however, you never know, maybe Egosoft will surprise us with a New Years gift of a working economy and real trade?
docwho83
Posts: 168
Joined: Mon, 15. Jun 09, 23:10
x4

Post by docwho83 »

ai script is not simply. lol

anyway I hit this bug I think it is know but I can't seam to find away to make engineer repair them. It missed the external radar on my caped Balor = units_size_l_single_attack_ship

Code: Select all

<connection connection="connection_radar_external01" macro="connection_radar_external01">
<component class="radar" macro="radar_ship_l_military_01_macro" connection="connection_component01" state="wreck" attacker="[0xb3f8]" attackmethod="hitbybullet" attacktime="35331.1" id="[0xae49]">
<listeners>
<listener listener="[0xb404]" event="killed"/>
</listeners>
I saw improved engineer that class.radar was missing so I added a line for both damaged and wreck. Dose not repair said radar. I keep blowing up a turret to make sure it is still repairing. Which the engineer dose nicely. Since I also see that this is the external version I try adding in an radar_external class. nope

I can force fix it in the save but I would like to make the game fix it. Made changes to the script so I have 100% on hull and components.
My Mods
RepairLasers Player controlled drone Also on steam
[Minefield] fell affliction minefield removed Also on steam
[Buildmodule] add research for buildmodule leak steals
Valtarien
Posts: 46
Joined: Sun, 25. Aug 13, 08:02
x4

Post by Valtarien »

There are a lot of good ideas here, but I strongly suspect this is no longer supported for the recent iteration of the game (v2.51 as of this writing). Is there any interest in reviving this one?

Return to “X Rebirth - Scripts and Modding”