Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Starsector 0.9.1a is out! (05/10/19); Updated the Forum Rules and Guidelines (02/29/20); Blog post: GIF Roundup (04/11/20)

Pages: 1 ... 93 94 [95] 96 97 ... 281

Author Topic: Project Ironclads TC (28 of April, 2017) Source files for the mod  (Read 1421652 times)

silentstormpt

  • Admiral
  • *****
  • Posts: 1059
    • View Profile
Re: Project Ironclads, version 5.2 (0.54.1)
« Reply #1410 on: August 15, 2013, 01:25:36 PM »

OK I have attached a class (TimeManager) that runs methods at set intervals. I think it was originally made by LazyWizard?

Anyway, I have added a few methods at the bottom to illustrate the player mining supplies. It should all be functional as is but you will need to change it if you wish to have it mine different resources and for it to remove supplies for mining those resources. There are also a couple of methods to check if it is a mining fleet, and to get the number of mining wings.

I have also added a method to move the player fleet on game creation, currently into the middle of the sun... :P

You will need to add a new TimeManager object in your sector generation:
Code
public class ExampleSectorGen implements SectorGeneratorPlugin
{
public void generate(SectorAPI sector)
{
// Build and add a time manager
TimeManager timeManger = new TimeManager();
sector.getStarSystem("Corvus").addSpawnPoint(timeManger); //TODO - change if your star system has a different name
}
}

Hopefully it is what you are after :)

Since you changed the name, dont forget to change it on the sector.getStarSystem("Corvus").addSpawnPoint(timeManger);
Logged

Okim

  • Admiral
  • *****
  • Posts: 2146
    • View Profile
    • Okim`s Modelling stuff
Re: Project Ironclads, version 5.2 (0.54.1)
« Reply #1411 on: August 15, 2013, 01:36:38 PM »

That`s exactly what i meant. I changed it where Zaphide stated.

In any case the same error happens if i change it back to Corvus.

Okim

  • Admiral
  • *****
  • Posts: 2146
    • View Profile
    • Okim`s Modelling stuff
Re: Project Ironclads, version 5.2 (0.54.1)
« Reply #1412 on: August 15, 2013, 01:40:49 PM »

Ok. It compiles now. Had to edit both files to match this package data.scripts.world;/ Stupid me...

Okim

  • Admiral
  • *****
  • Posts: 2146
    • View Profile
    • Okim`s Modelling stuff
Re: Project Ironclads, version 5.2 (0.54.1)
« Reply #1413 on: August 15, 2013, 01:52:49 PM »

Well, nothing happens in the game. I have a proper miner that is present in the MINERSHIP LIST. I orbit an asteroid for some days - nothing happens.

I don`t get nither of two messages ('fleet invalid' or 'generated x supplies'). So... something is not working as intended.

silentstormpt

  • Admiral
  • *****
  • Posts: 1059
    • View Profile
Re: Project Ironclads, version 5.2 (0.54.1)
« Reply #1414 on: August 15, 2013, 02:13:03 PM »

Well, nothing happens in the game. I have a proper miner that is present in the MINERSHIP LIST. I orbit an asteroid for some days - nothing happens.

I don`t get nither of two messages ('fleet invalid' or 'generated x supplies'). So... something is not working as intended.

Add this code with a message on the runDaily to see if that script is running if so add it the when its checking if its a miningship

Code
Global.getSector().addMessage("A Day Passed");
Logged

Okim

  • Admiral
  • *****
  • Posts: 2146
    • View Profile
    • Okim`s Modelling stuff
Re: Project Ironclads, version 5.2 (0.54.1)
« Reply #1415 on: August 15, 2013, 02:20:53 PM »

Run daily does not display any messages in game.

silentstormpt

  • Admiral
  • *****
  • Posts: 1059
    • View Profile
Re: Project Ironclads, version 5.2 (0.54.1)
« Reply #1416 on: August 15, 2013, 02:23:07 PM »

Can you post the gen sector code, for some reason its not using the TimeManager script
Logged

Okim

  • Admiral
  • *****
  • Posts: 2146
    • View Profile
    • Okim`s Modelling stuff
Re: Project Ironclads, version 5.2 (0.54.1)
« Reply #1417 on: August 15, 2013, 02:32:19 PM »

Spoiler
package data.scripts.world;

import java.awt.Color;
import java.util.List;

import com.fs.starfarer.api.campaign.CampaignFleetAPI;
import com.fs.starfarer.api.campaign.CargoAPI;
import com.fs.starfarer.api.campaign.FactionAPI;
import com.fs.starfarer.api.campaign.FleetAssignment;
import com.fs.starfarer.api.campaign.SectorAPI;
import com.fs.starfarer.api.campaign.SectorEntityToken;
import com.fs.starfarer.api.campaign.SectorGeneratorPlugin;
import com.fs.starfarer.api.campaign.StarSystemAPI;
import com.fs.starfarer.api.campaign.CargoAPI.CrewXPLevel;
import com.fs.starfarer.api.fleet.FleetMemberType;
import data.scripts.plugins.CharacterCreationPluginImpl;

@SuppressWarnings("unchecked")
public class SectorGen implements SectorGeneratorPlugin {

   public void generate(SectorAPI sector) {
      
      StarSystemAPI system = sector.createStarSystem("Barnard`s Star");
      
      SectorEntityToken star = system.initStar("star_red", Color.white, 400f);
      
      SectorEntityToken corvusI = system.addPlanet(star, "Barnard I", "desert", 55, 150, 2500, 100);
      SectorEntityToken corvusII = system.addPlanet(star, "Barnard II", "jungle", 235, 200, 3500, 200);
      
      system.addAsteroidBelt(star, 200, 4200, 400, 150, 100);

      SectorEntityToken corvusIII = system.addPlanet(star, "Barnard III", "gas_giant_red", 30, 300, 6000, 400);
      
      SectorEntityToken corvusIIIA = system.addPlanet(corvusIII, "Barnard IIIA", "cryovolcanic", 235, 120, 800, 10);
      SectorEntityToken corvusIIIB = system.addPlanet(corvusIII, "Barnard IIIB", "barren", 90, 100, 1200, 60);
      
      SectorEntityToken corvusIV = system.addPlanet(star, "Barnard IV", "barren", 0, 100, 9000, 700);
      SectorEntityToken corvusV = system.addPlanet(star, "Barnard V", "frozen", 330, 175, 10000, 500);
      SectorEntityToken corvusVI = system.addPlanet(star, "Barnard VI", "frozen", 230, 175, 12000, 200);

      SectorEntityToken corvusVIA = system.addPlanet(corvusVI, "Barnard VIA", "frozen", 15, 90, 600, 5);
      SectorEntityToken corvusVIB = system.addPlanet(corvusVI, "Barnard VIB", "barren", 235, 60, 1200, 8);
      system.addAsteroidBelt(corvusVI, 100, 1000, 200, 50, 50);
      
      initFactionRelationships(sector);
   }
   
   private void initFactionRelationships(SectorAPI sector) {


      FactionAPI XLE = sector.getFaction("XLE");
      FactionAPI PIRATE = sector.getFaction("PIRATE");
      FactionAPI ISA = sector.getFaction("ISA");
      FactionAPI RSF = sector.getFaction("RSF");
      FactionAPI UIN = sector.getFaction("UIN");
      FactionAPI ALIEN = sector.getFaction("ALIEN");
      FactionAPI player = sector.getFaction("player");
      FactionAPI CIVILIANS = sector.getFaction("CIVILIANS");
      FactionAPI AI = sector.getFaction("AI");
      FactionAPI ROCK = sector.getFaction("ROCK");
      
      RSF.setRelationship(CIVILIANS.getId(), 1);
      RSF.setRelationship(XLE.getId(), 1);
      RSF.setRelationship(ALIEN.getId(), -1);
      RSF.setRelationship(ISA.getId(), -1);

      ISA.setRelationship(ALIEN.getId(), -1);
      ISA.setRelationship(CIVILIANS.getId(), 0);

      CIVILIANS.setRelationship(ALIEN.getId(), -1);

      PIRATE.setRelationship(CIVILIANS.getId(), -1);      
      PIRATE.setRelationship(RSF.getId(), -1);      
      PIRATE.setRelationship(ISA.getId(), -1);
      PIRATE.setRelationship(ALIEN.getId(), -1);

      XLE.setRelationship(CIVILIANS.getId(), 0);      
      XLE.setRelationship(RSF.getId(), 1);      
      XLE.setRelationship(ISA.getId(), 0);
      XLE.setRelationship(ALIEN.getId(), -1);
      XLE.setRelationship(PIRATE.getId(), -1);

      UIN.setRelationship(CIVILIANS.getId(), 0);      
      UIN.setRelationship(RSF.getId(), 0);   
      UIN.setRelationship(XLE.getId(), 0);      
      UIN.setRelationship(ISA.getId(), 1);
      UIN.setRelationship(ALIEN.getId(), -1);
      UIN.setRelationship(PIRATE.getId(), -1);

      AI.setRelationship(CIVILIANS.getId(), 0);      
      AI.setRelationship(RSF.getId(), 0);   
      AI.setRelationship(XLE.getId(), 0);      
      AI.setRelationship(ISA.getId(), 0);
      AI.setRelationship(ALIEN.getId(), -1);
      AI.setRelationship(PIRATE.getId(), 0);
      AI.setRelationship(UIN.getId(), 0);

      ROCK.setRelationship(CIVILIANS.getId(), -1);      
      ROCK.setRelationship(RSF.getId(), -1);   
      ROCK.setRelationship(XLE.getId(), -1);      
      ROCK.setRelationship(ISA.getId(), -1);
      ROCK.setRelationship(ALIEN.getId(), -1);
      ROCK.setRelationship(AI.getId(), -1);
      ROCK.setRelationship(PIRATE.getId(), -1);
      ROCK.setRelationship(UIN.getId(), -1);

      player.setRelationship(AI.getId(), 0);
      player.setRelationship(ROCK.getId(), -1);


      if (CharacterCreationPluginImpl.factionPick == 1) {

      player.setRelationship(CIVILIANS.getId(), 0);      
      player.setRelationship(RSF.getId(), 1);   
      player.setRelationship(XLE.getId(), 0);      
      player.setRelationship(ISA.getId(), -1);
      player.setRelationship(UIN.getId(), 0);
      player.setRelationship(ALIEN.getId(), -1);
      player.setRelationship(PIRATE.getId(), -1);

      } else if (CharacterCreationPluginImpl.factionPick == 2) {

      player.setRelationship(CIVILIANS.getId(), 0);      
      player.setRelationship(RSF.getId(), -1);   
      player.setRelationship(XLE.getId(), 0);      
      player.setRelationship(ISA.getId(), 1);
      player.setRelationship(UIN.getId(), 0);
      player.setRelationship(ALIEN.getId(), -1);
      player.setRelationship(PIRATE.getId(), -1);


      } else if (CharacterCreationPluginImpl.factionPick == 3) {

      player.setRelationship(CIVILIANS.getId(), 0);      
      player.setRelationship(RSF.getId(), 1);   
      player.setRelationship(XLE.getId(), 1);      
      player.setRelationship(ISA.getId(), 0);
      player.setRelationship(UIN.getId(), 0);
      player.setRelationship(ALIEN.getId(), -1);
      player.setRelationship(PIRATE.getId(), -1);


      } else if (CharacterCreationPluginImpl.factionPick == 4) {

      player.setRelationship(CIVILIANS.getId(), 0);      
      player.setRelationship(RSF.getId(), 0);   
      player.setRelationship(XLE.getId(), 0);      
      player.setRelationship(ISA.getId(), 1);
      player.setRelationship(UIN.getId(), 1);
      player.setRelationship(ALIEN.getId(), -1);
      player.setRelationship(PIRATE.getId(), -1);


      } else if (CharacterCreationPluginImpl.factionPick == 5) {

      player.setRelationship(CIVILIANS.getId(), -1);      
      player.setRelationship(RSF.getId(), -1);   
      player.setRelationship(XLE.getId(), -1);      
      player.setRelationship(ISA.getId(), -1);
      player.setRelationship(UIN.getId(), -1);
      player.setRelationship(ALIEN.getId(), -1);
      player.setRelationship(PIRATE.getId(), 1);


      } else {

      player.setRelationship(CIVILIANS.getId(), 0);      
      player.setRelationship(RSF.getId(), 0);   
      player.setRelationship(XLE.getId(), 0);      
      player.setRelationship(ISA.getId(), 0);
      player.setRelationship(UIN.getId(), 0);
      player.setRelationship(ALIEN.getId(), -1);
      player.setRelationship(PIRATE.getId(), -1);

      }

   
   }

   public class ExampleSectorGen implements SectorGeneratorPlugin
    {
     public void generate(SectorAPI sector)
      {
      // Build and add a time manager
      TimeManager timeManger = new TimeManager();
      sector.getStarSystem("Barnard`s Star").addSpawnPoint(timeManger); //TODO - change if your star system has a different name
      }
        }
}
[close]

Zaphide

  • Admiral
  • *****
  • Posts: 799
    • View Profile
Re: Project Ironclads, version 5.2 (0.54.1)
« Reply #1418 on: August 15, 2013, 02:38:53 PM »

Okkey...

Now i have to install LazyLib :)

oops sorry forgot to mention that was a required library :(

Move these lines:
Code
      // Build and add a time manager
      TimeManager timeManger = new TimeManager();
      sector.getStarSystem("Barnard`s Star").addSpawnPoint(timeManger); //TODO - change if your star system has a different name

to the top of your SectorGen.java in generate method:
Code
public class SectorGen implements SectorGeneratorPlugin {

   public void generate(SectorAPI sector) {
   StarSystemAPI system = sector.createStarSystem("Barnard`s Star");

   // Build and add a time manager
   TimeManager timeManger = new TimeManager();
   sector.getStarSystem("Barnard`s Star").addSpawnPoint(timeManger); //TODO - change if your star system has a different name

and then remove the following:
Code
public class ExampleSectorGen implements SectorGeneratorPlugin
    {
     public void generate(SectorAPI sector)
      {
      // Build and add a time manager
      TimeManager timeManger = new TimeManager();
      sector.getStarSystem("Barnard`s Star").addSpawnPoint(timeManger); //TODO - change if your star system has a different name
      }
        }

I only had that there as an example implementation. Sorry, I should have been more explicit.
Logged

silentstormpt

  • Admiral
  • *****
  • Posts: 1059
    • View Profile
Re: Project Ironclads, version 5.2 (0.54.1)
« Reply #1419 on: August 15, 2013, 02:41:46 PM »

u posted faster, like he said

Spoiler
package data.scripts.world;

import java.awt.Color;
import java.util.List;

import com.fs.starfarer.api.campaign.CampaignFleetAPI;
import com.fs.starfarer.api.campaign.CargoAPI;
import com.fs.starfarer.api.campaign.FactionAPI;
import com.fs.starfarer.api.campaign.FleetAssignment;
import com.fs.starfarer.api.campaign.SectorAPI;
import com.fs.starfarer.api.campaign.SectorEntityToken;
import com.fs.starfarer.api.campaign.SectorGeneratorPlugin;
import com.fs.starfarer.api.campaign.StarSystemAPI;
import com.fs.starfarer.api.campaign.CargoAPI.CrewXPLevel;
import com.fs.starfarer.api.fleet.FleetMemberType;
import data.scripts.plugins.CharacterCreationPluginImpl;

@SuppressWarnings("unchecked")
public class SectorGen implements SectorGeneratorPlugin {

   public void generate(SectorAPI sector) {
      
      StarSystemAPI system = sector.createStarSystem("Barnard`s Star");

      TimeManager timer = new TimeManager();
      system.addSpawnPoint(timer); //This needs to be declared AFTER the actual Star System is created
      
      SectorEntityToken star = system.initStar("star_red", Color.white, 400f);
      
      SectorEntityToken corvusI = system.addPlanet(star, "Barnard I", "desert", 55, 150, 2500, 100);
      SectorEntityToken corvusII = system.addPlanet(star, "Barnard II", "jungle", 235, 200, 3500, 200);
      
      system.addAsteroidBelt(star, 200, 4200, 400, 150, 100);

      SectorEntityToken corvusIII = system.addPlanet(star, "Barnard III", "gas_giant_red", 30, 300, 6000, 400);
      
      SectorEntityToken corvusIIIA = system.addPlanet(corvusIII, "Barnard IIIA", "cryovolcanic", 235, 120, 800, 10);
      SectorEntityToken corvusIIIB = system.addPlanet(corvusIII, "Barnard IIIB", "barren", 90, 100, 1200, 60);
      
      SectorEntityToken corvusIV = system.addPlanet(star, "Barnard IV", "barren", 0, 100, 9000, 700);
      SectorEntityToken corvusV = system.addPlanet(star, "Barnard V", "frozen", 330, 175, 10000, 500);
      SectorEntityToken corvusVI = system.addPlanet(star, "Barnard VI", "frozen", 230, 175, 12000, 200);

      SectorEntityToken corvusVIA = system.addPlanet(corvusVI, "Barnard VIA", "frozen", 15, 90, 600, 5);
      SectorEntityToken corvusVIB = system.addPlanet(corvusVI, "Barnard VIB", "barren", 235, 60, 1200, 8);
      system.addAsteroidBelt(corvusVI, 100, 1000, 200, 50, 50);
      
      initFactionRelationships(sector);
   }
   
   private void initFactionRelationships(SectorAPI sector) {


      FactionAPI XLE = sector.getFaction("XLE");
      FactionAPI PIRATE = sector.getFaction("PIRATE");
      FactionAPI ISA = sector.getFaction("ISA");
      FactionAPI RSF = sector.getFaction("RSF");
      FactionAPI UIN = sector.getFaction("UIN");
      FactionAPI ALIEN = sector.getFaction("ALIEN");
      FactionAPI player = sector.getFaction("player");
      FactionAPI CIVILIANS = sector.getFaction("CIVILIANS");
      FactionAPI AI = sector.getFaction("AI");
      FactionAPI ROCK = sector.getFaction("ROCK");
      
      RSF.setRelationship(CIVILIANS.getId(), 1);
      RSF.setRelationship(XLE.getId(), 1);
      RSF.setRelationship(ALIEN.getId(), -1);
      RSF.setRelationship(ISA.getId(), -1);

      ISA.setRelationship(ALIEN.getId(), -1);
      ISA.setRelationship(CIVILIANS.getId(), 0);

      CIVILIANS.setRelationship(ALIEN.getId(), -1);

      PIRATE.setRelationship(CIVILIANS.getId(), -1);      
      PIRATE.setRelationship(RSF.getId(), -1);      
      PIRATE.setRelationship(ISA.getId(), -1);
      PIRATE.setRelationship(ALIEN.getId(), -1);

      XLE.setRelationship(CIVILIANS.getId(), 0);      
      XLE.setRelationship(RSF.getId(), 1);      
      XLE.setRelationship(ISA.getId(), 0);
      XLE.setRelationship(ALIEN.getId(), -1);
      XLE.setRelationship(PIRATE.getId(), -1);

      UIN.setRelationship(CIVILIANS.getId(), 0);      
      UIN.setRelationship(RSF.getId(), 0);   
      UIN.setRelationship(XLE.getId(), 0);      
      UIN.setRelationship(ISA.getId(), 1);
      UIN.setRelationship(ALIEN.getId(), -1);
      UIN.setRelationship(PIRATE.getId(), -1);

      AI.setRelationship(CIVILIANS.getId(), 0);      
      AI.setRelationship(RSF.getId(), 0);   
      AI.setRelationship(XLE.getId(), 0);      
      AI.setRelationship(ISA.getId(), 0);
      AI.setRelationship(ALIEN.getId(), -1);
      AI.setRelationship(PIRATE.getId(), 0);
      AI.setRelationship(UIN.getId(), 0);

      ROCK.setRelationship(CIVILIANS.getId(), -1);      
      ROCK.setRelationship(RSF.getId(), -1);   
      ROCK.setRelationship(XLE.getId(), -1);      
      ROCK.setRelationship(ISA.getId(), -1);
      ROCK.setRelationship(ALIEN.getId(), -1);
      ROCK.setRelationship(AI.getId(), -1);
      ROCK.setRelationship(PIRATE.getId(), -1);
      ROCK.setRelationship(UIN.getId(), -1);

      player.setRelationship(AI.getId(), 0);
      player.setRelationship(ROCK.getId(), -1);


      if (CharacterCreationPluginImpl.factionPick == 1) {

      player.setRelationship(CIVILIANS.getId(), 0);      
      player.setRelationship(RSF.getId(), 1);   
      player.setRelationship(XLE.getId(), 0);      
      player.setRelationship(ISA.getId(), -1);
      player.setRelationship(UIN.getId(), 0);
      player.setRelationship(ALIEN.getId(), -1);
      player.setRelationship(PIRATE.getId(), -1);

      } else if (CharacterCreationPluginImpl.factionPick == 2) {

      player.setRelationship(CIVILIANS.getId(), 0);      
      player.setRelationship(RSF.getId(), -1);   
      player.setRelationship(XLE.getId(), 0);      
      player.setRelationship(ISA.getId(), 1);
      player.setRelationship(UIN.getId(), 0);
      player.setRelationship(ALIEN.getId(), -1);
      player.setRelationship(PIRATE.getId(), -1);


      } else if (CharacterCreationPluginImpl.factionPick == 3) {

      player.setRelationship(CIVILIANS.getId(), 0);      
      player.setRelationship(RSF.getId(), 1);   
      player.setRelationship(XLE.getId(), 1);      
      player.setRelationship(ISA.getId(), 0);
      player.setRelationship(UIN.getId(), 0);
      player.setRelationship(ALIEN.getId(), -1);
      player.setRelationship(PIRATE.getId(), -1);


      } else if (CharacterCreationPluginImpl.factionPick == 4) {

      player.setRelationship(CIVILIANS.getId(), 0);      
      player.setRelationship(RSF.getId(), 0);   
      player.setRelationship(XLE.getId(), 0);      
      player.setRelationship(ISA.getId(), 1);
      player.setRelationship(UIN.getId(), 1);
      player.setRelationship(ALIEN.getId(), -1);
      player.setRelationship(PIRATE.getId(), -1);


      } else if (CharacterCreationPluginImpl.factionPick == 5) {

      player.setRelationship(CIVILIANS.getId(), -1);      
      player.setRelationship(RSF.getId(), -1);   
      player.setRelationship(XLE.getId(), -1);      
      player.setRelationship(ISA.getId(), -1);
      player.setRelationship(UIN.getId(), -1);
      player.setRelationship(ALIEN.getId(), -1);
      player.setRelationship(PIRATE.getId(), 1);


      } else {

      player.setRelationship(CIVILIANS.getId(), 0);      
      player.setRelationship(RSF.getId(), 0);   
      player.setRelationship(XLE.getId(), 0);      
      player.setRelationship(ISA.getId(), 0);
      player.setRelationship(UIN.getId(), 0);
      player.setRelationship(ALIEN.getId(), -1);
      player.setRelationship(PIRATE.getId(), -1);

      }
   }
}
[close]
« Last Edit: August 15, 2013, 02:44:06 PM by silentstormpt »
Logged

Zaphide

  • Admiral
  • *****
  • Posts: 799
    • View Profile
Re: Project Ironclads, version 5.2 (0.54.1)
« Reply #1420 on: August 15, 2013, 02:46:53 PM »

Haha speedy speedy :)

Also, double check you are passing the correct hull id and/or variants in to the MiningShip objects you are creating.

The constructor for a MiningShip object is defined:
Code
public MiningShip(String variant_id, String hull_id, int effectiveness)

and you are creating the objects like this:
Code
MININGSHIP_IDS.add(new MiningShip("", "mining_drone_wing", 1));
MININGSHIP_IDS.add(new MiningShip("", "isa7-min-harvester_variant", 2));

I think you will want to do this instead (could be wrong):
Code
MININGSHIP_IDS.add(new MiningShip("mining_drone_wing", "", 1));
MININGSHIP_IDS.add(new MiningShip("isa7-min-harvester_variant", "", 2));
Logged

silentstormpt

  • Admiral
  • *****
  • Posts: 1059
    • View Profile
Re: Project Ironclads, version 5.2 (0.54.1)
« Reply #1421 on: August 15, 2013, 02:51:32 PM »

Haha speedy speedy :)

Also, double check you are passing the correct hull id and/or variants in to the MiningShip objects you are creating.

The constructor for a MiningShip object is defined:
Code
public MiningShip(String variant_id, String hull_id, int effectiveness)

and you are creating the objects like this:
Code
MININGSHIP_IDS.add(new MiningShip("", "mining_drone_wing", 1));
MININGSHIP_IDS.add(new MiningShip("", "isa7-min-harvester_variant", 2));

I think you will want to do this instead (could be wrong):
Code
MININGSHIP_IDS.add(new MiningShip("mining_drone_wing", "", 1));
MININGSHIP_IDS.add(new MiningShip("isa7-min-harvester_variant", "", 2));

Probably should add more possible Constructors using the FleetMemberAPI

Code
    public MiningShip(FleetMemberAPI fleetMember, 
            int effectiveness)
    {
            this.variant_id = fleetMember.getSpecId();
            this.hull_id = fleetMember.getHullId();
            this.effectiveness = effectiveness;
    }
and done.

EDIT: The reason im adding hull_ids as a possibility would be in cases where your hulls responsible for mining only do mining, with variant_ids you can be more specified but in reality we should actually check for the ship weapons, in hopes of finding mining weapons so expect this code to change later in.
« Last Edit: August 15, 2013, 02:57:47 PM by silentstormpt »
Logged

Okim

  • Admiral
  • *****
  • Posts: 2146
    • View Profile
    • Okim`s Modelling stuff
Re: Project Ironclads, version 5.2 (0.54.1)
« Reply #1422 on: August 15, 2013, 03:09:11 PM »

Well. The script now runs and the fact that i start a campaing in the middle of the sun + get 'a day passed' each day - confirm that.

But i still get no supplies for mining. And no messages either.

silentstormpt

  • Admiral
  • *****
  • Posts: 1059
    • View Profile
Re: Project Ironclads, version 5.2 (0.54.1)
« Reply #1423 on: August 15, 2013, 03:25:04 PM »

alright since the script now runs, were going for some debugging, did you do the changes on the MININGSHIP_IDS like Zaphide mentioned?

if you did now you need to copy the code that says "Day as passed" and place it more inside the code where theres System.Out.printin
Logged

Zaphide

  • Admiral
  • *****
  • Posts: 799
    • View Profile
Re: Project Ironclads, version 5.2 (0.54.1)
« Reply #1424 on: August 15, 2013, 06:53:55 PM »

Well. The script now runs and the fact that i start a campaing in the middle of the sun + get 'a day passed' each day - confirm that.

But i still get no supplies for mining. And no messages either.

Okim, provided you haven't changed the handlePlayerFleetMining() method I provided much, it should still write stuff to the StarSector log file. Have a look in there. I suspect it is failing the IsValidMiningFleet() check.

As to why it is failing, make sure your variants are fixed up as per my post above, and make sure they are the correct case as they appear in the .variant file id field (i.e. not "mInInG_DrOnE_WiNg") :)
Logged
Pages: 1 ... 93 94 [95] 96 97 ... 281