Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Pages: 1 ... 429 430 [431] 432 433 ... 710

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

ctuncks

  • Commander
  • ***
  • Posts: 127
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6450 on: May 26, 2020, 12:18:31 PM »

Sorry for the delay - it should make it more common in drops, but rarity only affects drops from salvage etc, not how often it's used by ships.

Does that mean that rarity doesn't have an affect on it's chance to show up in an appropriate market then?
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24114
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6451 on: May 26, 2020, 12:20:08 PM »

It... maybe should. But, right, it doesn't!
Logged

Morrokain

  • Admiral
  • *****
  • Posts: 2143
  • Megalith Dreadnought - Archean Order
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6452 on: May 26, 2020, 03:13:51 PM »

When adding a paragraph using the TextPanelAPI, what is format for adding text highlights? What is the best method implementation to use for that?
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24114
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6453 on: May 26, 2020, 04:33:35 PM »

I'd say just search the TextPanelAPI interface for "highlight" and use the methods there :) Nothing in there is deprecated or inadvisable, just depends on whatever is most convenient in your case. The addPara() methods match how TooltipMakerAPI works and are a later addition.
Logged

Morrokain

  • Admiral
  • *****
  • Posts: 2143
  • Megalith Dreadnought - Archean Order
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6454 on: May 26, 2020, 05:50:06 PM »

I'd say just search the TextPanelAPI interface for "highlight" and use the methods there :) Nothing in there is deprecated or inadvisable, just depends on whatever is most convenient in your case. The addPara() methods match how TooltipMakerAPI works and are a later addition.

Ah ok gotcha. So, based upon the syntax connotations, those methods add the highlights to previously existing paragraphs?

Let's say I successfully parse A from a full string or substring. (Note: The parent string has already been added to the LabelAPI using the addParagraph() method and had its variables replaced - so this parsed string could potentially be a former replacement token that has been converted into it's replacement).

If so, I just pass A (should be a string) into:
Code
 
dialog.getTextPanel().highlightInLastPara(Misc.getHighlightColor(), A);
- ?

Parsing code if needed:
Spoiler
Code
    public static void parseDialogueHighlights(String responseDialogue, InteractionDialogAPI dialog) {
        if (responseDialogue.contains("$" + START_TEXT_HIGHLIGHT)) {
            List<String> remainingElements = Arrays.asList(responseDialogue.split(START_TEXT_HIGHLIGHT_REGEX));
            for (int i = 0; i < remainingElements.size(); i++) {
                String element = remainingElements.get(i);
                if (element.contains("$" + END_TEXT_HIGHLIGHT)) {
                    List<String> highLightComponents = Arrays.asList(element.split(END_TEXT_HIGHLIGHT_REGEX, 1));
                    String highlight = highLightComponents.get(0);
                    dialog.getTextPanel().highlightInLastPara(Misc.getHighlightColor(), highlight);
                }
            }
        }
    }
[close]
Logged

ctuncks

  • Commander
  • ***
  • Posts: 127
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6455 on: May 26, 2020, 07:37:09 PM »

It... maybe should. But, right, it doesn't!

Does that mean that only Tier determines the chance for a buy-able weapon to spawn in a market, or are there other factors that could be modified to alter the chance?
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24114
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6456 on: May 26, 2020, 08:18:49 PM »

Ah ok gotcha. So, based upon the syntax connotations, those methods add the highlights to previously existing paragraphs?

Let's say I successfully parse A from a full string or substring. (Note: The parent string has already been added to the LabelAPI using the addParagraph() method and had its variables replaced - so this parsed string could potentially be a former replacement token that has been converted into it's replacement).

That seems reasonable. I mean, you could give it a try and see if it works :) But on a cursory reading, nothing jumps out as being wrong.

Does that mean that only Tier determines the chance for a buy-able weapon to spawn in a market, or are there other factors that could be modified to alter the chance?

You can take a look at BaseSubmarketPlugin's addWeapons method, and place that this method (and similar) are called from. In brief, it's not just that; there's some logic for having a range of different weapon roles available etc.
Logged

Timid

  • Admiral
  • *****
  • Posts: 640
  • Personal Text
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6457 on: May 26, 2020, 08:24:33 PM »

Will the game ever support a possible "dummy skill" implementation where skill can be made from a mod but hidden from the skill overview.

Morrokain

  • Admiral
  • *****
  • Posts: 2143
  • Megalith Dreadnought - Archean Order
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6458 on: May 26, 2020, 08:55:02 PM »

That seems reasonable. I mean, you could give it a try and see if it works :) But on a cursory reading, nothing jumps out as being wrong.

I tried it and nothing seems to be highlighted. I wasn't expecting the parsed separators to be removed from the parent string since I haven't coded that logic yet, but the string sent into the highlight method should at least be highlighted in one instance, right? - though probably not multiple duplicates yet. That doesn't seem to be happening.

I'll keep testing and give more info when I can. I'll also set up some logging to make sure I'm getting the correct substrings I'm intending to. That should help as well in debugging this. Lots of things could potentially be going wrong so I'll try and narrow it down further.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24114
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6459 on: May 26, 2020, 09:06:52 PM »

Will the game ever support a possible "dummy skill" implementation where skill can be made from a mod but hidden from the skill overview.

There's an "npc_only" tag (I don't think it's in now, in-dev only) that basically makes the skill not get used anywhere or show up. I.E. AI officers won't get it either and it needs to be explicitly added to a person.

I tried it and nothing seems to be highlighted. I wasn't expecting the parsed separators to be removed from the parent string since I haven't coded that logic yet, but the string sent into the highlight method should at least be highlighted in one instance, right? - though probably not multiple duplicates yet. That doesn't seem to be happening.

I'll keep testing and give more info when I can. I'll also set up some logging to make sure I'm getting the correct substrings I'm intending to. That should help as well in debugging this. Lots of things could potentially be going wrong so I'll try and narrow it down further.

Ah - I'd suggest trying hardcoded highlights to try to narrow down the issue. Also, you may need to set a highlight color, and it may be sensitive to the order (i.e. you might have to do set color, then highlight, or vice versa), but I don't 100% remember off the top of my head. Basically what I'm suggesting is get *any* highlight working and then go from there to try to identify what's making your case not work.
Logged

ctuncks

  • Commander
  • ***
  • Posts: 127
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6460 on: May 26, 2020, 09:44:29 PM »

You can take a look at BaseSubmarketPlugin's addWeapons method, and place that this method (and similar) are called from. In brief, it's not just that; there's some logic for having a range of different weapon roles available etc.

The weapon roles would be determined by the tags correct?
Higher pd is weighted if the market needs Point Defense Weapons for example?

If this is true is there a list of what tags do? A lot are self evident like Kinetic, HE and Energy, but what's the difference between a rocket and a missile? What does the AI use the Utility tag for?


Logged

Morrokain

  • Admiral
  • *****
  • Posts: 2143
  • Megalith Dreadnought - Archean Order
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6461 on: May 26, 2020, 09:50:37 PM »

Ah - I'd suggest trying hardcoded highlights to try to narrow down the issue. Also, you may need to set a highlight color, and it may be sensitive to the order (i.e. you might have to do set color, then highlight, or vice versa), but I don't 100% remember off the top of my head. Basically what I'm suggesting is get *any* highlight working and then go from there to try to identify what's making your case not work.

Thanks! :) I'll narrow it down- hopefully tomorrow at some point.
Logged

Üstad

  • Commander
  • ***
  • Posts: 131
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6462 on: May 27, 2020, 05:15:32 AM »

Looks like that mod also provides the source for reference. But when the game runs, it's using the compiled code from the jar. In that case, changing that code wouldn't do anything, you'd need to recompile it and replace the jar.
I don't want to derail the thread but how to do what you're saying in this post? I really don't know where to look, any help would be appreciated. Thanks for help  :)
Logged

SirHartley

  • Global Moderator
  • Admiral
  • *****
  • Posts: 840
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6463 on: May 27, 2020, 05:58:28 AM »

Looks like that mod also provides the source for reference. But when the game runs, it's using the compiled code from the jar. In that case, changing that code wouldn't do anything, you'd need to recompile it and replace the jar.
I don't want to derail the thread but how to do what you're saying in this post? I really don't know where to look, any help would be appreciated. Thanks for help  :)

You are editing a part of the provided source code that is not actually loaded. Starsector loads the contents of the provided .jar file, which is the compiled version of what you are playing around with.
To compile code, you need an IDE, usually IntelliJ or Netbeans are suggested.

If you have no idea what you are doing, consider following a part of the tutorial that requires code compilation from here:
https://starsector.fandom.com/wiki/Intro_to_Modding

which will give you a better overview of how making a Starsector mod works.
You could also come join the Discord, where a lot of very helpful people can answer your questions quicker than they will be answered here.
« Last Edit: May 27, 2020, 06:04:12 AM by SirHartley »
Logged

Timid

  • Admiral
  • *****
  • Posts: 640
  • Personal Text
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6464 on: May 27, 2020, 08:07:04 PM »

Will the game ever support a possible "dummy skill" implementation where skill can be made from a mod but hidden from the skill overview.

There's an "npc_only" tag (I don't think it's in now, in-dev only) that basically makes the skill not get used anywhere or show up. I.E. AI officers won't get it either and it needs to be explicitly added to a person.
im so interested in this feature now...  ::)
Pages: 1 ... 429 430 [431] 432 433 ... 710