Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Pages: 1 ... 543 544 [545] 546 547 ... 710

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

Timid

  • Admiral
  • *****
  • Posts: 640
  • Personal Text
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8160 on: November 23, 2021, 09:00:10 PM »

Thank you both for your help. TBH I would never have considered FIGHTER to be a HullSize. If I were to add it to the hash map would it be: jydcom.put(HullSize.FIGHTER, 35f); then add FIGHTER to the index list for getDescriptionParam?
For getDescriptionParam? No, not necessary. Whenever something has a FIGHTER for some reason, I just put a 0f or a negating effect.

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24118
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8161 on: November 23, 2021, 09:08:03 PM »

Thank you both for your help. TBH I would never have considered FIGHTER to be a HullSize. If I were to add it to the hash map would it be: jydcom.put(HullSize.FIGHTER, 35f); then add FIGHTER to the index list for getDescriptionParam?
For getDescriptionParam? No, not necessary. Whenever something has a FIGHTER for some reason, I just put a 0f or a negating effect.

(Oh, you're right! getDescriptionParam() would only need to be updated if the description was changed to include its effect on fighters.)
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 #8162 on: November 24, 2021, 06:03:01 AM »

@esm8m

Hmm, I'm not sure then. I looked at the code you originally posted and nothing pops out as being explicitly wrong. I haven't ever needed to register a plugin like what you are attempting though so my experience is limited.

It is strange that it would somewhat work using Janino to compile your scripts and not work with the jar from an IDE. I suppose its possible that the jar wasn't complied correctly but I wouldn't know where to start as far as troubleshooting goes.

It might be worthwhile to post your updated code in case there is something there that has changed from your original script that would cause it to not run. The only other thing I can think of is that your overloaded methods in the base plugin class aren't being used in the specific instance you are testing.
Logged

Timid

  • Admiral
  • *****
  • Posts: 640
  • Personal Text
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8163 on: November 24, 2021, 07:22:17 AM »

Code
AddTextSmall "You received recommendation from $PersonRank $personLastName"
$player.hasHegemonyRecommendation = true
$player.HegemonyRecommendationRank = $PersonRank
$player.HegemonyRecommendationName = $personLastName
AddTextSmall "$player.HegemonyRecommendationRank $player.HegemonyRecommendationName"

So I wanted to make a promotion in the rule.csv... to my sudden surprise $PersonRank and $personLastName isn't defined when I suddenly use devmode to dump memory... but yet AddTextSmall was able to extract the $PersonRank and $personLastName.. seems... interesting but annoyed I had to use rulecmd to extract the person's last name since the $PersonRank can be found as $Rank.

.............


On a side note, is it possible to have a customized graphic for these four below.. asking for a friend who wants to make a foreign blueprint, but doesn't want to make every weapon bp for his new graphics.

Base Ship Blueprint (ship_bp)
Base Weapon Blueprint (weapon_bp)
Base Fighter Blueprint (fighter_bp)
Base Industry Blueprint (industry_bp)

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24118
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8164 on: November 24, 2021, 08:31:56 AM »

On a side note, is it possible to have a customized graphic for these four below.. asking for a friend who wants to make a foreign blueprint, but doesn't want to make every weapon bp for his new graphics.

Base Ship Blueprint (ship_bp)
Base Weapon Blueprint (weapon_bp)
Base Fighter Blueprint (fighter_bp)
Base Industry Blueprint (industry_bp)

Unless I'm misunderstanding the question, the graphic is defined special_items.csv. If you mean having a different base graphic for only some of the blueprints, that'd be a bit more involved - it'd basically be a new item that works the same way. Still seems doable, though if you also wanted it to drop, be a mission reward for existing missions, etc - the way normal blueprints can be - then that would be substantially more work.
Logged

Dazs

  • Admiral
  • *****
  • Posts: 1070
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8165 on: November 24, 2021, 09:47:01 AM »

Just a quick thank you to Alex and Timid, Dragar reports that the adjustment you recommended fixed his crashing issue. Hugs

SafariJohn

  • Admiral
  • *****
  • Posts: 3021
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8166 on: November 24, 2021, 05:18:47 PM »

Several mods do custom BP items. Roider Union has ship retrofit BPs which can drop as loot like normal BPs.
Logged

Timid

  • Admiral
  • *****
  • Posts: 640
  • Personal Text
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8167 on: November 25, 2021, 02:28:54 AM »

Several mods do custom BP items. Roider Union has ship retrofit BPs which can drop as loot like normal BPs.
Thanks!

....

Is there a way to force the CampaignFleetAPI spawnFleet to have a flagship of a smaller flagship?

Right now the certain industry is spawning legions in the fleet when the commander's mainship prefers to sit in an eagle. When I adjust the fleet points appropriately, the commander sits in an eagle but as the fleet point starts scaling upward, the eagle disappears and the commander is sit atop of a legion.

I think the workaround is to force-add the said eagle ship and force the commander on-top of it, but is there a more supported method?

Jaghaimo

  • Admiral
  • *****
  • Posts: 661
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8168 on: November 26, 2021, 05:42:02 AM »

I am implementing a Hyperspace Skype(tm). Via intel UI of course.

I would like to tap into rules.csv via `IntelUIAPI.shoDialog(token, ruleId)`. My first surprise was that it doesn't work with rule ids. It takes triggers instead.

Either way, got a bad version of it working (via `market.getPlanetEntity(), "OpenInteractionDialog"`) which does the job, but I want better. I want to OpenCDE (OpenCommLink?) with the person directly. Unfortunately, we don't have sources for that class and I don't know what memory keys are needed. So I seek guidance. Or is there a different way to open dialog with a specific person?

Edit: The reason I went through rules.csv route is that if I create my custom InteractionDialogPlugin and showCommsDirectory with desired people myself, they are no longer clickable / interactable.'

Edit 2: Did some variations of the following with no luck :(
Code
        SectorEntityToken token = market.getPlanetEntity();
        token.setActivePerson(person);
        ui.showDialog(token, "OpenCDE");

Edit 3: Hmm, been comparing memory dumps from when I access contact via CommDirectory and when I access it manually. I do seem to be missing `$entity` keys, and all local keys point to market (`fullName = Hegemony Jangala` instead of contact name). The hunt for right memory keys continues...

Edit 4: MemoryAPI key overwritting not possible (tried to replace $id that had market with personId, gets overwritten anyway, adding new one is fine), should I look into custom rulecmd (extend BaseCommandPlugin and set things up from there)?

Edit 5: I am slowly loosing hope. Might need a new API method: `ui.showDialog(PersonAPI person, String ruleCmd)` or so (since token in rules can either be Person or Market).

Edit 6: I am now suspecting a bug. When I set active person on the token that's passed to the dialog, I'd expect the memory map to reflect that. I see this used in `BeginConversation`. But in my own tiny code this does not seem to work.

Edit 7: A new hope. Found RuleBasedInteractionDialogPluginImpl. Extending that, and updating interaction target manually kinda works (why it didin't when I modified original token used in calling showDialog?). Hunt continues.

Edit 8: SUCCESS! Took only 5h.

Code
public class ContactDialog extends RuleBasedInteractionDialogPluginImpl {

    private final PersonAPI person;

    public ContactDialog(PersonAPI person) {
        super("OpenCDE");
        this.person = person;
    }

    @Override
    public void init(InteractionDialogAPI dialog) {
        dialog.getInteractionTarget().setActivePerson(person);
        super.init(dialog);
    }
}

Two problems:
1. As mentioned, the SectorEntityToken that I to set active person on (prior to calling showDialog) seems to be ignored. Had to set it manually in init again.
2. When cutting the comm link with the person, I am moved to market interaction (first time I am moved twice, to non-existent commdirectory, then to market; second and after straight to market). But I should have this covered - just higher priority rule, based on some extra key I will set, to avoid market interaction and just close the dialog.
« Last Edit: November 26, 2021, 10:39:05 AM by Jaghaimo »
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24118
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8169 on: November 26, 2021, 11:03:25 AM »

Oh, oops - let me change the name of the parameter from "ruleId" to "trigger". And, yeah, using RuleBasedInteractionDialogPluginImpl is the way to go - it handles all/most of the fiddly hooking up that's required to make it all work.

Re: setActivePerson(), it's meant to be used only within the context of an existing dialog and is reset when an interaction dialog is shown, hence what you're seeing. The init() method is called after the active person was reset.
Logged

BaBosa

  • Captain
  • ****
  • Posts: 445
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8170 on: November 26, 2021, 05:21:25 PM »

If I make a weapon with a long charge up time, very fast projectile speed and slow turn rate. Would enemy ships try to get out of the way during the charge time?
Also, if a ship system allowed two phase ships to hit each other. Would the AI work fine with that?
« Last Edit: November 26, 2021, 08:51:13 PM by BaBosa »
Logged

Jaghaimo

  • Admiral
  • *****
  • Posts: 661
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8171 on: November 27, 2021, 05:53:41 AM »

How could I get a list of all possible contact types in a current game? I found 5 vanilla types in Tags (although I haven't seen pather or science contact myself), and mods can add more, yet my quick search through API hasn't yielded any results. Seems like we are missing "SettingsAPI.getAllContactTags()" or similar.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24118
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8172 on: November 27, 2021, 11:12:27 AM »

It's a bit thornier than that, since contact tags defined in contact_tag_data.json are not guaranteed to actually be used anywhere. Your best bet is probably iterating through all the ContactIntel the player has and cross-checking it against what's in contact_tag_data - which you could get to by reading the (merged-with-mod-stuff) file in onApplicationLoad(), given the absence of an API method to get to it. And probably pre-seeding that list with trade/military/underworld in case you need it to be non-empty for whatever UI you've got in mind to "work"...

If I make a weapon with a long charge up time, very fast projectile speed and slow turn rate. Would enemy ships try to get out of the way during the charge time?
Also, if a ship system allowed two phase ships to hit each other. Would the AI work fine with that?

Definitely not, on both counts.

Well, for "getting out of the way", they'll generally speaking have some behaviors that make them harder to hit with a weapon like that - especially frigates - but it's not going to be particularly reliable or aware of this weapon's specifics. I'd suggest just trying it to see what happens; it'd be pretty trivial to tweak the stats on an existing weapon to what you've got in mind.
Logged

itBeABruhMoment

  • Commander
  • ***
  • Posts: 158
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8173 on: November 27, 2021, 12:09:15 PM »

I'm trying to make a ship with a maneuvering jets ship system. How would you implement the visual effect of side engines lighting up when the ability is active on ships such as the falcon?
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24118
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8174 on: November 27, 2021, 12:31:21 PM »

I'm trying to make a ship with a maneuvering jets ship system. How would you implement the visual effect of side engines lighting up when the ability is active on ships such as the falcon?

Set contrailSize for that engine to 128. It's... more than a bit of a hack; that field is not used for anything else so it sort of became a "use for some kind of flag" field instead.
Logged
Pages: 1 ... 543 544 [545] 546 547 ... 710