Those working on this mod do so in their own free time and for no pay.
Show your support for them by enabling ads on this site!

Author Topic: Fighter Spawn in TR 2.2  (Read 2971 times)

0 Members and 1 Guest are viewing this topic.

April 18, 2018, 08:17:00 AM

Offline Dark_Canuck

  • Recruit
  • *
  • Posts: 2
  • Approval: +0/-0
    • View Profile
Fighter Spawn in TR 2.2
« on: April 18, 2018, 08:17:00 AM »
I am trying to figure out how the fighter spawn function works in Thrawns Revenge 2.2.

It seems like things have changed since Corey released his video in Oct 2016 on adding fighter bays to ships. I am trying to add a couple extra squadrons to the MC80b and the Quasar, but I cannot figure out how to do it properly, as on the <SPACEBEHAVIOUR> line, there is no SPAWN_SQUADRON function. Currently that section of the XML doc for the MC80B looks like:

<Ship_Class>capital</Ship_Class>
      <Formation_Priority>5</Formation_Priority>
      <Political_Faction>Rebel</Political_Faction>
      <Squadron_Capacity>40</Squadron_Capacity>
      <Build_Cost_Credits>4500</Build_Cost_Credits>
      <AI_Combat_Power>2030</AI_Combat_Power>
      <Build_Time_Seconds>105</Build_Time_Seconds>
      <Build_Tab_Space_Units>Yes</Build_Tab_Space_Units>
      <Size_Value>360</Size_Value>
        <Behavior> SELECTABLE, DUMMY_STARSHIP </Behavior>
      <SpaceBehavior>ABILITY_COUNTDOWN, SIMPLE_SPACE_LOCOMOTOR, POWERED, SHIELDED, HIDE_WHEN_FOGGED, REVEAL, TARGETING, UNIT_AI, ASTEROID_FIELD_DAMAGE, ION_STUN_EFFECT, NEBULA, DAMAGE_TRACKING</SpaceBehavior>
      <Starting_Spawned_Units_Tech_0>Y-Wing_Squadron, 1</Starting_Spawned_Units_Tech_0>


If I add a SPAWN_FUNCTION and add the ships via the <STARTING_SPAWNED_UNITS_TECH_0>, they will spawn plus the original complement of fighters, plus other ships I didn't ask it to spawn.

For example, with the Quasar, I tried writing it as such and ended up with something like 4 X-Wing Sqns, 3 B-Wing Sqns, 2 Y-Wing Sqns and an A-Wing Sqn for some reason.

<Political_Control>0</Political_Control>
      <Squadron_Capacity>10</Squadron_Capacity>
      <Transport_Capacity>8</Transport_Capacity>
      <Number_per_Squadron>1</Number_per_Squadron>
      <Build_Cost_Credits>2100</Build_Cost_Credits>
      <AI_Combat_Power>80</AI_Combat_Power>
      <Build_Time_Seconds>30</Build_Time_Seconds>
      <Build_Tab_Space_Units>Yes</Build_Tab_Space_Units>
      <Size_Value>8</Size_Value>
      <Behavior> DUMMY_STARSHIP, SELECTABLE </Behavior>
      <SpaceBehavior>ABILITY_COUNTDOWN, SIMPLE_SPACE_LOCOMOTOR, SPAWN_SQUADRON, TARGETING, POWERED, SHIELDED, REVEAL, HIDE_WHEN_FOGGED, UNIT_AI, ASTEROID_FIELD_DAMAGE, DAMAGE_TRACKING, ION_STUN_EFFECT, NEBULA</SpaceBehavior>

      <Starting_Spawned_Units_Tech_0>Rebel_X-Wing_Squadron, 2</Starting_Spawned_Units_Tech_0>
      <Starting_Spawned_Units_Tech_0>B-Wing_Squadron, 2</Starting_Spawned_Units_Tech_0>
      <Spawned_Squadron_Delay_Seconds>2</Spawned_Squadron_Delay_Seconds>

The only thing I can think of is that the reference to Y-Wing_Squadron, 1 no longer means a Y-Wing_Squadron, but possibly a generic group of fighters.

Any ideas or advice would be most welcome.

April 18, 2018, 10:43:23 AMReply #1

Offline Corey

  • Mod Leader
  • Administrator
  • Emperor
  • *****
  • Posts: 7,520
  • Approval: +410/-80
  • Dream Crusher
    • View Profile
Re: Fighter Spawn in TR 2.2
« Reply #1 on: April 18, 2018, 10:43:23 AM »
Fighter spawns in ICW are handled through a new LUA script, not the in-unit code. This allows us to change them based on which faction controls them (so they can be switched after boarding) and to call them back during single-unit retreat.
I also have a YouTube channel where I talk about mod development and gaming, do tutorials, and Let's Plays. If you like the content, consider supporting it on Patreon


April 18, 2018, 04:49:06 PMReply #2

Offline Dark_Canuck

  • Recruit
  • *
  • Posts: 2
  • Approval: +0/-0
    • View Profile
Re: Fighter Spawn in TR 2.2
« Reply #2 on: April 18, 2018, 04:49:06 PM »
Ah, understood. Thanks for the quick reply!

April 18, 2018, 10:56:47 PMReply #3

Offline DragonNation5523

  • Recruit
  • *
  • Posts: 3
  • Approval: +0/-0
    • View Profile
Re: Fighter Spawn in TR 2.2
« Reply #3 on: April 18, 2018, 10:56:47 PM »
The specific script controlling fighter spawns is GameObjectLibrary.lua. this will give info on each ship: if they spawn fighters, and what fighters and how much

 

Those working on this mod do so in their own free time and for no pay.
Show your support for them by enabling ads on this site!