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 - Cabbs

Pages: [1] 2
1
That was probably ***...

int M_AMMO = wpn.getMaxAmmo();

Should be:

int M_AMMO = wpn.getSpec().getMaxAmmo();

And if we already get M_AMMO not from ship weapon, but from spec... we always can:

              float Time = ship.getFullTimeDeployed();

And change
             if wpn.getType() == MISSILE {
to:
             if (wpn.getType() == MISSILE)&(Time<=1) {

The only bad thing may happen here - missile ammo would replenish to modified maxammo indefinitely during first second it exist. Unlikely this can be abused in real battle.

We can use the 'applyEffectsAfterShipCreation' of the hullmod to set the wpn ammo immediately, but unfortunately thats about it - can't change the damage or fire-rate of a single installed weapon, which is what I was hoping for.  Maybe in a later version.

The Hullmod is intended to be free alternative to Expanded Missile Racks, so the way I see it:

A:  100% Ammo but with half fire rate. So basically free Expanded Missile Racks with large downside
B:  50-75% missile ammo with 25% rate of fire reduction, 1-shots do not get additional ammo.

Probably going with B - fits the description, goes well with launchers that carry odd numbers of missiles, dedicated missile ships will want Racks anyway.

2
Hey!

Can anyone briefly explain part of the WeaponAPI to me?

More specifically, I want a hullmod to modify the stats of individual weapons on a ship, like their (missile) damage or fire rate.  Messing with missile weapons for my mod, and will be messing with other things later.

- I assume this would need to happen in applyEffectsAfterShipCreation
- But it does not look like fire rate can be changed outside of MutableStats
- It looks like I can't clone a set of MutableStats to apply to each weapon?

Have searched high and low but looks like I'm missing something.

EDIT: alright, after due diligence I am giving up on this half-formed idea - can see why this isn't possible, at least for me.

I was attempting to create a hullmod that provides 50% missile ammo rather than 100%, and manage 1-shot missiles with additional downsides, as their ammo would need to round up to 2.

3
Spoiler
That is looks great!

However, even without playing this yet , could point some things. Some Shipyard Liason tweaks are good, and some I doubt ever would be used by anyone.

Attenuated drives downsides arguable worse than output. And it probably shouldn't be available if SO are installed.

Munitions lastage. It's fine, only wish to know how it work with single torpedo, as you can not have 1.5 reapers ammo. I believe it should be always rounded down at any case, not to abuse.

Shield scaling. Not sure if +40% upkeep is fair price for what it does. However it's a shield flickering booster and I am not a big fan of it, so could be wrong.

EDIT: What you doing is good. Wish you luck in expanding and polishing.
[close]

Thanks! Yeah, remaking the hullmods is the first thing in my queue.  A few oversights there for sure, but they're pretty innocuous so I'll leave the download up.

Starting to realise why I haven't seen any other hullmods that provide partial missile ammo bonuses - but i'll take that to the questions thread.

4


                                                       CBCC v0.1 (Download)
                                                                           Requires Lazylib and Magiclib.
                                          Can be added to an ongoing campaign, but not removed due to hullmods.

    Colony Based Campaign Content!

    Or "Cabbs' Colony Content", or "Campaign Content", or "Cabbs' Bad Ideas". Name to be finalised. 

    This mini-content mod currently includes two NPC contacts that provide simple services for the player. 

    I wanted to throw my hat in the ring of Vanilla-friendly content mods, expand the number of 'things' to do at your own colony, and let you 'customise' ships some more. So, after starting from scratch and spending an awful lot of time achieving simple stuff, I've decided to get what is functional so far in front of you fine folks, before it's all made irrelevant by updates, or inadvertently duplicates the features of another mod.

    These work via rules and commands, so should be compatible with nearly everything.

    Shipyard Liason
    Spoiler

    If your colony contains Heavy Industry or Orbital Works industries, a Shipyard Liason will appear in the Comms Directory.

    He or She can manage 'Combat Tweak' perma-mods for your fleets ships, one per ship, at a credit cost, with removal being free.  Some of these are locked behind Orbital works.

    These 'Tweak' hullmods provide small adjustments to your ships, with zero Ordnance point cost and a suitable downside.

    All available Tweaks:

    Spoiler

    [close]


    [close]

    Recruitment Liason

    Spoiler

    If your colony has a Military Base, a High Command or the Academy from SirHartley's Industrial.Evolution mod, a Recruitment Liason will appear in Comms Directory.

    He or She can start a 'Recruitment Program' to attract an Officer with specific skills and Personality to your colony; You specify Personality and skillset, with a level of funding depending on how fast you want this to occur.  Only one program can be active per colony.  If you have a High Command on the colony, the resulting Officer will be a higher level, and start with more skills from the skillset pool you wanted.

    If industrial.Evolution is active :
    - Base costs are about 40% less, with an Academy reducing it further.[/li][/list]
    - The personality is selected from a range, one either side of what you choose, so only a 1-in-3 to get what you want (or 1-in-2 for Reckless or Timid). 
    - Intention is that you use SirHartleys Academy to fix this if you need to.



    [close]

    Not much right now, kinda proof of concept. With that in mind:

    - Combat tweaks are intended to be felt and I didn't want anything that said 'just don't get hit' like adjustments to damage dealt or taken.  As a result I probably made them kinda boring.
    - Attempted to balance Recruitment time and cost sensibly, mostly based off of the 60-day time required for SirHartleys academy to change an officers personality by 1, which made sense to me. Does this take a hammer to officer balance?
    - I swear, I have tested these things.  They are self-contained and there isn't much to go wrong...
    - hosted above files on my google drive.  Bad idea? I'm too tired to work this out right now.
    - I want feedback! You don't even need to have played it.  Any ideas on how to make these feature more balanced/relevant/interesting would also be appreciated.

    Future plans may include:  repeatable quests from these NPCS, faction-specific bar missions, swap out some Tweaks for something more bespoke, a low quality ship or two to fill out Vanilla trash fleets with more than just Ventures, maybe a short break from staring at NetBeans.

    I do not know which new things I will get around to due to time, but would love to develop whats here a bit further beyond just refactoring it.

    Many thanks to:
    Spoiler
    Alex for this game, answering my questions and the AsteroidInteraction example.
    SirHartley for his help and permission to use his event finding code and implementation of OfficerManager.
    [close]

    5
    Hmm - the second image link seems broken.

    formattera.format("%, d", (int)daysleft);

    This seems like the issue has to do with how you're using the formatter. I'm not familiar with how the format string for it works, but provided you're getting the same output as the "manual" entered strings, the result would have to be the same. So if it's not, then the output isn't either... what you were saying about an extra space showing up seems to confirm that, too.

    Right on the money! cheers

    It looks like the space I left in the Format string ("%, d") was the problem.  It caused the space to appear on the first highlight, and also stopped the second highlight entirely because reasons (???????)

    Simply removing that space solved the issue:
    formattera.format("%,d", (int)daysleft);

    with that sorted, working code now shortened:
    Spoiler
                                float daysleft = thismarket.getMemoryWithoutUpdate().getExpire("$recruit_prog");
                                float credsleft = data.credits*(daysleft/data.days);

                                String fmt_days = String.format("%,d", (int)daysleft);
                                String fmt_creds = String.format("%,d", (int)credsleft);
                               
                                textPanel.addPara("There are %s Credits remaining, and this will take %s days to complete.", HIGHLIGHT_COLOR, fmt_creds, fmt_days);
                               
    [close]


    6
    Hmm - it would help to see what you're doing in the case that doesn't work.

    (In case it's relevant: highlights require whitespace or punctuation around them, so e.g. you couldn't highlight half of a word, or some such.)

    Alrighty then, here we go.  I'm pulling some data to calculate time and credits remaining, then displaying it to the user. The issue is the same when I access it later and the numbers change.

    In this example I have manually set the strings at the end, so this displays how I want:

    Spoiler

    Code
                                float daysleft = thismarket.getMemoryWithoutUpdate().getExpire("$recruit_prog");
                                float credsleft = data.credits*(daysleft/data.days);
                               
                                Formatter formattera = new Formatter();
                                formattera.format("%, d", (int)daysleft);
                                String fmt_days = formattera.toString();
                               
                                Formatter formatterb = new Formatter();
                                formatterb.format("%, d", (int)credsleft);
                                String fmt_creds = formatterb.toString();

                                textPanel.addPara("Float Daysleft: "+daysleft);
                                textPanel.addPara("Float Credsleft: "+credsleft);
                               
                                textPanel.addPara("String nowdays: "+fmt_days);
                                textPanel.addPara("String nowcreds: "+fmt_creds);
                               
                                // SET MANUALLY
                                fmt_days = "120";
                                fmt_creds = "50,000";

                                textPanel.addPara("There are "+fmt_creds+" Credits remaining, and this will take "+fmt_days+" days to complete.");
                                textPanel.highlightInLastPara(HIGHLIGHT_COLOR, fmt_creds, fmt_days);
                               
                                textPanel.addPara("There are %s Credits remaining, and this will take %s days to complete.", HIGHLIGHT_COLOR, fmt_creds, fmt_days);
                                float daysleft = thismarket.getMemoryWithoutUpdate().getExpire("$recruit_prog");
                                float credsleft = data.credits*(daysleft/data.days);
                               
                                Formatter formattera = new Formatter();
                                formattera.format("%, d", (int)daysleft);
                                String fmt_days = formattera.toString();
                               
                                Formatter formatterb = new Formatter();
                                formatterb.format("%, d", (int)credsleft);
                                String fmt_creds = formatterb.toString();

                                textPanel.addPara("Float Daysleft: "+daysleft);
                                textPanel.addPara("Float Credsleft: "+credsleft);
                               
                                textPanel.addPara("String nowdays: "+fmt_days);
                                textPanel.addPara("String nowcreds: "+fmt_creds);
                               
                                // SET MANUALLY
                                fmt_days = "120";
                                fmt_creds = "50,000";

                                textPanel.addPara("There are "+fmt_creds+" Credits remaining, and this will take "+fmt_days+" days to complete.");
                                textPanel.highlightInLastPara(HIGHLIGHT_COLOR, fmt_creds, fmt_days);
                               
                                textPanel.addPara("There are %s Credits remaining, and this will take %s days to complete.", HIGHLIGHT_COLOR, fmt_creds, fmt_days);



    [close]

    Aaaand here is it not working:

    Spoiler

    Code
                                float daysleft = thismarket.getMemoryWithoutUpdate().getExpire("$recruit_prog");
                                float credsleft = data.credits*(daysleft/data.days);
                               
                                Formatter formattera = new Formatter();
                                formattera.format("%, d", (int)daysleft);
                                String fmt_days = formattera.toString();
                               
                                Formatter formatterb = new Formatter();
                                formatterb.format("%, d", (int)credsleft);
                                String fmt_creds = formatterb.toString();

                                textPanel.addPara("Float Daysleft: "+daysleft);
                                textPanel.addPara("Float Credsleft: "+credsleft);
                               
                                textPanel.addPara("String nowdays: "+fmt_days);
                                textPanel.addPara("String nowcreds: "+fmt_creds);

                                textPanel.addPara("There are "+fmt_creds+" Credits remaining, and this will take "+fmt_days+" days to complete.");
                                textPanel.highlightInLastPara(HIGHLIGHT_COLOR, fmt_creds, fmt_days);
                               
                                textPanel.addPara("There are %s Credits remaining, and this will take %s days to complete.", HIGHLIGHT_COLOR, fmt_creds, fmt_days);

                                float daysleft = thismarket.getMemoryWithoutUpdate().getExpire("$recruit_prog");
                                float credsleft = data.credits*(daysleft/data.days);
                               
                                Formatter formattera = new Formatter();
                                formattera.format("%, d", (int)daysleft);
                                String fmt_days = formattera.toString();
                               
                                Formatter formatterb = new Formatter();
                                formatterb.format("%, d", (int)credsleft);
                                String fmt_creds = formatterb.toString();

                                textPanel.addPara("Float Daysleft: "+daysleft);
                                textPanel.addPara("Float Credsleft: "+credsleft);
                               
                                textPanel.addPara("String nowdays: "+fmt_days);
                                textPanel.addPara("String nowcreds: "+fmt_creds);

                                textPanel.addPara("There are "+fmt_creds+" Credits remaining, and this will take "+fmt_days+" days to complete.");
                                textPanel.highlightInLastPara(HIGHLIGHT_COLOR, fmt_creds, fmt_days);
                               
                                textPanel.addPara("There are %s Credits remaining, and this will take %s days to complete.", HIGHLIGHT_COLOR, fmt_creds, fmt_days);



    [close]

    Extra space on the left of the first highlight, and no second highlight.

    EDIT: whoops had the second image as private. fixed now

    7
    I know there was a lot of discussion about convo highlights in this thread previously, but I can't find the answer I need.

    Currently putting two strings into an addPara line then highlighting them:

    textPanel.addPara("There are "+nowcreds+" Credits remaining, and this will take "+nowdays+" days to complete.");
    textPanel.highlightInLastPara(HIGHLIGHT_COLOR, nowcreds, nowdays);

    And this of course works fine with hard-coded strings I type. 

    But when I use a formatter to make the strings from a float, this fails: the first string is highlighted but has extra whitespace in front, while the second string never highlights.  I have tried using a different formatter for each string etc, the other addPara highlight methods, and LabelAPI.setHighlight too.

    How is the hardcode string different from the string made by the formatter? I thought they would be identical at the end.

    8
    Is it possible to get a hullmod to remove/unequip specific fighter wings on the refit screen when certain conditions are met? I am able to remove fighter bays, but the fighters stay equipped and hidden, taking up OP.

    stats.getVariant().clear();

    Spoiler
    Joke
    [close]

    Aye try that lol

    Or rather, stats.getVariant() has various 'getWing' and 'setWing' functions, and can return what I assume is an indexed list of wings, or set a specific index.   

    I haven't tried it myself but that looks like what you need?


    9
    Modding Resources / Re: [0.9.1] MagicLib v0.29 (2020/04/26)
    « on: July 05, 2020, 01:45:34 PM »
    Can anyone tell me any mod using MagicIncompatibleHullmod?

    I want to see how it should work.

    Don't have a clean example to refer you too, but its super-easy to implement. 

    You add code to your applyEffectsBeforeShipCreation like this:

    Quote
    if(stats.getVariant().getHullMods().contains("swp_shieldbypass")){

     MagicIncompatibleHullmods.removeHullmodWithWarning(stats.getVariant(), "swp_shieldbypass", "CBCC_shieldscaling");

     }

    In my example:

    1.  applyEffectsBeforeShipCreation runs every time you add a hullmod to a ship, so this check occurs whenever you change something
    2.  If the mod with ID "swp_shieldbypass" is present, the IF triggers
    3.  'MagicIncompatibleHullmods.removeHullmodWithWarning' removes "swp_shieldbypass" and replaces it with a dummy warning mod that specifies "CBCC_shieldscaling" as the reason, so these two mods can never be present together.


    This is how it works as far as I know.

    10
    Follow-up question!

    If I set an officers skills to zero, is that the same as him/her not having those skills?

    this code:   person.getStats().getSkillsCopy();

    returns a 'List<SkillLevelAPI>' , including skills that I reduced to zero and the aptitudes.  Is this an artifact of how they're adapted from the player skills?

    11
    You should be able to create your own OfficerManagerEvent object to use without side effects. Just make sure you init() it.
    Industrial.Evolution Academy does exactly that, feel free to take a look at the code.

    Thanks for this! its exactly what I needed.

    12
    I've been staring at this too long and am losing my mind over what is, presumably, simple.

    Currently re-creating the steps to make Officers and add them to comms for the player to hire, but am falling down at this line of code originally from the OfficerManagerEvent:

         officer.person.getMemoryWithoutUpdate().set("$ome_eventRef", this);

    So 'this' needs to be the reference to the callable event, but I cannot work out how to pass a callable event reference here.  So, any officers I make cannot trigger it, and cannot be hired or display their attributes.

    Am I making sense, or is there a way to use OfficerManagerEvent I should know about?


    13
    General Discussion / Re: How to edit save file to add more credits ?
    « on: June 23, 2020, 02:13:57 PM »
    Cheat engine is also a way to get money without installing mods. Also, the Spiffing Brit showcased a "glitch" that allows for unlimited money. (search it on youtube)

    Unfortunately that exploit can make your save useless if you use it too long - it breaks the tutorial. You're better off just cheating money in, save yourself the time.

    14
    Hullmod query - I am making a missile ammo hullmod that I want to be incompatible with Expanded Missile Racks

    I can of course prevent the player from adding it if Expanded Missile Racks is present using Public Boolean isApplicableToShip, but I'm unsure how to achieve the opposite without replacing the vanilla 'missleracks' java class, which does not have any incompatibilities.

    Is there something I can do in applyEffectsBeforeShipCreation of my new hullmod that might prevent EMR being selectable? or some other solution?

    15
    I'm creating a proof-of-concept campaign feature where two temporary, random fleets are generated and the player uses one of them to fight the other. The player does not use their own ships or officers acquired in campaign.

    Right now, I can display the fleets and launch a battle from a rules-based interaction dialog. But there are two problems:
    - The player's campaign fleet is added to the temporary player fleet and available for deployment in-battle, even though the campaign fleet isn't added to the BattleAPI
    - I don't know how to detect battle completion and display its outcome

    So, my question is: Is it feasible to do this sort of thing purely within the rules-based dialog, and if so, how do I fix the above issues?
    (I would prefer not to deal with the complexity of the regular fleet interaction dialog if I don't have to)

    No-one else replied, and my knowledge is limited, but from what I can see the Battle API receives a fleet from the FleetInteractionDialog, which also has code that handles the aftermath of the battle right up till the dialog box is closed.  My brain says you're stuck making your own interaction to do this - at least I would assume doing this without an interaction would be even more complicated somehow.

    If there is a way to do this in rules without your own custom interaction/fleet dialog then I would also like to know! Working on my own dialogues for other stuff.


    Pages: [1] 2