[MOD] Station Engineers

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

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

w.evans
Posts: 2963
Joined: Tue, 18. Nov 14, 16:23
x4

Post by w.evans » Mon, 2. Feb 15, 11:41

2.Feb.2015 - v0.01_alexalsp is up!

alexalsp reported that stations were taking too long to repair. (longer than ~8 hours for fully destroyed stations.) v0.01_alexalsp increases the amount by which Engineer skill of player-owned station-based Engineers increases the rate of repair. (was a factor of 0.8 to 4.0, now a straight multiplier from 20 to 100)

Rather cheaty at the moment. Would prefer to find a decent balance which would then be applied to all station-based Engineers -- player-owned and NPC.

........
The alexalsp variant adds:

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<diff>
    <remove sel="/aiscript/attention/actions/set_value[@exact='$repairratefactor * this.combinedskill / 25']"/>

    <add sel="/aiscript/attention/actions/set_value[@name='$repairrate']" pos="before">
        <do_if value="this.defensible.isclass.station and (this.owner == faction.player)">
            <set_value name="$repairratefactor" operation="add" exact="$repairratefactor * this.combinedskill"/>
            <show_notification caption="'=== Station Repair Rate ==='" details="'%5 \n Repairing: %6 \n Raw Repair Rate: %2 \n Engineer Skill: %3 \n Repair Rate Factor: %1 \n Resultant Repair Rate: %4'.[$repairratefactor, $baserepairrate, this.combinedskill, ($baserepairrate * $repairratefactor), this.station.name, (100f * ($baserepairrate * $repairratefactor) / $Defensible.maxhull)]" queued="true" priority="7" sound="notification_generic"/>
            <write_to_logbook category="general" text="'%5 STATION REPAIR RATE: \n Repairing: %6 \n Raw Repair Rate: %2 \n Engineer Skil: %3 \n Repair Rate Factor: %1 \n Resultant Repair Rate: %4'.[$repairratefactor, $baserepairrate, this.combinedskill, ($baserepairrate * $repairratefactor), this.station.name, (100f * ($baserepairrate * $repairratefactor) / $Defensible.maxhull)]"/>
        </do_if>
        <do_else>
            <set_value name="$repairratefactor" operation="add" exact="$repairratefactor * this.combinedskill / 25" comment="engineer speeds up repair by up to 400% (meaning a fifth of the normal repair time)" />
            <!--<show_notification caption="'=== Ship/NPC Repair Rate ==='" details="'Repairing: %5 \n Raw Repair Rate: %2 \n Engineer Skill: %3 \n Repair Rate Factor: %1 \n Resultant Repair Rate: %4'.[$repairratefactor, $baserepairrate, this.combinedskill, ($baserepairrate * $repairratefactor), (100f * ($baserepairrate * $repairratefactor) / $Defensible.maxhull)]" queued="true" priority="7" sound="notification_generic"/>
            <write_to_logbook category="general" text="'SHIP REPAIR RATE: \n Repairing: %5 \n Raw Repair Rate: %2 \n Engineer Skill: %3 \n Repair Rate Factor: %1 \n Resultant Repair Rate: %4'.[$repairratefactor, $baserepairrate, this.combinedskill, ($baserepairrate * $repairratefactor), (100f * ($baserepairrate * $repairratefactor) / $Defensible.maxhull)]"/>-->
        </do_else>
    </add>
</diff>
to aiscripts/engineer.ai.xml

Still a lot of PDA and logbook spew at the moment to verify that the alteration is indeed working. Will be taken out once the increase is found to be satisfactory. If you want to take it out, simply comment out the <show_notification ... /> and <write_to_logbook ... /> lines.

edit: Also verified that the vanilla bug with Construction URVs failing to dock/docked Construction URVs not being made available is causing repair slowdowns -- subsequent repairs do not count those Construction URVs. Working on a fix now.

edit 2: fixed the problem mentioned in "edit:" here. Decided to implement the fix in a separate mod (and do tiny mods in general) to maintain modularity. (Is that a word? Modularness? Modulärheit?)

w.evans
Posts: 2963
Joined: Tue, 18. Nov 14, 16:23
x4

Post by w.evans » Thu, 5. Feb 15, 16:36

Was wondering why there are more people downloading Station Engineers than Engineer Drone Fix. Would have expected the opposite since Station Engineers adds something which isn't in vanilla (which, I imagine, not everyone would want), while Engineer Drone Fix is really nothing more than a workaround for a vanilla bug.

So, on the off-chance that this is due to a failure to communicate on my part, I would like to clarify that the Fix in Engineer Drone Fix is NOT included in Station Engineers.

I did it this way to maintain modularity -- so you could decide what you want in your game and what not. It's your game, so your call. Not for me to decide how you should play.

Rubini
Posts: 452
Joined: Mon, 7. May 07, 05:17
xr

Post by Rubini » Thu, 5. Feb 15, 16:57

Probably because Station Engineers have a mod "sattatus". I´m using both and they are great and working as intend. :wink:

Sparky Sparkycorp
Moderator (English)
Moderator (English)
Posts: 8074
Joined: Tue, 30. Mar 04, 12:28
x4

Post by Sparky Sparkycorp » Mon, 9. Feb 15, 00:36

Hi there,

Just to note, whilst I could assign an Engineer to my plot station from space, I wasn't able to while docked via remote conversation. Not a big deal but might be worth mentioning in the OP (I've no idea yet if plot-specific).

Regards,
Sparks

w.evans
Posts: 2963
Joined: Tue, 18. Nov 14, 16:23
x4

Post by w.evans » Mon, 9. Feb 15, 00:41

Always fired them off from the Skunk myself. Thanks for the report! Will update the op.

Sparky Sparkycorp
Moderator (English)
Moderator (English)
Posts: 8074
Joined: Tue, 30. Mar 04, 12:28
x4

Post by Sparky Sparkycorp » Mon, 9. Feb 15, 00:42

Me too normally. I tend not to be able to resist docking at the plot station though :)

w.evans
Posts: 2963
Joined: Tue, 18. Nov 14, 16:23
x4

Post by w.evans » Mon, 9. Feb 15, 00:48

Yeah. That is a special moment. Especially in the first playthrough. Although I shudder at the thought of the first playthrough of those who braved through X:R 1.0

I remember the very first time I got to that point, I literally sat there and occasionally flew around it in a drone to see it being built up close, until it was done. Then I docked, and there was no one there, which kind of sucked, but there was a special feeling knowing that those empty corridors were mine. Come to think of it, might have done that the second time too.

lubatomy
Posts: 234
Joined: Mon, 29. Dec 03, 15:22
x4

Post by lubatomy » Mon, 16. Feb 15, 14:36

w.evans wrote:Always fired them off from the Skunk myself. Thanks for the report! Will update the op.
this can be fixed in the <do_if....> line right above the one you change in the mod.

it does a check to see if the platform is player owned and isclassship. if you check for player owned and (isclassship or isclassstation) that should fix it to allow assigning an engineer to a station while you are in the station. I have not tested it myself but it seems like it should do the trick.

w.evans
Posts: 2963
Joined: Tue, 18. Nov 14, 16:23
x4

Post by w.evans » Mon, 16. Feb 15, 14:51

Thanks, lubatomy! Added:

Code: Select all

<replace sel="//cue[@name='OnBoardComm']/actions/do_if[@value='@player.platform.container.isplayerowned and @player.platform.container.isclass.ship']/@value">@player.platform.container.isplayerowned and (@player.platform.container.isclass.ship or @player.platform.container.isclass.station)</replace>
to NPC_Engineer.xml

Long time no see. How's your big project coming along?

w.evans
Posts: 2963
Joined: Tue, 18. Nov 14, 16:23
x4

Post by w.evans » Mon, 16. Feb 15, 15:41

16.Feb.2015 - v0.02 is up!

Now possible to call Engineers to work at a station platform when docked.

Thanks to Sparky Sparkycorp for reporting that this wasn't working before! Thanks to lubatomy for the fix!

lubatomy
Posts: 234
Joined: Mon, 29. Dec 03, 15:22
x4

Post by lubatomy » Mon, 16. Feb 15, 15:47

w.evans wrote:Thanks, lubatomy! Added:

Code: Select all

<replace sel="//cue[@name='OnBoardComm']/actions/do_if[@value='@player.platform.container.isplayerowned and @player.platform.container.isclass.ship']/@value">@player.platform.container.isplayerowned and (@player.platform.container.isclass.ship or @player.platform.container.isclass.station)</replace>
to NPC_Engineer.xml

Long time no see. How's your big project coming along?
not really moving much. been busy so Instead i been doing small things here and there and trying to fix some of the changes i have made for "quality of life" purposes in my own game. mostly trying to take the changes from being .pck files to being actual patches as an extension so that i can use some other mods without having to worry about screwing things up royally. of course the cold weather and snow is not helping cause that means the kids stay home from school when it gets canceled and the wife stays home from work which means honey do lists with direct supervision.

w.evans
Posts: 2963
Joined: Tue, 18. Nov 14, 16:23
x4

Post by w.evans » Mon, 16. Feb 15, 15:58

lubatomy wrote:honey do lists with direct supervision.
Ha! Those can be fun. Had something like two days of snow here over the whole winter, and a night which melted immediately the next day. Kinda sucks, although too much snow is a bigger problem.

User avatar
eMYNOCK
Moderator (DevNet)
Moderator (DevNet)
Posts: 2059
Joined: Thu, 21. Aug 03, 10:37
x4

Post by eMYNOCK » Mon, 16. Feb 15, 19:48

@w.evans

Code: Select all

<?xml version="1.0" encoding="UTF-8"?> 
<diff>
<replace sel="//do_if[@value='@player.platform.container.isplayerowned and @player.platform.container.isclass.ship']/@value">@player.platform.container.isplayerowned</replace>
</diff>
Place these few strings in your NPC_engineer.xml diff, land at the station administration, call a engineer on your ship and enjoy the cutscene.

works for me since 29.12.'13 (file signature on my NPC_engineer)

regards

w.evans
Posts: 2963
Joined: Tue, 18. Nov 14, 16:23
x4

Post by w.evans » Mon, 16. Feb 15, 19:58

Hi eMYNOCK,

You're right.

Code: Select all

@player.platform.container.isplayerowned and (@player.platform.container.isclass.ship or @player.platform.container.isclass.station)
is redundant because there aren't any other valid container classes. Changing the code, and including in the next update. Thanks!

edit: wait, since 2013? Have you had a mod that does what this does since 2013?

User avatar
eMYNOCK
Moderator (DevNet)
Moderator (DevNet)
Posts: 2059
Joined: Thu, 21. Aug 03, 10:37
x4

Post by eMYNOCK » Mon, 16. Feb 15, 20:05

Just for personal use and just a single file.. but yes.. since 2013.

w.evans
Posts: 2963
Joined: Tue, 18. Nov 14, 16:23
x4

Post by w.evans » Mon, 16. Feb 15, 20:12

Cool! Thanks!

_____
16.Feb.2015 - v0.03 is up!

Swapped my cludgy code for eMYNOCK's svelte and sexy code. (Thanks eMYNOCK!)

Saquavin
Posts: 486
Joined: Thu, 22. Aug 13, 17:12
xr

Post by Saquavin » Mon, 23. Feb 15, 23:24

Awesome mod !

I'm pissed off seeing my stations' weapon systems getting lowered time after time, for some oos combat I'm not aware of.

Can you please make your mod available on steam workshop, so that it will get upgraded automaticaly when you make new release ?

w.evans
Posts: 2963
Joined: Tue, 18. Nov 14, 16:23
x4

Post by w.evans » Mon, 23. Feb 15, 23:59

Hi Saquavin,

Glad you like it!

I haven't uploaded it to the Steam Workshop because, well, it isn't really much of a mod. That first code block in the OP really is the entire thing. Was more of a "wonder if this'll work... wtf!" which I thought I'd share in case anyone else wants the same functionality in their game.

I don't anticipate it needing much by way of maintenance or updates since it's so simple unless EgoSoft changes engineer.ai.xml such that the xpaths change. And in case I do update, I always announce it here in another post, so you should get a notification if you're watching the thread.

About oos combat, are you running the beta? OOS combat seems a lot more sensible in 3.50 beta 1. I also have a mod over here that has a couple of tweaks for OOS combat that might be of interest.

Saquavin
Posts: 486
Joined: Thu, 22. Aug 13, 17:12
xr

Post by Saquavin » Tue, 24. Feb 15, 00:48

I confirm it works, and yes, I'm running 3.50 B1.
I have assigned one engineer for each of my 4 stations, for about 1 hour now.
- My 2 engineers on young stations were on "analysing components" => fine, stations are newly built and have not been damaged.
- My 2 engineers on old stations were successfully repairing components like "bulk tube" or "zoltek appartment" => omfg I love you ;)

For now, I'm still testing the beta vanilla oos combat system, maybe I will go on your other mod if oos is still annoying me.

I will keep an eye on your thread, but for now, engineer station state is perfect in 3.50 B1.

oliverjanda
Posts: 309
Joined: Sun, 14. Feb 10, 17:47
xr

Post by oliverjanda » Thu, 12. Mar 15, 19:59

@w.evans
Where can I file a complaint about this mod not being on steam? :)

Post Reply

Return to “X Rebirth - Scripts and Modding”