Repair laser = Aggressive action? Mod (maybe) to fix this?

The place to discuss scripting and game modifications for X³: Terran Conflict and X³: Albion Prelude.

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

Jaycen_Aelis
Posts: 138
Joined: Sat, 14. Apr 12, 18:25
x3tc

Repair laser = Aggressive action? Mod (maybe) to fix this?

Post by Jaycen_Aelis » Tue, 10. Jul 12, 17:38

So, I posted this over in the X-Universe section, and apparently it didn't belong there--so I'm trying again here:
In some weird twist of fate, using the repair laser on allied (but not owned) ships will piss them off. Found this out the hard way, doing an escort mission for several freighters ([OT] is there a way to get multi-freighter escorts to fly in formation? they pop around all over the sector and it's really a pain to keep track of [/OT]) and it was worth 50,000, so I really wanted to keep everybody alive.

Anyway, one of the freighters got heavily damaged, and I didn't want to lose the mission...he was going slow enough though that I could strafe next to him in my space suit--so I figured I'd fire up my repair laser and fix him up. He started complaining. Not wanting to lose the mission because I pissed off my customer, I bailed and hot-footed it back to my ship.

You can guess what happened next. He got blasted and I lost the mission anyway. Help?
Argon Explorer

Cycrow
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 22227
Joined: Sun, 14. Nov 04, 23:26
x4

Post by Cycrow » Tue, 10. Jul 12, 17:44

theres no way to alter the behaviour of the repair laser
its basically a weapon, it just has a negative damage rating.

User avatar
Sam L.R. Griffiths
Posts: 10522
Joined: Fri, 12. Mar 04, 19:47
x4

Post by Sam L.R. Griffiths » Tue, 10. Jul 12, 20:16

It may be possible to implement a repair target ship script as an alternative.
Lenna (aka [SRK] The_Rabbit)

"Understanding is a three edged sword... your side, their side... and the Truth!" - J.J. Sheriden, Babylon 5 S4E6 T28:55

"May god stand between you and harm in all the dark places you must walk." - Ancient Egyption Proverb

"When eating an elephant take one bite at a time" - Creighton Abrams

GeneralMagnum
Posts: 19
Joined: Sat, 28. Jun 08, 14:45
x3

Post by GeneralMagnum » Thu, 12. Jul 12, 00:29

It should be noted that with this sort of modification you will perhaps never again be able to capture an ARAN, as the normal method applied uses an repair laser to make the ship hostile

EDIT : On second thought it should work with low damage lasers as well, but with the normally low hull it will more often end catastrophic

User avatar
Jack08
Posts: 2993
Joined: Sun, 25. Dec 05, 10:42
x3tc

Post by Jack08 » Thu, 12. Jul 12, 05:08

GeneralMagnum wrote:It should be noted that with this sort of modification you will perhaps never again be able to capture an ARAN, as the normal method applied uses an repair laser to make the ship hostile

EDIT : On second thought it should work with low damage lasers as well, but with the normally low hull it will more often end catastrophic
Why? - Modifying the repair laser would be pointless as nothing you do would ever get the game to stop registering it as a hostile action. Therefor making a script to use instead is the only option. There is no way to tie the script to the repair laser it will have to be a hotkey.
[ external image ]
"One sure mark of a fool is to dismiss anything that falls outside his experience as being impossible."
―Farengar Secret-Fire

Blaank
Posts: 27
Joined: Wed, 23. Jan 13, 09:08
x3ap

Post by Blaank » Sat, 26. Jan 13, 04:17

Is there a mod that makes using a repair laser a non-hostile act?

Blaank
Posts: 27
Joined: Wed, 23. Jan 13, 09:08
x3ap

Post by Blaank » Sat, 26. Jan 13, 04:26

Wouldn't it be a simple change in the agro proc? Have it check if the attack is giving positive or negative damage and then aggro only if taking positive damage. That's, what, 10 lines of code?

User avatar
Jack08
Posts: 2993
Joined: Sun, 25. Dec 05, 10:42
x3tc

Post by Jack08 » Sat, 26. Jan 13, 04:52

Blaank wrote:Wouldn't it be a simple change in the agro proc? Have it check if the attack is giving positive or negative damage and then aggro only if taking positive damage. That's, what, 10 lines of code?
Read the thread from the top perhaps? "10 lines of code", In the C++ Engine.
[ external image ]
"One sure mark of a fool is to dismiss anything that falls outside his experience as being impossible."
―Farengar Secret-Fire

User avatar
DrBullwinkle
Posts: 5715
Joined: Sat, 17. Dec 11, 01:44
x3tc

Re: Repair laser = Aggressive action? Mod (maybe) to fix this?

Post by DrBullwinkle » Sat, 26. Jan 13, 06:57

Jaycen_Aelis wrote:Help?
As already discussed by two of the most knowledgeable people here, you will probably not get a change to the way that the repair laser in your space suit works.

However, it is entirely possible that you could get a script that helps to address the issue of damaged ships during escort missions. In order for that to happen, you would have to come up with a plausible "reason" to repair a non-player-owned ship. Also some balancing "cost"... so that the player does not run around patching up everybody's ships all of the time.

Sometimes you need a good story to inspire the script developers. Something with broader appeal than "I needed it on one mission". ;)

The vanilla answer, of course, is "avoid allowing your escorted ships to be damaged". I know... it is easier said than done. :)

In the meantime, in answer to your off-topic question, Gazz wrote Convoy Control to help address the issue of your convoy stretching out over dozens of kilometers. Convoy Control slows all of the ships in the NPC convoy to match the speed of your slowest ship. It may not entirely solve your "formation" problem, but it should help.

Tip: If you have enough ships, then you can assign one (or more) to "Attack target nearest" each ship in the convoy. That helps quite a bit with defending your convoy. (Give each of your escorting ships a few fighter drones -- they can be good "interceptors" in a tight situation. You will have to command the drones manually, of course.)

User avatar
RoverTX
Posts: 1436
Joined: Wed, 16. Nov 11, 18:37
x4

Post by RoverTX » Sat, 26. Jan 13, 07:14

As has been said before the game is written in C++. Which means it is compiled and not interpreted like JavaScript, PHP, Ruby(Normal kind).

So we end up with complied files and not the actually code. Which means you would need a decompiler or a disassembler (and knowledge of assembly language) in order to even start the process of modifying the game. (I didn't even know there was a difference between a decompiler and a disassembler till today. Learn something new everyday!)

I remember someone figured out how to do some type of injection into the game by identifying what amounts to a ruby 'eval' or 'send' statement some where in the code. And no it wasn't a FXAA 'injection'. Though it didn't exactly make things all that much easier from what I remember. Now where did I read that, or maybe they where saying injection but didn't mean it .... hmmm Anyway it would be a really big pain in the but when a script could do the same thing 10X easier.

It also might be hard because the repair laser its self isn't hard coded but is rather declared is TLasers, so you might have to do something hacky, or risk the 'mod' not working with other mods.
Last edited by RoverTX on Sat, 26. Jan 13, 07:21, edited 2 times in total.

Blaank
Posts: 27
Joined: Wed, 23. Jan 13, 09:08
x3ap

Post by Blaank » Sat, 26. Jan 13, 07:15

Are you saying people can't make a mod that checks if a number is negative and ends the proc instead of continuing with the hostility?

User avatar
RoverTX
Posts: 1436
Joined: Wed, 16. Nov 11, 18:37
x4

Post by RoverTX » Sat, 26. Jan 13, 07:18

http://en.wikipedia.org/wiki/Interpreted_language

http://en.wikipedia.org/wiki/Compiled_language

The mods you see out there are mods of files that are not complied. Ie resource files, scripts, models, directors, textures etc etc. What your looking to do is 'hardcoded' which means it complied and not realistically moddable with out an stupid amount of work and/or software/resources/knowledge.

I am over simplifying somewhere but what ever.

A5PECT
Posts: 6149
Joined: Sun, 3. Sep 06, 02:31
x4

Post by A5PECT » Sat, 26. Jan 13, 07:19

Blaank wrote:Are you saying people can't make a mod that checks if a number is negative and ends the proc instead of continuing with the hostility?
There is no such thing as a variable "proc" as far as X3 is concerned.

There's only one proc for lasers, and that's hostility. The game engine isn't designed to do anything else when a laser hits a target.

As stated above, it isn't some easily found, easily modified value that you can switch on and off.
Admitting you have a problem is the first step in figuring out how to make it worse.

Blaank
Posts: 27
Joined: Wed, 23. Jan 13, 09:08
x3ap

Post by Blaank » Sat, 26. Jan 13, 07:28

I didn't know modding was that limited. I've only worked with source code before and this would be a super-easy fix. I don't have words that can express any further.

User avatar
Jack08
Posts: 2993
Joined: Sun, 25. Dec 05, 10:42
x3tc

Post by Jack08 » Sat, 26. Jan 13, 07:40

Blaank wrote:I didn't know modding was that limited. I've only worked with source code before and this would be a super-easy fix. I don't have words that can express any further.
The X Engine is made up of 3 layers.

You have the C++ Engine
the KC Engine
and finally the SE/MD Engine(s).

The C++ Engine is responsible for loading the game data assets, as well as everything that happens in sector (firing weapons, hit detection, hit processing, etc)

the KC engine is responsible for everything that happens in the entire galaxy, it has direct but limited control over the C++ engine and is not capable of intercepting any damage "proc" from the in sector engine. It does however process all out of sector simulation.

The SE/MD engines are built within the KC engine, which give direct control over the galaxy engine, but no direct control over the sector engine. Again, you can effect the sector engine with its commands but you cant directly change its behavior on any fundamental level.

In order to make the change your describing, it would take an in memory patch of the C++ engine, which is something that is extremely hard to do - and something i have attempted myself (and failed, miserably :D) ... The biggest problem is identifying the code you need to change. Unlike C, Compiled C++ Code is completely obfuscated, there are no readable function names, and infact the only thing that you can read would be static strings. This makes reverse engineering to find a jump patch point extremely difficult.

TL;DR: Its never going to happen unless egosoft themselves make it happen, as its been said by almost everyone in the thread, a script is the only option.
Last edited by Jack08 on Sat, 26. Jan 13, 07:45, edited 1 time in total.
[ external image ]
"One sure mark of a fool is to dismiss anything that falls outside his experience as being impossible."
―Farengar Secret-Fire

User avatar
jack775544
Posts: 1277
Joined: Tue, 13. Dec 11, 08:27
x4

Post by jack775544 » Sat, 26. Jan 13, 07:44

Yes for that type of editing you would need to edit the KC code (the games C++ engine code). This is possible as mods such as Time of the Truth and the upcoming X-Timelines has shown (the KC edits X-Timelines were done by Jack08 who replied to this thread before). However you have to disassemble it which makes Assembly Code. So if you wish to edit the assembly code you can.

EDIT: Ninja'd by Jack08
1940s - Various "computers" are "programmed" using direct wiring and switches. Engineers do this in order to avoid the tabs vs spaces debate.

Blaank
Posts: 27
Joined: Wed, 23. Jan 13, 09:08
x3ap

Post by Blaank » Sat, 26. Jan 13, 08:14

Would it be at all possible to make a script that will change the current HP of a specified ship?

User avatar
DrBullwinkle
Posts: 5715
Joined: Sat, 17. Dec 11, 01:44
x3tc

Post by DrBullwinkle » Sat, 26. Jan 13, 08:17

Blaank wrote:Would it be at all possible to make a script that will change the current HP of a specified ship?
That's easy. First of all, Marine Repairs does it.

Second, see my post, above. Give us a reason to do it.

User avatar
Jack08
Posts: 2993
Joined: Sun, 25. Dec 05, 10:42
x3tc

Post by Jack08 » Sat, 26. Jan 13, 08:19

Blaank wrote:Would it be at all possible to make a script that will change the current HP of a specified ship?
...

Yes.

(im sure we've said that a script can be used this way, plenty of times - :D )
[ external image ]
"One sure mark of a fool is to dismiss anything that falls outside his experience as being impossible."
―Farengar Secret-Fire

Blaank
Posts: 27
Joined: Wed, 23. Jan 13, 09:08
x3ap

Post by Blaank » Sat, 26. Jan 13, 08:31

Ok, so create a new gun used by the space suit and activated by a different key than the real repair laser so the real one doesn't fire. It has the same graphics but instead of dealing damage to the target it edits their HP.

I'm thinking you could come up with a way to check the range and line of fire and see if it collides with a ship, then ask the game what ship is that, then modify the hp of that ship.

Post Reply

Return to “X³: Terran Conflict / Albion Prelude - Scripts and Modding”