Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Pages: 1 ... 57 58 [59] 60 61 ... 710

Author Topic: Misc modding questions that are too minor to warrant their own thread  (Read 1721439 times)

Erick Doe

  • Global Moderator
  • Admiral
  • *****
  • Posts: 2489
  • "Pretty cunning, don't you think?"
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #870 on: September 24, 2013, 06:58:21 AM »

I can't get a proper convoy to spawn in and deliver goods to the station:


I've tried adding a Zorg convoy to deliver random weapons and ships to Zorg Zeta.


I've added this line to the ZorgGen:
      system.addScript(new ZorgConvoySpawn(sector, hyper, 1, 10, hyper.createToken(-6000, 2000), station));


Maybe I forgot to import something?

ZorgConvoySpawn.java:
Code
package data.scripts.world.systems;

import java.util.List;

import com.fs.starfarer.api.Global;
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.campaign.StarSystemAPI;
import com.fs.starfarer.api.fleet.FleetMemberAPI;
import com.fs.starfarer.api.fleet.FleetMemberType;

import data.scripts.world.BaseSpawnPoint;

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

private final SectorEntityToken convoyDestination;

public ZorgConvoySpawn (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() {
String type = null;
float r = (float) Math.random();
if (r > .75f) {
type = "prospectors";
} else if (r > 0.5f) {
type = "salvagers";
} else {
type = "assimilators";
}

StarSystemAPI corvus = Global.getSector().getStarSystem("Corvus");
float angle = (float) ((float) Math.random() * Math.PI * 2f);
float x = (float) (Math.cos(angle) * 12000f) + corvus.getLocation().x;
float y = (float) (Math.sin(angle) * 12000f) + corvus.getLocation().y;
SectorEntityToken spawnPoint = Global.getSector().getHyperspace().createToken(x, y);

CampaignFleetAPI fleet = getSector().createFleet("zorg", type);
spawnPoint.getContainingLocation().spawnFleet(spawnPoint, 0, 0, fleet);

fleet.setPreferredResupplyLocation(convoyDestination);

CargoAPI cargo = fleet.getCargo();

addRandomWeapons(cargo, (int) (Math.random() * 3f) + 2);
addRandomShips(fleet, (int) (Math.random() * 2f) + 0);

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

convoyNumber++;
return fleet;
}

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

private void addRandomShips(CampaignFleetAPI fleet, int count) {
List wings = getSector().getAllFighterWingIds();
List ships = getSector().getAllEmptyVariantIds();
for (int i = 0; i < count; i++) {
if ((float) Math.random() > 0.4f) {
String wing = (String) wings.get((int) (wings.size() * Math.random()));
FleetMemberAPI member = Global.getFactory().createFleetMember(FleetMemberType.FIGHTER_WING, wing);
fleet.getFleetData().addFleetMember(member);
member.getRepairTracker().setMothballed(true);
} else {
String ship = (String) ships.get((int) (ships.size() * Math.random()));
FleetMemberAPI member = Global.getFactory().createFleetMember(FleetMemberType.SHIP, ship);
fleet.getFleetData().addFleetMember(member);
member.getRepairTracker().setMothballed(true);
}
}
}

}






ZorgGen.java:

I added this line:
system.addScript(new ZorgConvoySpawn(sector, hyper, 1, 10, hyper.createToken(-6000, 2000), station));

Code
package data.scripts.world.zorg;

import com.fs.starfarer.api.campaign.FactionAPI;
import com.fs.starfarer.api.InteractionDialogImageVisual;
import com.fs.starfarer.api.Global;
import com.fs.starfarer.api.campaign.CargoAPI;
import com.fs.starfarer.api.campaign.CargoAPI.CrewXPLevel;
import com.fs.starfarer.api.campaign.JumpPointAPI;
import com.fs.starfarer.api.campaign.LocationAPI;
import com.fs.starfarer.api.campaign.OrbitAPI;
import com.fs.starfarer.api.campaign.PlanetAPI;
import com.fs.starfarer.api.campaign.SectorAPI;
import com.fs.starfarer.api.campaign.SectorEntityToken;
import com.fs.starfarer.api.campaign.StarSystemAPI;
import com.fs.starfarer.api.fleet.FleetMemberType;
import com.fs.starfarer.api.impl.campaign.CoreCampaignPluginImpl;
import java.awt.Color;
import java.util.List;

@SuppressWarnings("unchecked")
public class ZorgGen {

public void generate(SectorAPI sector) {

StarSystemAPI system = sector.createStarSystem("Zorg Zeta");
LocationAPI hyper = Global.getSector().getHyperspace();
system.setBackgroundTextureFilename("graphics/zorg/backgrounds/backgroundzorg3.png");

// create the star and generate the hyperspace anchor for this system
PlanetAPI star = system.initStar("star_zorg", // id in planets.json
200f, // radius (in pixels at default zoom)
10000, -10000);   // location in hyperspace

system.setLightColor(new Color(25, 75, 55)); // light color in entire system, affects all entities


/*
* addPlanet() parameters:
* 1. What the planet orbits (orbit is always circular)
* 2. Name
* 3. Planet type id in planets.json
* 4. Starting angle in orbit, i.e. 0 = to the right of the star
* 5. Planet radius, pixels at default zoom
* 6. Orbit radius, pixels at default zoom
* 7. Days it takes to complete an orbit. 1 day = 10 seconds.
*/
PlanetAPI z1 = system.addPlanet(star, "Zeta I", "rocky_metallic", 0, 100, 5000, 100);

PlanetAPI z2 = system.addPlanet(star, "Zeta II", "rocky_metallic", 90, 150, 10000, 150);



JumpPointAPI jumpPoint = Global.getFactory().createJumpPoint("Inner System Jump");
OrbitAPI orbit = Global.getFactory().createCircularOrbit(z1, 0, 1000, 10);
jumpPoint.setOrbit(orbit);
jumpPoint.setRelatedPlanet(z1);
jumpPoint.setStandardWormholeToHyperspaceVisual();
system.addEntity(jumpPoint);


    FactionAPI zorg = sector.getFaction("zorg");

      zorg.setRelationship("hegemony", -1);
      zorg.setRelationship("tritachyon", -1);
      zorg.setRelationship("pirates", -1);
      zorg.setRelationship("independent", 0);
      zorg.setRelationship("player", 0);


SectorEntityToken station = system.addOrbitalStation(star, 180, 500, 10, "Unimatrix", "zorg");
initStationCargo(station);

station.setCustomInteractionDialogImageVisual(new InteractionDialogImageVisual("illustrations", "cargo_loading", 640, 400));

// example of using custom visuals below
// a1.setCustomInteractionDialogImageVisual(new InteractionDialogImageVisual("illustrations", "hull_breach", 800, 800));
// jumpPoint.setCustomInteractionDialogImageVisual(new InteractionDialogImageVisual("illustrations", "space_wreckage", 1200, 1200));
// station.setCustomInteractionDialogImageVisual(new InteractionDialogImageVisual("illustrations", "cargo_loading", 1200, 1200));

// generates hyperspace destinations for in-system jump points
system.autogenerateHyperspaceJumpPoints(true, true);

                ZorgSpawnPoint ZSpawn = new ZorgSpawnPoint(sector, system, 3, 12, station);
system.addSpawnPoint(ZSpawn);
    for (int i = 0; i < 3; i++) ZSpawn.spawnFleet();


system.addScript(new ZorgConvoySpawn(sector, hyper, 1, 10, hyper.createToken(-6000, 2000), station));
                   
                   
                sector.registerPlugin(new CoreCampaignPluginImpl());
}


private void initStationCargo(SectorEntityToken station) {
CargoAPI cargo = station.getCargo();
addRandomWeapons(cargo, 10);

cargo.addCrew(CrewXPLevel.VETERAN, 20);
cargo.addCrew(CrewXPLevel.REGULAR, 500);
cargo.addCrew(CrewXPLevel.GREEN, 500);
cargo.addMarines(300);
cargo.addSupplies(2000);
cargo.addFuel(1000);
cargo.addWeapons("adaptorray", 3);
cargo.addWeapons("concussionray", 3);
cargo.addWeapons("disruptorray", 3);
cargo.addWeapons("handlerray", 5);
cargo.addWeapons("interdictorray", 5);
cargo.addWeapons("transmitterray", 3);

cargo.getMothballedShips().addFleetMember(Global.getFactory().createFleetMember(FleetMemberType.SHIP, "zorg_allocator_Active"));
cargo.getMothballedShips().addFleetMember(Global.getFactory().createFleetMember(FleetMemberType.SHIP, "zorg_control_matrix_Active"));
cargo.getMothballedShips().addFleetMember(Global.getFactory().createFleetMember(FleetMemberType.SHIP, "zorg_control_matrix_Armoured"));
cargo.getMothballedShips().addFleetMember(Global.getFactory().createFleetMember(FleetMemberType.SHIP, "zorg_drone_ActiveY"));
cargo.getMothballedShips().addFleetMember(Global.getFactory().createFleetMember(FleetMemberType.SHIP, "zorg_drone_ActiveZ"));
cargo.getMothballedShips().addFleetMember(Global.getFactory().createFleetMember(FleetMemberType.SHIP, "zorg_surveyor_ActiveY"));
cargo.getMothballedShips().addFleetMember(Global.getFactory().createFleetMember(FleetMemberType.SHIP, "zorg_surveyor_ActiveZ"));
cargo.getMothballedShips().addFleetMember(Global.getFactory().createFleetMember(FleetMemberType.SHIP, "zorg_tactical_overseer_Active"));
cargo.getMothballedShips().addFleetMember(Global.getFactory().createFleetMember(FleetMemberType.SHIP, "zorg_tactical_probe_Active"));
cargo.getMothballedShips().addFleetMember(Global.getFactory().createFleetMember(FleetMemberType.FIGHTER_WING, "zorg_worker_wing"));
cargo.getMothballedShips().addFleetMember(Global.getFactory().createFleetMember(FleetMemberType.FIGHTER_WING, "zorg_worker_wing"));
cargo.getMothballedShips().addFleetMember(Global.getFactory().createFleetMember(FleetMemberType.FIGHTER_WING, "zorg_disabler_wing"));
cargo.getMothballedShips().addFleetMember(Global.getFactory().createFleetMember(FleetMemberType.FIGHTER_WING, "zorg_disabler_wing"));
cargo.getMothballedShips().addFleetMember(Global.getFactory().createFleetMember(FleetMemberType.FIGHTER_WING, "zorg_probe_wing"));
cargo.getMothballedShips().addFleetMember(Global.getFactory().createFleetMember(FleetMemberType.FIGHTER_WING, "zorg_probe_wing"));

}


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

}


Help?  :o
Logged

PCCL

  • Admiral
  • *****
  • Posts: 2016
  • still gunnyfreak
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #871 on: September 24, 2013, 10:59:43 AM »

does it just straight up not spawn? Or is there like a crash or something?
Logged
mmm.... tartiflette

Thaago

  • Global Moderator
  • Admiral
  • *****
  • Posts: 7214
  • Harpoon Affectionado
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #872 on: September 24, 2013, 11:28:15 AM »

I'd be surprised if that doesn't crash... the add script method needs an implementation of EveryFrameScript, not a spawnpoint.

A different question: is it currently possible to change the amount of money enemy fleets give on death, or to change the amount of loot they drop? (I'm interested in drastically reducing both).
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24118
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #873 on: September 24, 2013, 12:33:23 PM »

Just a heads up:

I had to rename the custom image that I wanted to use to one of the vanilla images, like "cargo_loading". For some reason it didn't work (crash to desktop) when I entered the custom file's name "zorg_interior". It works fine now, but it is still a little odd to me that I can't use a custom name for the file.

To clarify, I had to rename the image file in my mod from "zorg_interior" to "cargo_loading". Otherwise the game crashes to desktop when trying to dock with the station that uses the custom image.

Did you add your zorg_interior to the "illustrations" section in settings.json? That'll ensure the image is actually loaded when the game runs. If you did and it still didn't work: what does the crash log say?


A different question: is it currently possible to change the amount of money enemy fleets give on death, or to change the amount of loot they drop? (I'm interested in drastically reducing both).

Yes, but you'd have to provide a custom implementation of the FleetEncounterInteractionPlugin. The changes themselves would be pretty minor, but it's just a question of providing your adjusted implementation via a CoreCampaignPlugin and building a jar with all the right stuff. Basically, you'd want to start with the core implementation and tweak it a bit.
Logged

Gotcha!

  • Admiral
  • *****
  • Posts: 1124
    • View Profile
    • Welcome to New Hiigara
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #874 on: September 24, 2013, 12:53:02 PM »

Alex, is it possible to create some possibility to have certain items and ships persistent onboard a station, at least until the player buys them?

Both my mods use (quest)items that unlock higher class ships.
- When these items disappear (and they do) then players won't be able to access these higher class ships.
- Only a limited number of these ships are unlocked and traders are not delivering new ones, meaning players can lose their chance to have these specific ships.

I hereby desperately beg for a way to make items and ships a permanent presence until the player buys them.

Like:
Code
Cargo.addMothballedShip(FleetMemberType.SHIP, "hii_sajuuk_Hull", null,persistent:true);
Code
Cargo.addItems(CargoAPI.CargoItemType.RESOURCES, "hiigaran_badge_of_admiralty", 1,persistent:true);
Logged
  

Thaago

  • Global Moderator
  • Admiral
  • *****
  • Posts: 7214
  • Harpoon Affectionado
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #875 on: September 24, 2013, 02:53:14 PM »

...

A different question: is it currently possible to change the amount of money enemy fleets give on death, or to change the amount of loot they drop? (I'm interested in drastically reducing both).

Yes, but you'd have to provide a custom implementation of the FleetEncounterInteractionPlugin. The changes themselves would be pretty minor, but it's just a question of providing your adjusted implementation via a CoreCampaignPlugin and building a jar with all the right stuff. Basically, you'd want to start with the core implementation and tweak it a bit.

Ah, I see. In the following:
Code
case CONTINUE_LOOT:

visual.setVisualFade(0, 0);
dialog.hideTextPanel();

visual.showLoot("Salvaged", context.getLoot(), new CoreInteractionListener() {

...

context.getLoot() returns a cargoAPI that I could edit to my hearts content before passing is to visual. (And later is the credits, same deal but with float/ints.)

When registering the edited CoreCampaignPlugin, its enough to just make a ModPlugin that calls Global.getSector().registerPlugin(new MyCampaignPlugin()), right? And with priority MOD_GENERAL the new implementation will be default rather than the old?


Sorry for so many questions, I'm just still wrapping my head around how the plugins work. Thanks for all the help!
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24118
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #876 on: September 24, 2013, 04:16:21 PM »

context.getLoot() returns a cargoAPI that I could edit to my hearts content before passing is to visual. (And later is the credits, same deal but with float/ints.)

Yep, you could do that. Or you could make a copy of FleetEncounterContext and adjust the scrapDisabledShipsAndGenerateLoot() method, and also edit your FleetEncounterInteractionPlugin version to call your customized FleetEncounterContext version. It's also got a computeCreditsLooted() method. Either way should be fine.


When registering the edited CoreCampaignPlugin, its enough to just make a ModPlugin that calls Global.getSector().registerPlugin(new MyCampaignPlugin()), right? And with priority MOD_GENERAL the new implementation will be default rather than the old?

Correct.
Logged

Thule

  • Admiral
  • *****
  • Posts: 580
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #877 on: September 25, 2013, 04:01:05 AM »

IIRC there was a mechanic that allowed you to raise your hardflux in prior releases. Cant quite remember when last i saw it.
Would it be possible to mod this kind of mechanic, preferable as a hullmod?
Logged

Erick Doe

  • Global Moderator
  • Admiral
  • *****
  • Posts: 2489
  • "Pretty cunning, don't you think?"
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #878 on: September 25, 2013, 06:44:46 AM »

I believe this has been asked before, but I simply couldn't find it.

Is it possible to set a score of music for an individual system?
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24118
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #879 on: September 25, 2013, 08:22:24 AM »

IIRC there was a mechanic that allowed you to raise your hardflux in prior releases. Cant quite remember when last i saw it.
Would it be possible to mod this kind of mechanic, preferable as a hullmod?

It's possible, but afaik it was gone via scripting. Take a look at the FluxTrackerAPI and HullModEffect.applyInCombat()

Is it possible to set a score of music for an individual system?

Not at the moment.
Logged

Cycerin

  • Admiral
  • *****
  • Posts: 1665
  • beyond the infinite void
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #880 on: September 25, 2013, 08:39:20 AM »

Gotta let us do that soon, Alex. ;D
Logged

MShadowy

  • Admiral
  • *****
  • Posts: 911
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #881 on: September 25, 2013, 08:54:34 AM »

Okay, yeah, I'm about at the limits of my ability here.  The boolean for optionSelected keeps returning "void" no matter what boolean I end up putting in there.  Only thing that occurs to me is that I must have gone entirely in the wrong direction.  Fah, I should probably ask someone who's actually put together new interactions how they did it.

Spoiler
Code
	public zzazzPaintDialogPlugin( ShipAPI ship) {    
            if (station.getName() == "Zzazz Painters") {

            //Makes strings of the mapped lists from the init file
            String spriteName = initShadowyards.spriteNames.toString();
            String styleName = initShadowyards.getStyles.toString();
           
            for (FleetMemberAPI member : playerFleet.getFleetData().getMembersListCopy()) {   
            String hullType = member.getSpecId();
               
                    if (initShadowyards.spriteNames.keySet().contains(hullType)); {
                        //iterate through the available styles
                        List styleList = new ArrayList(initShadowyards.getStyles.values());
                        Collections.sort(styleList);                   
                   
                        //List spriteList = new ArrayList(initShadowyards.spriteNames.values());
                        //Collections.sort(spriteList);
                   
                        List styles = styleList;
                        Iterator iter = styles.iterator();
                        while (iter.hasNext()) {   
                            //Dynamically add options based on the number of styles available in the styleList and name it appropriately from the styleName
                            options.addOption(styleName, styles);
                            options.getSelectorValue(styles);
                       
                            //kludge together the styles directory and spriteName to show the adjusted ship sprite on mouseover
                            worker.optionMousedOver(styleName, Global.getSettings().getSprite(styles + spriteName));
                       
                            //if the option is selected, change the ships sprite to match
                            if (worker.optionSelected(styleName, ship.equals(styles))) { //always void, all the time!
                                ship.setSprite(hullType, styles + spriteName);
                            }
                        }
                    }
                }
            }
}
[close]

And just in case the problem is the list assembly:

Spoiler
Code
package data.scripts.world;

import java.util.*;

public final class initShadowyards
{
   
    public static final Map spriteNames;
    public static final Map getStyles;
   
    //InteractionDialogAPI zazz = (); //get the location of the InteractionPlugin here:
   
    static
    {
    Map spriteNamesTmp = new HashMap();
        //Charybdis
        spriteNamesTmp.put("ms_charybdis",
                (new String[]
                {
                    "ms_charybdis.png"
                }));
   
        //Elysium
        spriteNamesTmp.put("ms_elysium",
                (new String[]
                {
                    "ms_elysium.png"
                }));
       
        //Enlil
        spriteNamesTmp.put("ms_enlil",
                (new String[]
                {
                    "ms_enlil.png"
                }));
       
        //Inanna
        spriteNamesTmp.put("ms_inanna",
                (new String[]
                {
                    "ms_inanna.png"
                }));
       
        //Mimir
        spriteNamesTmp.put("ms_mimir",
                (new String[]
                {
                    "ms_mimir.png"
                }));
       
        //Morningstar
        spriteNamesTmp.put("ms_morningstar",
                (new String[]
                {
                    "ms_morningstar.png"
                }));
       
        //Sargasso
        spriteNamesTmp.put("ms_sargasso",
                (new String[]
                {
                    "ms_sargasso.png"
                }));
       
        //Seski
        spriteNamesTmp.put("ms_seski",
                (new String[]
                {
                    "ms_seski.png"
                }));
       
        //Shamash
        spriteNamesTmp.put("ms_shamash",
                (new String[]
                {
                    "phase/ms_shamash.png"
                }));
       
        //Tartarus
        spriteNamesTmp.put("ms_tartarus",
                (new String[]
                {
                    "ms_tartarus.png"
                }));
               
        //Scylla
        spriteNamesTmp.put("ms_scylla",
                (new String[]
                {
                    "phase/ms_scylla.png"
                }));
   
        spriteNames = Collections.unmodifiableMap(spriteNamesTmp);
    }
   
    static
    {
    Map getStylesTmp = new HashMap();
   
        getStylesTmp.put("Blue",
            (new String[]
            {
                "graphics/shadow_ships/blue/"
            }));
   
        getStylesTmp.put("Mercenary",
            (new String[]
            {
                "graphics/shadow_ships/mercenary/"
            }));
   
        getStylesTmp.put("Red Wing",
            (new String[]
            {
                "graphics/shadow_ships/redwing/"
            }));
   
        getStylesTmp.put("Default",
            (new String[]
            {
                "graphics/ships/shadow_ships/"
            }));
   
        getStyles = Collections.unmodifiableMap(getStylesTmp);
    }
   
    private initShadowyards()
    {
        // just to keep this from being instantiated or subclassed I guess
    }

    // Minor convenience tweak for better readability in the static initializer
    private static List createGraphicsList(String[] graphics)
    {
        return Collections.unmodifiableList(Arrays.asList(graphics));
    }
   
    //the following two sections attempt to turn the list data into a useable string
    //public static void setHull(FleetMemberAPI ship, FleetDataAPI data)
    //{
       
        //get the sprites
        //spriteNames.toString();
    //    String hullType = ship.getSpecId();
    //    if (!spriteNames.keySet().contains(hullType))
    //    {
    //        showError("No alternate sprites found for '" + hullType + "'!");
    //        return;
    //    }
       
        //get the supported hulls
    //    String hullStyle = spriteNames.toString();
    //    String styleDirs = getStyles.toString();
       
    //}
   
}
[close]

Any help would be appreciated.
Logged

Gotcha!

  • Admiral
  • *****
  • Posts: 1124
    • View Profile
    • Welcome to New Hiigara
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #882 on: September 25, 2013, 09:32:12 AM »

I am making a mission where the player needs to take out 3 specific ships, but I'm doing it wrong.

Taken from Dire Straits, I modified this line, just throwing extra ships in, but that doesn't work:

Code
api.defeatOnShipLoss("HSS Bullwark", "HSS Stainless", "HSS Deep Dive");

Does anyone know what I would need to do?

Edit: I did it like this, and it seems to work:
Code
api.defeatOnShipLoss("HSS Bullwark, HSS Stainless, HSS Deep Dive");
« Last Edit: September 25, 2013, 09:47:14 AM by Gotcha! »
Logged
  

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24118
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #883 on: September 25, 2013, 10:29:29 AM »

Gotta let us do that soon, Alex. ;D

Not entirely sure how well that'd work. Inter-system transitions could be very common; it might make sense to instead base music on larger regions.



Also: I put together a custom interaction dialog example; you can check it out here. It doesn't require using jar files.


@MShadowy: Hmm. I don't think that's going to work. Not sure what you mean by "always void" (perhaps "null"?), but you can only get a ShipAPI object when in battle. They don't, generally, exist in the campaign. The way you would want to go about what you're doing is by creating a separate .ship file for each paintjob, and then replace the player's ship with a custom variant when they choose what they want. Copying the variant over will be a bit of a pain, since the underlying .ship is different.
Logged

MShadowy

  • Admiral
  • *****
  • Posts: 911
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #884 on: September 25, 2013, 10:35:47 AM »

"void" is what netbeans keeps telling me: "expected boolean but found 'void'" which probably means a null error, as you pointed out.

Well, thanks for the advice; time to do mass copying of .ship files I guess.
Logged
Pages: 1 ... 57 58 [59] 60 61 ... 710