Fractal Softworks Forum

Please login or register.

Login with username, password and session length

Author Topic: Relics mod - 0 crew in moded station  (Read 3326 times)

arcibalde

  • Admiral
  • *****
  • Posts: 1730
    • View Profile
Relics mod - 0 crew in moded station
« on: December 21, 2012, 08:23:14 AM »

Yes it's mod, it looks like bug i just do not know is it my non-existing knowledge of coding that causing it or it's real bug.

Relics mod is in question. So, first Purifiers convoy (and any other after) that (17 days after game start) come and drop goods at Purifier station drop 0 crew of all type. If you take one and put it in place of your ship crew it will turn ship crew to 0 too. Purifiers convoy should only bring Purifier weapons and ships. No crew and no supply, but it brings supply too. Here is code:
Code
package data.scripts.pur.world;

import java.util.List;

import com.fs.starfarer.api.Global;
import com.fs.starfarer.api.Script;
import com.fs.starfarer.api.campaign.CampaignFleetAPI;
import com.fs.starfarer.api.campaign.CargoAPI;
import com.fs.starfarer.api.campaign.FleetAssignment;
import com.fs.starfarer.api.campaign.LocationAPI;
import com.fs.starfarer.api.campaign.SectorAPI;
import com.fs.starfarer.api.campaign.SectorEntityToken;
import com.fs.starfarer.api.fleet.FleetMemberType;

import data.scripts.world.BaseSpawnPoint;

@SuppressWarnings("unchecked")
public class PurConvoySpawnPoint extends BaseSpawnPoint {

private final SectorEntityToken convoyDestination;

public PurConvoySpawnPoint(SectorAPI sector, LocationAPI location,
float daysInterval, int maxFleets, SectorEntityToken anchor,
SectorEntityToken convoyDestination) {
super(sector, location, daysInterval, maxFleets, anchor);
this.convoyDestination = convoyDestination;
}

private int convoyNumber = 0;

@Override
protected CampaignFleetAPI spawnFleet() {
CampaignFleetAPI fleet = getSector().createFleet("pur", "pur8");
getLocation().spawnFleet(getAnchor(), 0, 0, fleet);

CargoAPI cargo = fleet.getCargo();
if (convoyNumber == 1) {
cargo.addWeapons("relics_blazo_h", 2);
} else {
// addRandomWeapons(cargo, 2);

if ((float) Math.random() > 0.75f) cargo.addWeapons("relics_exo_h", 2);
if ((float) Math.random() > 0.75f) cargo.addWeapons("relics_zaap_h", 2);
}

addRandomShips(fleet.getCargo(), (int) (Math.random() * 4f));

Script script = null;
script = createArrivedScript();
Global.getSectorAPI().addMessage("The Purifiers Supply fleet is arrived in system. Heading for Gate station.");

fleet.addAssignment(FleetAssignment.DELIVER_RESOURCES, convoyDestination, 1000);
fleet.addAssignment(FleetAssignment.GO_TO_LOCATION_AND_DESPAWN, convoyDestination, 1000, script);

convoyNumber++;
return fleet;
}

private Script createArrivedScript() {
return new Script() {
public void run() {
Global.getSectorAPI().addMessage("All Purifiers cargo has been successfully delivered to Gate station.");
}
};
}

private void addRandomWeapons(CargoAPI cargo, int count) {
// List weaponIds = getSector().getAllWeaponIds();
for (int i = 0; i < count; i++) {
String weaponId = (String) weapons[(int) (weapons.length * Math.random())];
int quantity = (int)(Math.random() * 4f + 2f);
cargo.addWeapons(weaponId, quantity);
}
}

private void addRandomShips(CargoAPI cargo, int count) {
// List weaponIds = getSector().getAllWeaponIds();
for (int i = 0; i < count; i++) {
if ((float) Math.random() > 0.7f) {
String wing = (String) wings[(int) (wings.length * Math.random())];
cargo.addMothballedShip(FleetMemberType.FIGHTER_WING, wing, null);
} else {
String ship = (String) ships[(int) (ships.length * Math.random())];
cargo.addMothballedShip(FleetMemberType.SHIP, ship, null);
}
}
}

private static String [] ships = {
"relics_pusher_h_Hull",
"relics_egler_h_Hull",
"relics_solver_h_Hull",
"relics_arwar_h_Hull",
"relics_ringer_h_Hull",
"relics_carrioner_h_Hull",
"relics_intersepter_h_Hull",
"relics_sidewayer_h_Hull",
                                  "relics_plower_h_Hull",
                                    };

private static String [] wings = {
"relics_chaser_h_wing",
"relics_hiter_h_wing",
"relics_charger_h_wing"
};
private static String [] weapons = {
"relics_exo_h",
"relics_blazo_h",
"relics_zaap_h",
};



}


 
I guess is something that i did, but just in case.
Oh yes, i do not is this important but when convoy deliver goods he do not write this "All Purifiers cargo has been successfully delivered to Gate station."

Logged
Creator of:
Relics MOD - vanilla balanced - Campaign integrated
Vanilla addon MOD - vanilla balanced - Campaign integrated
Project ONI MOD - mission only

Reshy

  • Admiral
  • *****
  • Posts: 1100
  • White
    • View Profile
Re: Relics mod - 0 crew in moded station
« Reply #1 on: December 21, 2012, 12:17:32 PM »

They're actually grey goo in the guise of crewmen, if you put them together they turn into more grey goo.
Logged

ValkyriaL

  • Admiral
  • *****
  • Posts: 2145
  • The Guru of Capital Ships.
    • View Profile
Re: Relics mod - 0 crew in moded station
« Reply #2 on: December 21, 2012, 12:45:45 PM »

They don't, if you put more crew in the station, they also become "0".
Logged

Wyvern

  • Admiral
  • *****
  • Posts: 3803
    • View Profile
Re: Relics mod - 0 crew in moded station
« Reply #3 on: December 21, 2012, 12:53:18 PM »

I've seen this (exactly twice) in the Ironclads mod - wasn't able to track down what caused it, since I can't make the error happen on demand; it popped up those two times - and I've yet to see it since.  Got a zero stack of elite crew - which is particularly odd given that, as far as I could tell, no convoys in that mod ever delivered elite crew at all.
Logged
Wyvern is 100% correct about the math.