Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: How to add a hullMod to a ship in a mission (not campaign)  (Read 117 times)

rogerbacon

  • Ensign
  • *
  • Posts: 41
    • View Profile
How to add a hullMod to a ship in a mission (not campaign)
« on: December 29, 2020, 11:59:11 AM »

I'm creating a mission like randomBattle and I want to get each ship and add a hullMod as the ship is added to the player's fleet. How should I do this? I think I'm close but its not quite working. Here's what I've tried so far.

Code
BattleCreationContext batContext = api.getContext();
CampaignFleetAPI playerFleet = batContext.getPlayerFleet();
FleetMemberAPI ship = api.addToFleet(FleetSide.PLAYER, "astral_Elite", FleetMemberType.SHIP, false);
api.addBriefingItem("ship is " + ship.getVariant().getHullMods());
ship.getVariant().addMod("some_HullMod");
Logged