Fractal Softworks Forum

Please login or register.

Login with username, password and session length

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - gruntmaster1

Pages: [1] 2 3
1
Mods / Re: (0.6a) Shadowyards Heavy Industries v0.4.2
« on: September 21, 2013, 09:16:09 AM »
Link in first post seems broken. It is  http://url=https//www.dropbox.com/s/gviiu87xk2z4abd/shadow_ships0.4.2.zip when it should be http://www.dropbox.com/s/gviiu87xk2z4abd/shadow_ships0.4.2.zip

2
Modding / Re: Needs someone to make 15 icons.
« on: February 13, 2013, 03:16:21 PM »
making icons isn't really my specialty ,but i could give it a shot.
maybe it would be a good thing if everyone interrested makes just one icon and then you can decide which person to make them all.
It is not a bad idea, but currently there are zero interested, so not much to choose from xD.

3
Modding / Needs someone to make 15 icons.
« on: February 06, 2013, 03:43:46 PM »
Hi, for the upcomming version of my mod (shameless advertisement) I would appreciate if someone could make 2 skill icons and 13 resource icons (the 12 of them are for displaying information).

Details
Resources (display):
Total Available Materials: "Number of materials from converted and yet to be converted resources, weapons and ships."
Average Cost per Material: "The average purchase value per material of resources, weapons and ships that has not yet been converted."
Total Needed Materials: "The amount of materials required to produce all of the weapons and ships in the factory."
Current Needed Materials: "The amount of materials required to complete the weapons and ships that are currently being produced."
Total Materials per Day: "The amount of materials required each day on average if all of the weapons and ships in the factory could be produced."
Current Materials per Day:"The estimated amount of materials that will be spent on the next day."
Total Daily Income: "The sell value per day for all weapons and ships in the factory."
Total Daily Cost: "The estimated cost per day based on total materials per day and the average cost per material."
Total Daily Profit: "The profit per day based on total income and total cost."
Current Daily Income: "The sell value per day for weapons and ships that are currently under construction."
Current Daily Cost: "The estimated cost per day for weapons and ships currently under construction."
Current Daily Profit: "The profit based on current income per day and current cost per day."

Resource:
Unconverted Material: "Aside from the ship, this is the last remains of your days of glory." (from Freighter Start mod, has "Started a company which became successful..." as first option and "... and lost it all to pirates." as the second option.)

Skills (industry):
Repair Complex: "This place is heavily wreckaged and barely functional. Lets change that!"
effect: Increase amount of ships and weapons that can be produced at the same time.

Trade Organization Member: "Join the organization and make your life as a helpless trader less helpless. Note: Joining is bindable for life and failed payments will accumulate a credit."
effect: Pay a daily fee to get various benefits such as daily character exp and spawn drones in combat based on the flagship's cargospace. If you don't have enough money to pay, then you won't get any benefits and the fee will get added to a loan. You will have to pay off the loan before you can get the benefits again.

4
A correction to this. I just accidently started Uomoz's Corvus 17 with my Frieghter Start mod and it worked. I am not sure if it is a coincidence, due to Uomoz's having the same name as the original file in starsector-core and thus overwriting it, and mine inherits from it (so it ends up inheriting Uomoz's?).

Yes. Your code extends CharacterCreationPluginImpl, and Uomoz's Corvus overwrites the vanilla version of that file, so your code would be Uomoz's character creation plugin plus whatever changes you made on top of it.

Edit: if your plugin was chosen, that is; otherwise it would just be Uomoz's Corvus chargen. I don't know exactly how loading priority is handled, but I don't think you can guarantee your plugin would be the one picked.

Based on the log, loading priority is by gui name. 

5
The basic stuff for setting up the rest. As was mentioned before, this needs to be in data\scripts\plugins to work properly. I have given the class its own name, so it should not overwrite anything else and potentially become incompatibly with other mods. I extend the class in starsector-core instead of implementing the interface characterCreationPlugin. I can't comment on what would be best to do, expecially in context with compatibility with other mods.

According to Alex, the game will only accept one implementation of any one type of plugin*, and it will use the first implementation it finds. Any mod that has it own character creation plugin would be incompatible with your mod.

* Except EveryFrameCombatPlugin.

A correction to this. I just accidently started Uomoz's Corvus 17 with my Frieghter Start mod and it worked. I am not sure if it is a coincidence, due to Uomoz's having the same name as the original file in starsector-core and thus overwriting it, and mine inherits from it (so it ends up inheriting Uomoz's?).

6
Solved: Thanks to Alex for the help. The problem was caused by NetBeans including old and deleted files in the .jar. To solve this I used the Clean option and it then build the proper .jar.

Okay, I am having a really weird bug. I am not sure if I am missing something obvious or it is a bug with the game. I have tried to implement my first skill which enable you to produce more weapons and ships. The limit is calculated by passing the level to a class, called ProdInfo, when you initialize it and then you can use two methods for getting the description information. This is were things start to get weird.

The class ProdInfo is in my .jar while while the skill related files are in my mod. I first only had one method to return the string called getString(). This worked fine. I then made it to two methods, getStringTotal and getStringLevel. This resoulted in an error saying that it couldn't find method (can't remember if it specified a name). I then tried to make a getString() method returning "ProdInfo". This was now shown in the skills description. Now whatever I tell the skill to return as string, it won't show anything but "ProdInfo". I even tried to tell it to just: return "Total"; and return "Level"; directly, but it would still only show "ProdInfo".

ProdInfo was initially an inner class, but I then made it an outer class to see if that helped. All of this was tested in character creation.
Any ideas?

Edit: I tried removing the omncompl_RepairComplexEffect.java file which didn't resoult in an error. This would indicate a dublicate of sorts, but I can't find one, even when searching the whole starsector folder.

Skill effect:
Code
package data.characters.skills.scripts;

import com.fs.starfarer.api.characters.CharacterStatsSkillEffect;
import com.fs.starfarer.api.characters.MutableCharacterStatsAPI;
import data.scripts.world.ProdInfo;

public class omncompl_RepairComplexEffect implements CharacterStatsSkillEffect
{
  
    @Override
    public void apply(MutableCharacterStatsAPI stats, String id, float level)
    {
    }

    
    @Override
    public void unapply(MutableCharacterStatsAPI stats, String id)
    {
        
    }


    @Override
    public String getEffectDescription(float level)
    {
        //ProdInfo pro = new ProdInfo((int)level);
        return "Total";
    }

  
    @Override
    public String getEffectPerLevelDescription()
    {
        //ProdInfo pro = new ProdInfo(0);
        return "Level";
    }

  
    @Override
    public ScopeDescription getScopeDescription()
    {
        return ScopeDescription.ALL_OUTPOSTS;
    }
}

ProdInfo:
Code
package data.scripts.world;

import java.util.ArrayList;

public final class ProdInfo {
    ArrayList<Integer> wepAmount = new ArrayList<Integer>();
    ArrayList<Integer> shipAmount = new ArrayList<Integer>();

    public ProdInfo(int level) {
        wepAmount.add(2 * level + 2);
        wepAmount.add(1 * level + 1);
        wepAmount.add(1 * level + 1);
        wepAmount.add((int) Math.floor(0.5 * level));
        shipAmount.add((int) Math.floor(1.5 * level) + 1);
        shipAmount.add(1 * level + 1);
        shipAmount.add((int) Math.floor(2D / 3D * level));
        shipAmount.add((int) Math.floor(0.5 * level));
        shipAmount.add((int) Math.floor(2D / 7D * level));
    }

    public ProdInfo() {
        wepAmount.add(0);
        wepAmount.add(0);
        wepAmount.add(0);
        wepAmount.add(0);
        shipAmount.add(0);
        shipAmount.add(0);
        shipAmount.add(0);
        shipAmount.add(0);
        shipAmount.add(0);
    }

    public String getTotal() {
        return "Weapons:" + w(0) + w(1) + w(3) + ", ships:" + s(0) + s(1) + s(2) + s(3) + s(4);
    }

    public String getLevel() {
        return "Weapons: + 2 + 1 + 1/2, ships: + 1 1/2 + 1 + 2/3 + 1/2 + 2/7";
    }

    public String getString() {
        if (true) {
            return getLevel();
        }
        else {
            return getTotal();        
        }
    }

    public String w(int size) {
        return " + " + wepAmount.get(size);
    }

    public String s(int size) {
        return " + " + shipAmount.get(size);
    }
    
    
}

7
Mods / Re: Omni Complex 1.2 - Construct weapons and ships - 0.54.1a
« on: February 02, 2013, 09:46:41 AM »
I'm encountering a load of fatal null when putting ships in various mods into omni factory:
Quote
62818 [Thread-6] ERROR com.fs.starfarer.combat.D  - java.lang.NullPointerException
java.lang.NullPointerException
   at data.scripts.world.OmniComplex$ShipData.<init>(OmniComplex.java:829)
   at data.scripts.world.OmniComplex.checkCargo(OmniComplex.java:300)
   at data.scripts.world.OmniComplexManager.advance(OmniComplexManager.java:74)
   at com.fs.starfarer.campaign.BaseLocation.advance(Unknown Source)
   at com.fs.starfarer.campaign.CampaignEngine.advance(Unknown Source)
   at com.fs.starfarer.campaign.A.super(Unknown Source)
   at com.fs.starfarer.A.???000(Unknown Source)
   at com.fs.A.A.new(Unknown Source)
   at com.fs.starfarer.combat.D.o00000(Unknown Source)
   at com.fs.starfarer.StarfarerLauncher$2.run(Unknown Source)
   at java.lang.Thread.run(Thread.java:619)
running omni complex 1.2, did use compiler. it seems vanilla ships are unaffected.

what troubles me is that those ships were being churned out properly in ver. 1.1

edit: attempts with vanilla ships failed too, it seems only vanilla fighter wings are unaffected.

Thanks for reporting it, I just ran into it myself now. I will be looking into it and make a hotfix.

Edit: 1.21 released. Hopefully it should work correctly now, but report if it doesn't (please include what ship caused the error).

Edit 2: The ships which gave a null were those which were missing in the old GenAdvInfo.java. The current version (1.21) will not load the new entries unless you start a new game. I will try and make a 1.22 were the new info will be loaded on the first load after the patch. Any new entry afterwards will require you to start a new game for it to be added.

Edit 3: It seems like the .jar files and the rest of the mod isn't "connected" the way i thought and you will need to create a new game for the changes in GenAdvInfo to take effect.

8
Mods / Re: Omni Complex 1.2 - Construct weapons and ships - 0.54.1a
« on: February 02, 2013, 05:32:00 AM »
Latest version is out now. This is more of a polish patch, so there isn't much in regards of features, but it should enhance the overall experience. With the mod being less rough, and university starting soon, expect a much slower progress. Feel free to post bugs and criticism.

9
The basic stuff for setting up the rest. As was mentioned before, this needs to be in data\scripts\plugins to work properly. I have given the class its own name, so it should not overwrite anything else and potentially become incompatibly with other mods. I extend the class in starsector-core instead of implementing the interface characterCreationPlugin. I can't comment on what would be best to do, expecially in context with compatibility with other mods.

According to Alex, the game will only accept one implementation of any one type of plugin*, and it will use the first implementation it finds. Any mod that has it own character creation plugin would be incompatible with your mod.

* Except EveryFrameCombatPlugin.
Thank you for the clarification. That kinda blows :/
Do you know if character creation is called before the generators?

10
Since when is it this complicated :O

0.54  :P

11
Full code of my implemention:
Code
package data.scripts.plugins;

import com.fs.starfarer.api.campaign.CargoAPI;
import com.fs.starfarer.api.campaign.CargoAPI.CrewXPLevel;
import com.fs.starfarer.api.characters.CharacterCreationPlugin;
import com.fs.starfarer.api.characters.MutableCharacterStatsAPI;
import java.util.ArrayList;
import java.util.List;

public class IndustryCharacterCreation extends data.scripts.plugins.CharacterCreationPluginImpl {
    // Not using an enum for this because Janino doesn't support it.
    // It does, apparently, support using enums defined elsewhere - just can't compile new ones.

    private ResponseImpl OPTION1 = new ResponseImpl("You started a company which became sucessful...");
    private ResponseImpl OPTION2 = new ResponseImpl("... and lost it all to pirates.");
    private int stage = 0;
    private boolean isEntr = false;

    @SuppressWarnings("unchecked")
    @Override
    public List getResponses() {
        List result = new ArrayList();
        
        if (stage == 0) {
            result.add(OPTION1);
        } else if (stage == 1) {
            if (isEntr) {
                result.add(OPTION2);
            }
        }
        result.addAll(super.getResponses());
        return result;
    }

    @Override
    public void submit(CharacterCreationPlugin.Response response, CharacterCreationPlugin.CharacterCreationData data) {
        super.submit(response, data);
        
        stage++;
        MutableCharacterStatsAPI stats = data.getPerson().getStats();

        if (response == OPTION1) {
            stats.addAptitudePoints(1);
            stats.addSkillPoints(2);
            data.getStartingCargo().getCredits().add(2000);
            isEntr = true;
        }
        if (response == OPTION2) {
            stats.addAptitudePoints(1);
            stats.addSkillPoints(2);
            data.addStartingShipChoice("buffalo_Standard");
            data.getStartingCargo().getCredits().add(2000f);
        }

    }

    @Override
    public void startingShipPicked(String variantId, CharacterCreationPlugin.CharacterCreationData data) {
        if (variantId.equals("buffalo_Standard")) {
            data.getStartingCargo().addFuel(20);
            data.getStartingCargo().addSupplies(20);
            data.getStartingCargo().addItems(CargoAPI.CargoItemType.RESOURCES, "omncompl_uncmaterial", 200);
            data.getStartingCargo().addCrew(CrewXPLevel.GREEN, 10);
            data.getStartingCargo().addMarines(2);
            return;
        }
        super.startingShipPicked(variantId, data);
    }
}

Full code of the extended class:
Code
package data.scripts.plugins;

import java.util.ArrayList;
import java.util.List;

import com.fs.starfarer.api.campaign.CargoAPI.CrewXPLevel;
import com.fs.starfarer.api.characters.CharacterCreationPlugin;
import com.fs.starfarer.api.characters.MutableCharacterStatsAPI;

public class CharacterCreationPluginImpl implements CharacterCreationPlugin {

public static class ResponseImpl implements Response {
private String text;
public ResponseImpl(String text) {
this.text = text;
}
public String getText() {
return text;
}
}

// Not using an enum for this because Janino doesn't support it.
// It does, apparently, support using enums defined elsewhere - just can't compile new ones.
private ResponseImpl SUPPLY_OFFICER = new ResponseImpl("Served as a junior supply officer in an independent system's navy");
private ResponseImpl GUNNER = new ResponseImpl("Hired out as a gunner on a mercenary ship");
private ResponseImpl ENGINEER = new ResponseImpl("Found employment as an assistant engineer on an exploration vessel");
private ResponseImpl COPILOT = new ResponseImpl("Spent time as a co-pilot on a patrol ship in an independent system");
private ResponseImpl SOMETHING_ELSE_1 = new ResponseImpl("Did something else");
private ResponseImpl ADJUTANT = new ResponseImpl("Served as an adjutant in the Hegemony Navy");
private ResponseImpl QUARTERMASTER = new ResponseImpl("Performed the duties of a quartermaster on an independent warship");
private ResponseImpl HELM = new ResponseImpl("Helmed a patrol ship operating in a backwater system");
private ResponseImpl COMBAT_ENGINEER = new ResponseImpl("Took over the duties of chief combat engineer during a lengthy campaign");
private ResponseImpl SOMETHING_ELSE_2 = new ResponseImpl("Did something else");

private int stage = 0;
private String [] prompts = new String [] {
"Early in your career, you...",
"More recently, you...",
};

public String getPrompt() {
if (stage < prompts.length) return prompts[stage];
return null;
}

@SuppressWarnings("unchecked")
public List getResponses() {
List result = new ArrayList();
if (stage == 0) {
result.add(SUPPLY_OFFICER);
result.add(GUNNER);
result.add(ENGINEER);
result.add(COPILOT);
result.add(SOMETHING_ELSE_1);
} else if (stage == 1) {
result.add(ADJUTANT);
result.add(QUARTERMASTER);
result.add(HELM);
result.add(COMBAT_ENGINEER);
result.add(SOMETHING_ELSE_2);
}
return result;
}


public void submit(Response response, CharacterCreationData data) {
if (stage == 0) { // just in case
data.addStartingShipChoice("shuttle_Attack");
}

stage++;

MutableCharacterStatsAPI stats = data.getPerson().getStats();
if (response == SUPPLY_OFFICER) {
stats.increaseAptitude("leadership");
stats.increaseSkill("fleet_logistics");
stats.increaseSkill("command_experience");
data.getStartingCargo().getCredits().add(3000f);
} else if (response == GUNNER) {
stats.increaseAptitude("combat");
stats.increaseSkill("ordnance_expert");
stats.increaseSkill("target_analysis");
data.getStartingCargo().getCredits().add(3000f);
} else if (response == ENGINEER) {
stats.increaseAptitude("technology");
stats.increaseSkill("field_repairs");
stats.increaseSkill("mechanical_engineering");
data.getStartingCargo().getCredits().add(3000f);
} else if (response == COPILOT) {
stats.increaseAptitude("combat");
stats.increaseSkill("helmsmanship");
stats.increaseSkill("evasive_action");
data.getStartingCargo().getCredits().add(3000f);
} else if (response == SOMETHING_ELSE_1) {
stats.addAptitudePoints(1);
stats.addSkillPoints(2);
data.getStartingCargo().getCredits().add(1000f);
}

else if (response == ADJUTANT) {
stats.increaseAptitude("leadership");
stats.increaseSkill("fleet_logistics");
stats.increaseSkill("advanced_tactics");
data.addStartingShipChoice("lasher_Standard");
data.getStartingCargo().getCredits().add(3000f);
} else if (response == QUARTERMASTER) {
stats.increaseAptitude("technology");
stats.increaseSkill("navigation");
stats.addSkillPoints(1);
data.addStartingShipChoice("wolf_CS");
data.getStartingCargo().getCredits().add(3000f);
} else if (response == HELM) {
stats.increaseAptitude("combat");
stats.increaseSkill("helmsmanship");
stats.increaseSkill("evasive_action");
data.addStartingShipChoice("vigilance_Standard");
data.getStartingCargo().getCredits().add(3000f);
} else if (response == COMBAT_ENGINEER) {
stats.increaseAptitude("combat");
stats.increaseSkill("damage_control");
stats.increaseSkill("flux_modulation");
data.addStartingShipChoice("lasher_Standard");
data.getStartingCargo().getCredits().add(3000f);
} else if (response == SOMETHING_ELSE_2) {
stats.addAptitudePoints(1);
stats.addSkillPoints(2);
data.addStartingShipChoice("hound_Assault");
data.getStartingCargo().getCredits().add(1000f);
}
}

public void startingShipPicked(String variantId, CharacterCreationData data) {
MutableCharacterStatsAPI stats = data.getPerson().getStats();
stats.addAptitudePoints(1);
stats.addSkillPoints(2);

if (variantId.equals("vigilance_Standard")) {
data.getStartingCargo().addFuel(20);
data.getStartingCargo().addSupplies(30);
data.getStartingCargo().addCrew(CrewXPLevel.REGULAR, 20);
data.getStartingCargo().addMarines(5);
} else
if (variantId.equals("lasher_Standard")) {
data.getStartingCargo().addFuel(20);
data.getStartingCargo().addSupplies(20);
data.getStartingCargo().addCrew(CrewXPLevel.REGULAR, 40);
data.getStartingCargo().addMarines(10);
} else
if (variantId.equals("wolf_CS")) {
data.getStartingCargo().addFuel(20);
data.getStartingCargo().addSupplies(20);
data.getStartingCargo().addCrew(CrewXPLevel.REGULAR, 22);
data.getStartingCargo().addMarines(7);
} else
if (variantId.equals("shuttle_Attack")) {
data.getStartingCargo().addFuel(10);
data.getStartingCargo().addSupplies(10);
data.getStartingCargo().addCrew(CrewXPLevel.REGULAR, 10);
data.getStartingCargo().addMarines(3);
} else
if (variantId.equals("hound_Assault")) {
data.getStartingCargo().addFuel(30);
data.getStartingCargo().addSupplies(40);
data.getStartingCargo().addCrew(CrewXPLevel.REGULAR, 25);
data.getStartingCargo().addMarines(15);
} else {
data.getStartingCargo().addFuel(20);
data.getStartingCargo().addSupplies(20);
data.getStartingCargo().addCrew(CrewXPLevel.REGULAR, 20);
data.getStartingCargo().addMarines(10);
}
}
}

12
Starting options :),

Like how, before the last update, you would just do it in the data/world/factions/player.faction file

Okay, I'll try and break down my working example, although it doesn't do everything you can do and might not be implemented in an optimal way (but it works).

Code
package data.scripts.plugins;

import com.fs.starfarer.api.campaign.CargoAPI;
import com.fs.starfarer.api.campaign.CargoAPI.CrewXPLevel;
import com.fs.starfarer.api.characters.CharacterCreationPlugin;
import com.fs.starfarer.api.characters.MutableCharacterStatsAPI;
import java.util.ArrayList;
import java.util.List;

public class IndustryCharacterCreation extends data.scripts.plugins.CharacterCreationPluginImpl {
    // Not using an enum for this because Janino doesn't support it.
    // It does, apparently, support using enums defined elsewhere - just can't compile new ones.

The basic stuff for setting up the rest. As was mentioned before, this needs to be in data\scripts\plugins to work properly. I have given the class its own name, so it should not overwrite anything else and potentially become incompatibly with other mods. I extend the class in starsector-core instead of implementing the interface characterCreationPlugin. I can't comment on what would be best to do, expecially in context with compatibility with other mods.

Code
    private ResponseImpl OPTION1 = new ResponseImpl("option 1 text");
    private ResponseImpl OPTION2 = new ResponseImpl("option 2 text");
    private int stage = 0;
    private boolean isEntr = false;

Here we set up the fields we will use. ResponseImpl is from the class that we extended and if you implemented the interface then you would have to make your own (could just copy-paste it from the extended class). They are the ones that the player can choose from, though we will have to specify when they are shown in getResponses(). Aside from that we have stage as the one in the extended class is private and then a boolean as I only wanted to show the second response if the first was selected.

Code
    @SuppressWarnings("unchecked")
    @Override
    public List getResponses() {
        List result = new ArrayList();
        
        if (stage == 0) {
            result.add(OPTION1);
        } else if (stage == 1) {
            if (isEntr) {
                result.add(OPTION2);
            }
        }
        result.addAll(super.getResponses());
        return result;
    }

Before talking about this code, I want to mention that there is a method before it called getPrompt(). You will only need to override it if you need to change the amount of times the player selects a response. There is also a field called prompts that you can override if you want to change the text above options (the one asking the "questions") or change the amount of times the player selects a response.

About the code itself. The repsonses the player selects from is based of a list. This method, getResponses(), is where we create that list. We start by creating the list and then check what stage we are in. If we're in the second stage (stage == 1) then we also check if the previous choice was our first option through our field isEntr. After this we call the same method from our extended class and put the responses in the list that it returns in our list. Finally we return our list.

Code
    @Override
    public void submit(CharacterCreationPlugin.Response response, CharacterCreationPlugin.CharacterCreationData data) {
        super.submit(response, data);
        
        stage++;
        MutableCharacterStatsAPI stats = data.getPerson().getStats();

        if (response == OPTION1) {
            stats.addAptitudePoints(1);
            stats.addSkillPoints(2);
            data.getStartingCargo().getCredits().add(2000);
            isEntr = true;
        }
        if (response == OPTION2) {
            stats.addAptitudePoints(1);
            stats.addSkillPoints(2);
            data.addStartingShipChoice("buffalo_Standard");
            data.getStartingCargo().getCredits().add(2000f);
        }

    }

The next method is submit(). This method is called after a response is selected. We start with calling the same method from the extended class, in case that one of ours wasn't selected. Afterwards we increment stage by 1 and create a variable to access player stats so we won't have to type the whole thing again. Then using an if for each possible repsonse we dertermine which response was selected and do the stuff we want to if it was one of ours. To see how to increase a specific skill or apptitude look at the extended class.

Code
    @Override
    public void startingShipPicked(String variantId, CharacterCreationPlugin.CharacterCreationData data) {
        if (variantId.equals("buffalo_Standard")) {
            data.getStartingCargo().addFuel(20);
            data.getStartingCargo().addSupplies(20);
            data.getStartingCargo().addItems(CargoAPI.CargoItemType.RESOURCES, "omncompl_uncmaterial", 200);
            data.getStartingCargo().addCrew(CrewXPLevel.GREEN, 10);
            data.getStartingCargo().addMarines(2);
            return;
        }
        super.startingShipPicked(variantId, data);
    }
}

b]getPrompt()[/b] will return null once stage exceeds the amount of prompts availaible. Once that happens, the player will be given a selection of ships to pick from based of the data.addStartingShipChoice(String Variantid) method. When a ship is selected, this method will be called. We have access to the same amount of information as in submit() and can thus do the same amount of things. In this case, I just add the starting resources including one from my mod. I added a return; in the if and only call the extended class method at the end, because it has an option if none of the ships it expected was picked and will add extra resources to our ship, which we are not interested in.

The end.

13
How do you mod the starting player fleet? And the various explanations for each variable inside it.

Been a while....
To be more clear, is it just the fleet you want to modify (add ships, resources, weapons, etc.) or modify/add the starting options?

I think (haven't tried) you can type this in your generator, if you just want to add extra stuff:
Code
        CargoAPI cargo = Global.getSector().getPlayerFleet().getCargo();
        cargo.addItems(CargoAPI.CargoItemType.RESOURCES, "supplies", 20);
        cargo.addMothballedShip(FleetMemberType.SHIP, "ID", null);
        cargo.addWeapons("id", 3);

14
I also did, as you can see it extends that class. The issue was that I had package data.scripts.world and it was in data\scripts\world, but didn't run. Changing it to package data.scripts.plugins and putting it in data\scripts\plugins however made it run.

This is because data/scripts/plugins is a special folder. All scripts in this folder that implement a plugin will be automatically added to the game, and for all plugins except combat plugins (which can be added via mission definitions) this is the only way to activate them.
I figured it was something along those lines, but had to learn it the hard way xD. Thanks for the clarification, might help avoid similar issues in the future.

15
"package data.scripts.world;" this means the script will only run in data/scripts/world, if you want it to run somewhere else eg: data/scripts/startingstuff you have to change the package ->
package data.scripts.startingstuff;

Isn't CharacterCreationPluginImpl.java the place to look for this? Since it creates your starting ship?
I also did, as you can see it extends that class. The issue was that I had package data.scripts.world and it was in data\scripts\world, but didn't run. Changing it to package data.scripts.plugins and putting it in data\scripts\plugins however made it run.

Pages: [1] 2 3