Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Starsector 0.97a is out! (02/02/24); New blog post: Simulator Enhancements (03/13/24)

Pages: 1 ... 12 13 [14] 15 16 ... 706

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

Machine

  • Commander
  • ***
  • Posts: 114
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #195 on: January 27, 2013, 10:49:08 AM »

Is it possible to make a weapon with a "UNIVERSAL" type?, I don't mean universal hardpoints or turrets inside a ship file, but instead on the weapon itself, so it can be used in MISSILE, ENERGY, BALLISTIC and UNIVERSAL slots.

I'm kinda trying to make a hardpoint/turret cover "weapon", as sometimes ships benefit of not having all their slot filled, but I think open slots don't look very good.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23987
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #196 on: January 27, 2013, 10:55:59 AM »

Is it possible to make a weapon with a "UNIVERSAL" type?, I don't mean universal hardpoints or turrets inside a ship file, but instead on the weapon itself, so it can be used in MISSILE, ENERGY, BALLISTIC and UNIVERSAL slots.

It's not. I guess you could make covers of every type and size :) (Fun!)

I'm kinda trying to make a hardpoint/turret cover "weapon", as sometimes ships benefit of not having all their slot filled, but I think open slots don't look very good.

There's a decent chance this may end up in the game at some point. We've talked about it internally - I think the idea is good, but it's just such a low priority right now.
Logged

Thule

  • Admiral
  • *****
  • Posts: 580
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #197 on: January 28, 2013, 11:02:54 AM »

I am trying to give the typing sound an 80's analog computer feeling and already have a sound ready.
The problem is there is still this little beep from the old typing sound, and i cant find it ;)

I tried the replace argument in the mod_info.json, failed for me, sound still there.

This is what i have at the moment:
sounds.json
Code
	"ui_typer_type":{ # played when text is gradually "typed out" on screen, like in the mission descriptions
"sounds":[
{"file":"sounds/TL/fx/ui/thule_ui_type01.ogg","pitch":1.0,"volume":0.3},
        ],
},
"ui_typer_buzz":{
"sounds":[
{"file":"sounds/TL/fx/ui/thule_ui_type01.ogg","pitch":0.5,"volume":0.3},
],
},

I am sure i overlook something, can somebody please tell?
Logged

Thule

  • Admiral
  • *****
  • Posts: 580
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #198 on: January 29, 2013, 03:39:50 AM »

Another problem i ran into is the following.

I defined a special backgroundpicture for a single mission and it's not showing up.
I tried defining it as "background6" in the settings.json and id didnt work.

the format is .jpg, the path is correct. What could be the problem?

Code
{
"title":"Test Mission Punk Junker",
"difficulty":"HARD",
"icon":"icon.jpg",
"background":"graphics/backgrounds/background_punk.jpg"
}

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 #199 on: January 29, 2013, 03:46:16 AM »

@Thule

Is it the right size? Default Starsector backgrounds are 2048 x 2048. Not sure if that will matter though.

Is the filename all lower case, just like in the path "graphics/backgrounds/background_punk.jpg"?
Logged

Romeo_One

  • Captain
  • ****
  • Posts: 393
  • "Let me do the german dance for you..."
    • View Profile
    • Rejection - The Fight for Unity
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #200 on: January 29, 2013, 03:48:12 AM »

Are you in dev mode? Because other backgrounds(except the default one) will not render when in that mode.
Logged

Thule

  • Admiral
  • *****
  • Posts: 580
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #201 on: January 29, 2013, 04:14:30 AM »

right size (2048x2048) - check
lower case - check
dev mode disabled - there it is.

wow, didnt know that. Gets you thinking...


Thank you guys.
Logged

Romeo_One

  • Captain
  • ****
  • Posts: 393
  • "Let me do the german dance for you..."
    • View Profile
    • Rejection - The Fight for Unity
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #202 on: January 29, 2013, 04:18:22 AM »

NP, I did run into that same problem a few days ago ^^
Logged

gruntmaster1

  • Ensign
  • *
  • Posts: 31
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #203 on: January 29, 2013, 03:13:06 PM »

So, having worked through the plugin, I am going to re-ask the question about how to add a starting ship in a more concrete way, here is my current code, and it doesn't seem to work:
Code
package data.scripts.world;

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.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("Option 1");
    private ResponseImpl OPTION2 = new ResponseImpl("Option 2");
    private int stage = 0;
    private boolean isEntr = false;

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

        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) {
        super.startingShipPicked(variantId, 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);
        }
    }
}

Edit: Well, this is "funny". After a small light bulb lit, I tried to move the file to plugins folder instead of world, and it is now working correctly >_<. Also had to change startignShipPicked as the super class was adding unnecesarry crew and resources due to no matching ship in it.
edited code:
Code
package data.scripts.plugins;

...

    @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);
    }
I'll leave the question here as there doesn't seem to be an explanation for this elsewhere.
« Last Edit: January 29, 2013, 03:24:52 PM by gruntmaster1 »
Logged

Romeo_One

  • Captain
  • ****
  • Posts: 393
  • "Let me do the german dance for you..."
    • View Profile
    • Rejection - The Fight for Unity
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #204 on: January 29, 2013, 09:29:55 PM »

Well the reason your script works now is because the package points to the world folder, not the script folder, if you wanted that to be different, just change the package.

As for your question; I think the campaign holds the functions you are looking for, if I remember correctly though its pretty much the same thing as your script.
Logged

gruntmaster1

  • Ensign
  • *
  • Posts: 31
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #205 on: January 30, 2013, 04:36:52 AM »

Well the reason your script works now is because the package points to the world folder, not the script folder, if you wanted that to be different, just change the package.

As for your question; I think the campaign holds the functions you are looking for, if I remember correctly though its pretty much the same thing as your script.
With world, are you talking about data\scripts\world (which it was pointing to) or data\world? For your answer, I was asking about adding or replacing the ship you start with, not place it in your starting fleet (if that was how you understood it, the asnwer was rather vague).
Logged

Romeo_One

  • Captain
  • ****
  • Posts: 393
  • "Let me do the german dance for you..."
    • View Profile
    • Rejection - The Fight for Unity
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #206 on: January 30, 2013, 04:54:04 AM »

"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?
« Last Edit: January 30, 2013, 05:07:23 AM by Romeo_One »
Logged

gruntmaster1

  • Ensign
  • *
  • Posts: 31
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #207 on: January 30, 2013, 05:28:20 AM »

"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.
Logged

Romeo_One

  • Captain
  • ****
  • Posts: 393
  • "Let me do the german dance for you..."
    • View Profile
    • Rejection - The Fight for Unity
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #208 on: January 30, 2013, 05:39:01 AM »

Since this is the offical way of creating the starting ships, I don't think there are more direct ways, was what I was trying to say ;)
Logged

LazyWizard

  • Global Moderator
  • Admiral
  • *****
  • Posts: 1363
    • View Profile
    • GitHub Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #209 on: January 30, 2013, 06:55:04 AM »

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.
Logged
Pages: 1 ... 12 13 [14] 15 16 ... 706