[Mod-libraries]UniTraders LibCollection - Version 1: Spawn ships with functional Crew

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

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

UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 14571
Joined: Sun, 20. Nov 05, 22:45
x4

[Mod-libraries]UniTraders LibCollection - Version 1: Spawn ships with functional Crew

Post by UniTrader »

NOTE: this is for Mod/Script creators, not for Players - if you are a Player better get out here quickly, it may hurt your brain :D

This is planned to be a Collection of the Stuff i create which may be useful to others and shouldn't/cann't be implemented by each Mod which wants to use it individually - therefore i make one package and others who want to use this may add a <dependency> node to their content.xml.
it is fine if you include this Package in your Mod Archive, too - if i make an Update the Mod Folder Name will reflect the Version inside and i will take care that it stays compatible to dependencies of older Versions (will mainly add stuff, and probably never remove something ;) )
so if questions arise which Version to keep if there is the choice between multiple just tell your users to keep the highest Version and remove all others ;)

Included Functions:
=> make Crew which comes with <create_ship> functional (fix the dialogue tree)
when you spawn the Ship add some lines after that, like:

Code: Select all

<create_ship name="$ship" macro="macro.units_size_xl_d_capital_destroyer_2_macro" zone="player.primaryship.zone" >
  <pilot macro="character_split_m_a_macro">
    …
  </pilot>
  <engineer macro="character_split_m_a_macro">
    …
  </engineer>
  <defence macro="character_split_m_a_macro">
    …
  </defence>
</create_ship>
<!-- enable custom hanlder for NPC Conversation (fails on actor creation with ship) -->
<signal_cue_instantly cue="md.NPC_Engineer.OnPlatformPopulation_Engineer" param="$ship.engineer" />
<signal_cue_instantly cue="md.NPC_Staff.OnPlatformPopulation_Staff" param="$ship.pilot" />
<signal_cue_instantly cue="md.NPC_Staff.OnPlatformPopulation_Staff" param="$ship.defencenpc" />

[ external image ]
if not stated otherwise everything i post is licensed under WTFPL

Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter ;)

I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help ;)
User avatar
Frumph
Posts: 302
Joined: Wed, 20. Nov 13, 03:12
x4

Post by Frumph »

Would you happen to have one for spawned stations? post-game start? As stated in another thread when adding them to the zones.xml they spawn without trade points.

Or maybe a loop that can be triggered to 'fix all' that are currently in the game? like a verify loop or something that goes through all and makes sure they exist as a one-time-run ?
UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 14571
Joined: Sun, 20. Nov 05, 22:45
x4

Post by UniTrader »

nope, since in my modding work i didnt encounter this problem yet. and its unlikely i will in the near future since i am currently working mostly with Ship loadout Stuff.

the file md/InitUniverse.xml and especially the part <library name="InitStationActions"> may be of interest for you..

not sure how its supposed to look, but save the non-functional Station in $controllable and do the following:
<include_actions ref="md.InitUniverse.InitStationActions" />
could do the trick - no idea, not tested.
if not stated otherwise everything i post is licensed under WTFPL

Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter ;)

I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help ;)

Return to “X Rebirth - Scripts and Modding”