[REQUEST] - Crew transfer en-masse

The place to discuss scripting and game modifications for X4: Foundations.

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

Scotto-82
Posts: 5
Joined: Sun, 23. Dec 12, 03:09
x4

[REQUEST] - Crew transfer en-masse

Post by Scotto-82 »

Please can someone sort out a mod so that I can transfer my 50 odd marines in bulk rather than one at a time (8 clicks each time).

And if this mod can make use of the transporter system to get to remote vessels/stations that would probably make a lot of sense as well - (kinda like X3-AP)

Oh one more thing, if the transporter isn't researched yet, then why don't we have a pod system like in X-rebirth... that actually made a lot of sense (to me at least).

Thanks for the consideration.
XTC0R
Posts: 401
Joined: Sat, 1. Dec 18, 19:58
x4

Re: [REQUEST] - Crew transfer en-masse

Post by XTC0R »

+1 for this.

Transfering crew members is a pain in the a** right now
ApoxNM
Posts: 783
Joined: Wed, 5. Dec 18, 06:17
x4

Re: [REQUEST] - Crew transfer en-masse

Post by ApoxNM »

I am actually suprised no one made a mod yet. Must either be hard to do, or not possible.

But


+1
Eukatae
Posts: 56
Joined: Thu, 28. Feb 13, 16:22
x4

Re: [REQUEST] - Crew transfer en-masse

Post by Eukatae »

What is needed is a personnel management interface and the ability to assign people to loiter on stations as a container to facilitate sorting and transfer.
Kadatherion
Posts: 1021
Joined: Fri, 25. Nov 05, 16:05
x4

Re: [REQUEST] - Crew transfer en-masse

Post by Kadatherion »

Nodoby has done it yet because it would need editing the UI. And we can't mod the UI yet. Why? Yeah, you guessed it, because of a bug.
mellimell
Posts: 31
Joined: Wed, 30. Mar 16, 18:28
x4

Re: [REQUEST] - Crew transfer en-masse

Post by mellimell »

+1 so bad
ship-rekt
Posts: 4
Joined: Thu, 20. Dec 18, 20:06
x4

Re: [REQUEST] - Crew transfer en-masse

Post by ship-rekt »

Kadatherion wrote: Thu, 20. Dec 18, 00:39 Nodoby has done it yet because it would need editing the UI. And we can't mod the UI yet. Why? Yeah, you guessed it, because of a bug.
Ya, I'd definetely rather it be a right-click context menu.... but I've been toying with the idea of using a MD script initiated by convo'ing the captain. It would initiate a script to move all un-assigned passengers to a ship selected through a call to whatever creates a dialog showing other docked ships when doing an 'anywhere but here' quest (pickup npc and transfer to another station, during which the npc asks which ship to board)...

basic use would go, ship info-> crew -> un-assign crew to be transferred from roles using sliders -> convo captain -> xfer crew -> select ship in dialog.
non-failure path logic would go:
if convo'd captain player owned
---if un-assigned crew
------ask xfer to destination <> null
---------if destination transferrable (docked with or in)
------------transfer unassigned crew

This would be my first script in the X series, so please pardon/educate me if this idea has issues. I dont even know if theres a collection (or if they can be made with md/aiscript) to collect multiple crew members as a single object or if a for-loop type control statement is possible to iterate through an array of them... lol
ship-rekt
Posts: 4
Joined: Thu, 20. Dec 18, 20:06
x4

Re: [REQUEST] - Crew transfer en-masse

Post by ship-rekt »

Did some more work on this, found the MDScript responsible for those quests and researched some sticking points I had due to lack of familiarity with the language. I'm really reaching out to folks with lots more experience here for guidance on the approach I'm taking as while I'm not new to programming/scripting I am very new to this lang... Kind of in a spot where I dont know enough to ask the right questions to accomplish what I want.. so instead I'm just looking for a 'this'll be a problem, look into how y works' type guidance.

Anyways, the contents of GM_Transport_Passengers contains this nugget:

Code: Select all

<cue name="PassengerNextSection_SelectShip" instantiate="true">
                          <conditions>
                            <event_conversation_next_section actor="$LeadPassenger" />
                            <check_value value="event.param == 'passenger_onboard'" />
                          </conditions>
                          <actions>
                            <find_object_component name="$PlayerShips" object="$LeadPassenger.container" owner="faction.player" class="[class.ship_s, class.ship_m, class.ship_l, class.ship_xl]" recursive="true" multiple="true" />
                            <do_if value="not $PlayerShips.count">
                              <debug_text text="'No player ships on $LeadPassenger\'s ship or station'" chance="$DebugChance" />
                              <!-- TODO (@Lorraine): Add voice line for player not having any available ships -->
                            </do_if>
                            <do_else>
                              <open_conversation_menu menu="PlatformUndockMenu" param="[0, 0, $LeadPassenger.container, 'movepassenger']" />
                            </do_else>
                          </actions>
                        </cue>
Notably:

Code: Select all

 <find_object_component name="$PlayerShips" object="$LeadPassenger.container" owner="faction.player" class="[class.ship_s, class.ship_m, class.ship_l, class.ship_xl]" recursive="true" multiple="true" />
I'll need to test but this looks like it'll create a dialog/screen asking for a player owned ship to be selected and returns that as an object ($playerships). Once I've got that object, I should be able to do a .people.free check to verify it has room for the incoming passengers and that they are docked in or with each other... then <do_all> through the ship containing the passengers moving them with something similar to the create_npc_template with entity_role.passenger:

Code: Select all

<do_all exact="$PassengerList.count" counter="$i" reverse="true">
                              <debug_text text="'Attempting to add ' + $PassengerList.{$i} + ' to ' + $Ship + ' ' +$Ship.knownname + ' as a passenger'" chance="$DebugChance"/>
                              <create_npc_template name="$Template" object="$Ship" entity="$PassengerList.{$i}" role="entityrole.passenger"/>
                              
                              <assert value="$Template" text="'Attempted to add passenger to the playership but it failed. [Owen]'"/>
                              <do_if value="$Template">
                                <append_to_list name="$PassengerTemplates" exact="$Template"/>
                                <!--TODO @Owen #EntityTypes can we really just destroy this actor? Disconnect and reconnect instead of instantiating if needed?-->
                                <do_if value="$PassengerList.{$i}.exists and this.$DespawnWaypoints.count">
                                  <!-- TODO (@Lorraine): for Away From Here / Fast Flight variation of this mission, force movement speed to be the passenger's run speed - this should become a parameter passed into the mission(?) -->
                                  <!--set_value name="$MovementTable" exact="table[$slot = this.$DespawnWaypoints.random, $movementspeed = $PassengerList.{$i}.runspeed]" /-->
                                  <set_value name="$MovementTable" exact="table[$slot = this.$DespawnWaypoints.random]" />
                                  <signal_objects object="$PassengerList.{$i}" param="'npc_move_to'" param2="$MovementTable.clone"/>
                                </do_if>
                                <do_else>
                                  <remove_actor_from_room actor="$PassengerList.{$i}"/>
                                </do_else>
                              </do_if>
                              <remove_value name="$Template"/>
                            </do_all>
Tyrant597
Posts: 299
Joined: Wed, 9. Apr 08, 05:52
x4

Re: [REQUEST] - Crew transfer en-masse

Post by Tyrant597 »

Using a taxi service sounds pretty cool! Until then, how about this?
viewtopic.php?f=181&t=409866
You don't talks about X:Rebirth...
X4 Mods: Collect Inventory Wares Stations Supply Build Storage Mass Move Marines
ship-rekt
Posts: 4
Joined: Thu, 20. Dec 18, 20:06
x4

Re: [REQUEST] - Crew transfer en-masse

Post by ship-rekt »

Nice work man! Will be reading it to learn, this was pretty much what I was looking to do. Will fix a major annoyance I've been having in my playthrough and I can learn a bunch.

Thanks!
Tyrant597
Posts: 299
Joined: Wed, 9. Apr 08, 05:52
x4

Re: [REQUEST] - Crew transfer en-masse

Post by Tyrant597 »

ship-rekt wrote: Fri, 21. Dec 18, 07:19 <find_object_component name="$PlayerShips" object="$LeadPassenger.container" owner="faction.player" class="[class.ship_s, class.ship_m, class.ship_l, class.ship_xl]" recursive="true" multiple="true" />
Pretty sure that will search for connected components. In this case, they are using it to find player ships docked to the same object as $LeadPassenger is a passenger on. Not going to open a dialog.
I think what we want is "<open_conversation_menu menu="MapMenu" param1 param2 />". I just have'nt figured out which parameters to pass it yet.
You don't talks about X:Rebirth...
X4 Mods: Collect Inventory Wares Stations Supply Build Storage Mass Move Marines

Return to “X4: Foundations - Scripts and Modding”