[SCRIPT][WIP] Marine Corp. (2012.02.16)

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

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

A.Persyn
Posts: 121
Joined: Sun, 14. Mar 10, 13:14
x3tc

Post by A.Persyn »

Greetings,
DrBullwinkle wrote:It is very cool to watch a squad of marines jet-pack to points around the ship and fix it!
Some ships (USC, Argon and Split) have very simple designs and the number of unique points that marines can be positioned is limited; but other ships (Teladi, ATF and Xenon) have lots of protrusions and nooks that give the marines much more interesting places to go.
DrBullwinkle wrote:Do the marines earn experience when doing repairs?
Marines get a boost in mechanical and engineering skills for repairs based on their current skill level, the number of marine performing the repair, the amount damage being repaired and whether or not the repair ship has a marine captain. The amount of increase for a repair job is listed on the the crew configuration page along the right side of the menu.

A Marine also gets an increase in hacking skill after hacking and claiming a derelict.

The value/salary of a marine increases as their skills increase and in some cases (M5, M4) it costs more to pay the marines than to buy a new ship. That's where those slower, low skill marines are actually a better choice than the expensive, higher skilled marines.
DrBullwinkle wrote:Half of the marines returned to the ship under their own power. The other half just stopped and I had to pick them up.
Ships that can launch boarding operations usually don't have that problem but everything else is tricky. It mostly depends on the angle the marines are returning to the ship. For example, if the ship is a Hercules and the marines are below the ship, they get picked up as soon as they reach the ship, but if they are beside the ship, they linger for several minutes before getting picked up. There's an Astronaut Teleporter hotkey included that will scoop them all up at once but it has to be activated through the Marine Corp. menu and then assigned a key in the control panel.

A.Persyn
A5PECT
Posts: 6191
Joined: Sun, 3. Sep 06, 02:31
x4

Post by A5PECT »

A.Persyn wrote:Greetings,

Everything updated and tested on X3TC and X3AP...
[ external image ]

Question: what's the plan for custom repair profiles?
Admitting you have a problem is the first step in figuring out how to make it worse.
User avatar
joelR
Posts: 2008
Joined: Mon, 9. Jul 07, 23:33
x3tc

Post by joelR »

Ahhhh! How did I miss this one! The repair crews are exactly what I have been looking for.

Thanks!
User avatar
joelR
Posts: 2008
Joined: Mon, 9. Jul 07, 23:33
x3tc

Post by joelR »

Ok...im your new #1 Fan.

I just looked through the repair crew menus (fantastic work on the interface btw) and am absolutely thrilled to have a use for marines besides boarding as well as having another (enjoyable) reason to build up some complexes to produce wares for a repair fleet.

Other repair type scripts always felt too much like cheating because there were really no costs involved. This solves that.

Anyhow, thanks again.
A.Persyn
Posts: 121
Joined: Sun, 14. Mar 10, 13:14
x3tc

Post by A.Persyn »

Greetings,
KloHunt3r wrote:Question: what's the plan for custom repair profiles?
The ability is already included but I didn't make any instructions for it yet. There's a file named setup.repair.profile.dropship.xml that is a sample file. The file name has to start with setup. but the rest of the name can be any text. The sample coordinates are for the the Baldric Miner with a different name.

The coordinates are in meters and they are the off-set from the center point of the ship. All the math is addition so right-side and front are positive, left-side and rear are negative.

While it can be done by hand through trial and error, GMAX or 3ds Max are faster if you know how to use them.
3ds Max Setup:
Customize / Units Setup / Display Unit Scale / Metric / Meters
Customize / Units Setup / System Unit Setup / 1 Unit = 0.2 Meters
In the game, the Y and Z axis are switched.

The number of repair points for a ship is determined by the size of the array, so you can add as many or as few as you'd like by allocating more/less space in the array.

Each point has two sets of coordinates: The first position (x1, y1, z1) is the first point that the marine moves to which is further away from the ship, and the second position (x2, y2, z2) is the actual repair point where the marine is when firing the repair laser. Rotation is set with arot for alpha, brot for beta, and gamma is normally zero. Left and up rotations are 1 to 32768 and right and down rotations are -1 to -32768. 32768 = 180 degrees.

There are all sorts of things that can be done wrong when making custom ships so I can't guarantee any custom ship will work properly. Even the vanilla ships have bugs that cause coordinates to be different in-game, and in some cases, the repair laser passes right through parts of the hull. Typically you can't tell because the view is obstructed but other times it is blatantly obvious.

If you need more simplified help with it, you'll have to wait until I have time to make instructions for it. I don't have any custom ships installed so it's a very low priority for me.

Have a nice day!

A.Persyn
Maskelyne
Posts: 78
Joined: Wed, 9. Dec 09, 18:04
x3tc

Post by Maskelyne »

Incredible work.
"Science without religion is lame, religion without science is blind." - Albert Einstein
Nashnir
Posts: 30
Joined: Wed, 2. Jun 10, 16:20
x4

Post by Nashnir »

I have a few questions

1. How is the salary paid?
2. Is it paid only if they are on active duty or are they paid as long as you own them.
3. What is the interval at which they are paid.
4. What happens if I do not have enough credit to pay them ?

If these have been already answered then please point out to the post.

Thanks
A.Persyn
Posts: 121
Joined: Sun, 14. Mar 10, 13:14
x3tc

Post by A.Persyn »

Greetings,
Nashnir wrote:1. How is the salary paid?
2. Is it paid only if they are on active duty or are they paid as long as you own them.
3. What is the interval at which they are paid.
4. What happens if I do not have enough credit to pay them ?
The general rule is they get paid whenever you use them. It's similar to how the player gets paid, per job, except marines get paid before the job. Only active-duty marines are used for jobs. Off-duty marines don't get paid until they are activated through a Task Force.

Whenever credits are transferred, a subtitle is displayed at the bottom of the screen that shows the total amount paid out. If the player doesn't have enough credits, a different subtitle appears notifying the player of, "Insufficient Credits," and the job is canceled. The automatic payment feature can be turned-off in the Marne Corp. menu.

It's all still a work-in-progress so not every instance where marines get paid has been implemented, yet. Currently, marines only get paid for repairs, hacking and Task Force deployment.

Salary is only used for custom jobs, it doesn't apply to any vanilla use (boarding and training). Salary is based off of the marine's value, which is based off of the marine's skills, so anything that increases a marine's skills will increase the marine's value and salary. Each time a marine is sent on a boarding operation or put into training, that marine's skills increase.

The value of a marine is based off of a random base amount somewhere between 10,000 and 16,000 plus a set amount per skill point.
For X3TC:
0 to 70 points = 500 credits each point
71 to 400 points = 2500 credits per point

The same formula applies for X3AP except the amount of credits for each point of Fighting Skill is doubled. The marine value system is completely vanilla and I've made no changes to it.

At the start of a new game, where credits are in short supply, paying marines can be a hassle so there is a lot more THINK needed. As funds increase, marine salary becomes less and less of an issue but still requires some thinking to avoid unprofitable uses.

Have a nice day!

A.Persyn
treverhardin
Posts: 4
Joined: Fri, 13. Jan 12, 21:30
x3tc

Post by treverhardin »

wow thats pretty funny
A5PECT
Posts: 6191
Joined: Sun, 3. Sep 06, 02:31
x4

Post by A5PECT »

One bug report, one question, and one suggestion.

Bug: I'm receiving messages in my log simply stating "10000" or "15000" every time I order a repair mission. Seems like a leftover debug script or some kind of report on the marine's salary. Nothing game breaking, but I'd like to be able to switch the messages off; they're filling up my log.

Question: Once I've turned a standard marine into a combat pilot, how do I change him back?

Suggestion: Repair queues.

I'd like the ability to order a repair crew to go through a series of ships and repair them consecutively instead of having to start each individual repair mission myself. For example, if I have four fighters docked at a TM, I'd like to be able to order the repair crew onboard to repair one fighter, then automatically switch to the next fighter once the first is finished, and so on until all four of the docked ships are fully repaired.
Admitting you have a problem is the first step in figuring out how to make it worse.
User avatar
DrBullwinkle
Posts: 5715
Joined: Sat, 17. Dec 11, 01:44
x3tc

Post by DrBullwinkle »

KloHunt3r wrote:I'd like the ability to order a repair crew to go through a series of ships and repair them consecutively instead of having to start each individual repair
Even better: Have the marines on the carrier/TM automatically repair docked fighters without being asked to do so. (Maybe it does that already?)

As a general observation, Marine Corps has a ton of cool features, but it also has too many options. It would be better if it were simpler.

Sometimes less is more.
A5PECT
Posts: 6191
Joined: Sun, 3. Sep 06, 02:31
x4

Post by A5PECT »

Agreed. A lot of the menus are very... unwieldy.

Everything is nice and organized, but there are so many options in each window and I find myself using only a few of them.
Admitting you have a problem is the first step in figuring out how to make it worse.
A.Persyn
Posts: 121
Joined: Sun, 14. Mar 10, 13:14
x3tc

Post by A.Persyn »

Greetings,
KloHunt3r wrote:Bug: I'm receiving messages in my log simply stating "10000" or "15000" every time I order a repair mission. Seems like a leftover debug script or some kind of report on the marine's salary.
You're right. It's a debug message I forgot to remove from the script scr.a.p.mrc.repair.ivr (line 51). I'll fix it with the next update but until then, you can open that script in the script editor or Exscriptor and delete that line of code and resave it. The line that should be deleted reads:

Code: Select all

write to player logbook $timeout
KloHunt3r wrote:Question: Once I've turned a standard marine into a combat pilot, how do I change him back?.
It's the same process for adding a marine as pilot except you select the pilot. The ship the marine pilot is being moved to has to have cargo life-support installed, space for at least one marine, and 20 units of free cargo space. The destination ship has to be the same ship, docked at the same location or within transporter range. If the combat ship cannot carry marines then the destination ship must be a different ship that can.
KloHunt3r wrote:Suggestion: Repair queues.

I'd like the ability to order a repair crew to go through a series of ships and repair them consecutively instead of having to start each individual repair mission myself. For example, if I have four fighters docked at a TM, I'd like to be able to order the repair crew onboard to repair one fighter, then automatically switch to the next fighter once the first is finished, and so on until all four of the docked ships are fully repaired.
While it's not consecutive like a queue, Marine Repair Crews does have the ability to repair up to four ships at the same time using the same repair ship.
Select a ship, select a repair crew, start the repair, then select another ship, select a different repair crew, start the repair, etc.

The repair process isn't intended to be too automatic. Marine Repair Crews is intended to focus more on micro-management and control than the hands-free simplicity of Marine Repairs by Tatakau.

I try to design the scripts to fit with the universe while adding features I think the game should have but doesn't. Balance is an important aspect of the X-Universe so everything added has to come at the cost of something else, otherwise it's just a cheat. I deliberately didn't include repair queues because it makes it far too easy to just ignore the use of wares in the repair process. That's especially true with TMs which don't have the cargo capacity to repair four heavily damaged ships and supply all the needed wares. While the use of wares is not mandatory, the script is still designed to encourage their use by linking ware use to repair times. Less wares = longer and more wares = shorter.
DrBullwinkle wrote:Have the marines on the carrier/TM automatically repair docked fighters without being asked to do so.
That requires a script to be running all the time and checking again and again for damaged ships, even when there are none. I prefer to only run scripts when they are needed. Also, as stated above, too much automation makes it too easy which isn't my goal. For automatic repairs, I highly recommend Marine Repairs by Tatakau.
DrBullwinkle wrote:Marine Corps has a ton of cool features, but it also has too many options. It would be better if it were simpler.

Sometimes less is more.
KloHunt3r wrote:Agreed. A lot of the menus are very... unwieldy.

Everything is nice and organized, but there are so many options in each window and I find myself using only a few of them.
Which options do you think are unnecessary? Unless I've misunderstood something, both of you have asked for an additional option but then write that there are too many options already. I'm confused. Can you please clarify?

Thanks for your feedback!

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

Post by DrBullwinkle »

A.Persyn wrote:Unless I've misunderstood something, both of you have asked for an additional option but then write that there are too many options already. I'm confused. Can you please clarify?
Sure, I will be happy to clarify: I was not asking for an additional option. I was asking for a simplification of the existing feature; ideally by *removing* options.

But you have explained why you do things the way you do. If it is intentional, then that's cool. Carry on... you're doing a fine job. :)

(PS: Unfortunately, Tataku's Marine Repairs has a bug that re-starts the global task repeatedly under certain circumstances, such as mining in Undefined Space. The result is dozens of copies of the same global task running without end; eventually crushing performance. It would be nice to have the feature of Tataku's script without the bug. However, that is not necessarily your problem.) :)
A.Persyn
Posts: 121
Joined: Sun, 14. Mar 10, 13:14
x3tc

Post by A.Persyn »

DrBullwinkle wrote:Sure, I will be happy to clarify: I was not asking for an additional option. I was asking for a simplification of the existing feature; ideally by *removing* options.
But in the PM you sent me, you specifically asked for an additional option to be added to Off-Duty Marines, but then write in the forum post that there are too many options.
DrBullwinkle wrote:As a general observation, Marine Corps has a ton of cool features, but it also has too many options.
I'm still confused. Specifically, which options do you think are unnecessary?
DrBullwinkle wrote:Unfortunately, Tataku's Marine Repairs has a bug
I didn't know about the bug. It's been a while since I used it but I never had a problem with it. I agree, that's unfortunate.

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

Post by DrBullwinkle »

Even in my PM I was not asking for an *option*. I was requesting an easier-to-use interface for the normal function. (For other readers, I suggested an Off-Duty-Marine speed loader. Like the menu choice to make all Active marines Off-Duty, but in reverse. Task Forces seem needlessly cumbersome to me, but maybe that is just my personal experience.)

I don't want to belabor the point because you have been clear that you like things the way that they are. There is nothing wrong with that.
User avatar
DrBullwinkle
Posts: 5715
Joined: Sat, 17. Dec 11, 01:44
x3tc

Post by DrBullwinkle »

In other news, I have been enjoying Off Duty Marines and the Astronaut Hotkey. While using them, I noticed some minor glitches. None of these are show-stoppers, but I thought you might appreciate the report:

- Off-Duty Marines renames my ship when I move an ADM to ODM.

- The Astronaut Teleport hotkey is awesome. Not only does it grab marines with their skills intact, but I was impressed that it worked properly when picking up a plot character (even though you said that would work).

- However, the teleport hotkey also has some funky behavior regarding energy, space, and the sub-title messages. I tracked one issue to textid 4092 and 4093 being reversed.

- Also for the teleport hotkey, the loop at the top deducts energy cells even if the teleport fails.

- In at least one case, it appeared to go through the loop too many times, which drained my ship's energy cells down below 6. It is as though the loop repeated without end, although I cannot see why it would do that. I confirmed the test by cheating in 2,000 energy cells and pressing the hotkey again, which drained all of the cells. (The reason that the teleport failed was because the Active Duty area was full.)

Finally, a mystery. Two recent boarding ops have resulted in duplicate marines on two different ships at the same time. They have the same names, and they cannot be transferred to a ship carrying a marine with the same name. But they can be transferred to *other* ships. Sometimes they disappear from one ship. I do not know how they got there, because I was pretty busy with the boarding op at the time. I just noticed them when I was cleaning up after the fight.

I now have two ODMs with the same name on my TP. So the list of marines shows a few ADMs, two identical ODMs, and several Task Forces. I have 70+ marines on that TP (thanks to your script. :) )

The two recent boarding ops where I have noticed this behavior have been against Yaki Armada ships, in case that matters.
A.Persyn
Posts: 121
Joined: Sun, 14. Mar 10, 13:14
x3tc

Post by A.Persyn »

Greetings,
DrBullwinkle wrote: - Off-Duty Marines renames my ship when I move an ADM to ODM.
Are you referring to just the playership or to any ship owned by the player? There are already checks in place to prevent name changes but the playership can be tricky.
DrBullwinkle wrote:However, the teleport hotkey also has some funky behavior regarding energy, space, and the sub-title messages. I tracked one issue to textid 4092 and 4093 being reversed.

Text IDs 4092 and 4093 are right where they are supposed be and it's not possible for the script to use one in place of the other. 4092 is used when there is no more room for passengers and 4093 when there is not enough energy cells. If both conditions are met, only one subtitle will be displayed, 4092. Can you provide a repeatable example when that reverse happens?
DrBullwinkle wrote:Also for the teleport hotkey, the loop at the top deducts energy cells even if the teleport fails.

The reason that the teleport failed was because the Active Duty area was full.
The script needs a different pass/fail set of checks. Easy to fix.
DrBullwinkle wrote:I now have two ODMs with the same name on my TP. So the list of marines shows a few ADMs, two identical ODMs, and several Task Forces. I have 70+ marines on that TP
That might be a result of not enough free space for the conversion or the ODM was transferred to a different ship and then restored to ADM. Either way, there are checks in place to prevent duplicates from happening but I might of missed something. If you can provide a repeatable example, I'll try to track down where the problem is.

Thanks for your feedback!

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

Post by DrBullwinkle »

A.Persyn wrote:Greetings,
DrBullwinkle wrote: - Off-Duty Marines renames my ship when I move an ADM to ODM.
Are you referring to just the playership?
Yes.
[Duplicate marines] might be a result of not enough free space for the conversion or the ODM was transferred to a different ship and then restored to ADM.
I will investigate the free space idea. ADM-ODM and ODM-ADM conversions on the same ship (player ship).

Both target ships had their own marines on board. I scooped them up (Astronaut Teleporter) while my boarding party was still on board the target ship, so there were more marines in play than could fit in the active duty area of my ship. That is the only reason that I had to use the ODM script during the ops.

So the ops went something like this:

- Drop target shields, board, wait through the levels.

- Scoop up the ejected enemy marines (Astronaught Teleporter hotkey). Now my TP's active duty area is full.

- Use the ODM script to transfer some marines to ODMs.

- When all the fighting is over, I transfer my marines back from the target to my TP. Some of the marines appear to transfer, but never actually leave the target ship. This is where I first notice the duplicates, although it seems unrelated to your script. Hence the mystery.

Obviously, if I can track down steps to repeat the duplicates I will tell you what they are. It's not a secret.... it's just a mystery. :)


=========================================================
EDIT: "scooped up" = Astronaut Teleporter hotkey.

EDIT 2: How unique are marine names? If I have two marines with the same name, can I assume that one is a duplicate? It turns out that I have several pair of apparent duplicates in my ODM area -- possibly and entire shipload (20) of them.

Should I eject one of the duplicates, or both? Is there a possibility of the marine himself being bugged?

EDIT 3: After further investigation, I think that you are going to have to give me more clues about what I am looking for. Do your marines have something special about them -- a task or variable? How can I tell whether a marine is "valid" or not?

Ex: I had two ODMs with the same name. I could only transfer one at a time to ADM (makes sense), so I transferred one, ejected, transferred the other, and ejected again. The result was one marine and one astronaut in space. Both had the same name. Then I teleported the astronaut back to my ship, and he vanished. No trace.

Around the same time, a third marine with the same name vanished from my recently-boarded ship. So three marines gone by ejecting and re-teleporting.

Maybe this is a good thing -- getting rid of the bugged marine and his clones. But I need more info in order to refine my investigation.

EDIT 4: In another test, I destroyed the target ship with the 20 apparently bugged marines on board. Immediately after that, I check the ODMs on my TP. ALL of them had turned into "Unknown Objects". I reloaded and repeated, with the same result.

So that makes me wonder about the Task Forces. What happens when a marine from a Task Force dies? Could that corrupt the rest of the Task Force? Could it corrupt *all* Task Forces?

At this point, I am fairly certain that I have bugged Task Forces, and possibly bugged ship(s)? You tell me which objects hold your properties. :)

I am deleting all of the ships and marines involved, and starting fresh. Let's see whether I create new duplicates.
=========================================================
A.Persyn
Posts: 121
Joined: Sun, 14. Mar 10, 13:14
x3tc

Post by A.Persyn »

Greetings,
DrBullwinkle wrote:How unique are marine names?
Each race has its own group of name lists that are combined together to form character names. Each name list has 40 names or name parts (Paranid). Repeats are a common occurrence as are families where a bunch of marines, passengers or pilots spawned at the same time have the same last name. It's a quirk of random name generator which really isn't that random.

When an ADM is converted to ODM, the new passenger gets "ODM - " (text ID 6009) added to their name to minimize any confusion with repeated names. The modified name is only visible when viewing the passenger list from the freight or ship info menus. When the ODMs are displayed in the ODM section, the original name is used and the modified name isn't shown.
DrBullwinkle wrote:If I have two marines with the same name, can I assume that one is a duplicate?
They would only be duplicates if their names and all stats match.
DrBullwinkle wrote:Do your marines have something special about them -- a task or variable? How can I tell whether a marine is "valid" or not?
My scripts only add local variables to the marines or move them to a different part of the ship. Otherwise, there is nothing special about the marines. Marines are fully preserved with all their skills and stats intact. Your problems sound more like a conflict with another script that handles marines/passengers in a different way such as copying them rather than moving them.

The other situations you've described all sound as though they are happening after the problem started. I need to know what conditions triggered the problem in the first place in order to troubleshoot it.

When an active-duty marine (ADM) is converted into an ODM, a passenger is created that represents the actual marine which is moved from the cargo bay and hidden onboard the ship. That ODM passenger carries a local variable that points to the marine, wherever that marine is. When an ODM is restored to ADM, the local variable is checked for the location of the marine, the marine is moved back to the cargo bay and the ODM passenger is destroyed. Once it is destroyed, it cannot appear in the ODM list because it isn't there anymore. You shouldn't be able to see the ODM and ADM at the same time. The Task Forces menu will list whichever marines are assigned to that task force regardless of whether they are ADM or ODM. Which menu are you looking at when the 'Unknown Objects' appear?
DrBullwinkle wrote:So that makes me wonder about the Task Forces. What happens when a marine from a Task Force dies? Could that corrupt the rest of the Task Force? Could it corrupt *all* Task Forces?
The Task Force menu lists the members of the task force whether they are on the ship or not. If one dies, it would normally show up in the menu as "Unknown Object" but there are filters in place that immediately remove dead marines from the list so you wouldn't actually see it. Also, if a member of a task force is killed, the KIA counter gets incremented by one.

I hope this helps!

A.Persyn

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