Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Pages: 1 ... 443 444 [445] 446 447 ... 710

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

Cabbs

  • Ensign
  • *
  • Posts: 24
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6660 on: July 17, 2020, 10:53:58 AM »

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?

Logged

Sinosauropteryx

  • Captain
  • ****
  • Posts: 262
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6661 on: July 17, 2020, 11:08:01 AM »


stats.getVariant().clear();

Spoiler
Joke
[close]
I'm this close to doing that lol. Map out the whole ship, clear the variant, and rebuild it again minus one wing...there's got to be a better way.

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?


Having sifted through there, I could only find ways to remove hullmods and clear weapon slots.
Edit: Let me see, I'll try setting wing ID to an empty string.
Edit2: You're right, this is just what I needed, it's working. Thanks!
Edit3: Scratch that. It's removing the wings from the game entirely, not unequipping them.
Edit4: Heck it, I can add the LPC back into the player's inventory manually. Yeah, that'll work.
« Last Edit: July 17, 2020, 11:55:33 AM by Sinosauropteryx »
Logged

Mondaymonkey

  • Admiral
  • *****
  • Posts: 777
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6662 on: July 17, 2020, 11:18:36 AM »

I could only find ways to remove hullmods and clear weapon slots.

maybe setWingId(int index, String wingId);?

What will happen if id set to null? (or which is default "empty" value?)

EDIT: I am late...
Logged
I dislike human beings... or I just do not know how to cook them well.

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24111
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6663 on: July 17, 2020, 12:29:20 PM »

Edit4: Heck it, I can add the LPC back into the player's inventory manually. Yeah, that'll work.

(Yeah, you'd need to do that. Variants are not directly tied to the player inventory.)
Logged

Mondaymonkey

  • Admiral
  • *****
  • Posts: 777
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6664 on: July 17, 2020, 12:38:01 PM »

Quote
Reply #6666

That is a sign! I just have to ask it right now.

Projectile files can have engine slots. Can they have weapon slots/fighter bays?

P.S. Ya! The BFG10K!
Logged
I dislike human beings... or I just do not know how to cook them well.

Sinosauropteryx

  • Captain
  • ****
  • Posts: 262
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6665 on: July 17, 2020, 12:44:04 PM »

Well, it's not going to work after all. Can't really mess with majicking LPCs up when they might be getting bought from a market and refunded. I'm going to try getVariant().clear() for reals.

Edit: Doesn't look like that will work either. I can't find a way to equip wings from getVariant(). Best I can do is remove all wings and reset everything else...I can settle for that.
Edit2: No, that won't work either. Seems clear() also deletes stuff outright instead of unequipping them.
« Last Edit: July 17, 2020, 01:08:06 PM by Sinosauropteryx »
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 #6666 on: July 17, 2020, 07:42:28 PM »

Well, it's not going to work after all. Can't really mess with majicking LPCs up when they might be getting bought from a market and refunded. I'm going to try getVariant().clear() for reals.

Edit: Doesn't look like that will work either. I can't find a way to equip wings from getVariant(). Best I can do is remove all wings and reset everything else...I can settle for that.
Edit2: No, that won't work either. Seems clear() also deletes stuff outright instead of unequipping them.

Well, assuming you can get all the available ids from the variant, you could put them in a map and then manually add them to the player's inventory by getting the item by id. And then clear the variant. Or did you already try this?

See:

Code
            Global.getSector().getPlayerFleet().getCargo().addFighters(id, count);

For count, you could iterate through the variant and count the instances that the weapon/fighter appears.

Then, if you were wanting to put the weapons back on the variants in their correct slots, you could map the weapon ids to slot ids through:
Code
Iterator<String> slotIds = ShipVariantAPI.getNonBuiltInWeaponSlots().iterator();
Map<String, String> weaponMap = new HashMap();
String id;
while (slotIds.hasNext()) {
    id = slotIds.next();
    weaponMap.put(id, ShipVariantAPI.getWeaponId(id));
}
**Add Fighter Wings to Cargo Here!**
ShipVariantAPI.clear();
Iterator<String> weaponIterator = weaponMap.keySet().iterator();
while (weaponIterator.hasNext()) {
    id = weaponIterator.next();
    ShipVariantAPI.addWeapon(id, weaponMap.get(id));
}
   
- Similar things can be done with hullmods, vents/caps, ensuring properly set weapon groups, etc.
 - That's an example, but what you are attempting should be possible with the exception of adding the fighters back on. That's assuming setWingId() can't be used to add fighters rather than remove them.

If you need more examples, I can try and help further.

*Edit* Edited code for more clarity in terms of the original request and corrected a code typo. (getVariant() returns the ShipVariantAPI of the ship in question)
« Last Edit: July 17, 2020, 09:00:40 PM by Morrokain »
Logged

Sinosauropteryx

  • Captain
  • ****
  • Posts: 262
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6667 on: July 18, 2020, 02:00:41 AM »

Thanks Morrokain, I had tried a structure very similar to that. The problem came when attempting to do any refit with a market involved. With the wings being bought from the market, a player could trigger the refit (+1 LPC in inventory) and then click Undo and get a full refund for the LPC, while keeping it. Sell it back - free money exploit.

I did find a solution, which was to remove all bays entirely, then add them back. I noticed fighters are removed properly when a converted hangar is removed. I think this might be the only way to unequip 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 #6668 on: July 18, 2020, 01:13:20 PM »

Thanks Morrokain, I had tried a structure very similar to that. The problem came when attempting to do any refit with a market involved. With the wings being bought from the market, a player could trigger the refit (+1 LPC in inventory) and then click Undo and get a full refund for the LPC, while keeping it. Sell it back - free money exploit.

I did find a solution, which was to remove all bays entirely, then add them back. I noticed fighters are removed properly when a converted hangar is removed. I think this might be the only way to unequip fighters.

Ahh, ok I wouldn't have thought of that exploit that makes sense. Glad you figured out a way, anyway.  :)
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 #6669 on: July 18, 2020, 03:51:56 PM »

I don't see an API hook for getKnownBlueprints() from the FactionAPI.

So the question is, is there any way for the player to get blueprint packages from raiding factions? Individual blueprints are not a concern because ships have UNBOARDABLE and things like "base_bp" and "rare_bp" have been removed. I want to keep the bp package tags for each item, though, since other mods like Nex and faction mods rely on giving out these packages at the start of a new campaign so I want their contents preserved - I just want them to be unavailable to get in the pure TC configuration.

The concern is that things like knownShips and knownWeapons accepts blueprint packages as a parameter. Since I'm no longer overriding faction files in their entirety, I am looking to prevent the case where the player can get access to vanilla blueprint packages (for instance an unmodified xiv_bp_package) by salvage or raiding unless they choose to by editing the settings configuration. The faction won't actually know the contents of the blueprint package since I remove that manually through another setting, but if the package drops then the player can still learn them. Especially since fleet composition isn't completely customize-able, that could really mess with player faction npc fleets.

I know that leaving some areas blank or changing some areas of the file overrides the array instead of merging it, so is that a factor here to allow me to perform that use case? I haven't checked for access to a BlueprintSpecAPI or anything yet, so maybe I can set the rarity of salvage to zero through that? Or add the no_drop tag and that will cover it in all cases?

Weapons, Fighters, Hullmods and Ships have all been configured and seem to work as intended. I just haven't added the skin ids yet to test that out. Blueprints are the last outstanding item to make the TC completely configurable for market and salvage items. I might even be able to do many things in the middle of a game instead of requiring a new game - such as enabling vanilla content in markets at the endgame if the player gets bored or wants to compare stats, etc.

After that, I need to deal with stations if I can. Not sure how possible that is though since iirc I can't actually prevent buildable station variants from showing up in the list when the industry is being selected to build. So even if I made unique station ids and manually changed the existing core worlds stations, the player could still build vanilla station variants (and be at a severe disadvantage since those have less modules/weapons/fighters)
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24111
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6670 on: July 19, 2020, 12:01:37 PM »

I don't see an API hook for getKnownBlueprints() from the FactionAPI.

I'm not sure I understand - FactionAPI.getKnownShips() etc is all there, right?

In the .faction files, being able to specify by tag (NOT by blueprint package) is just shorthand for populating the knownShips etc fields. Where a "knowing" a specific hull came from isn't information that's retained.

... but if the package drops then the player can still learn them. Especially since fleet composition isn't completely customize-able, that could really mess with player faction npc fleets.

Ah, I think I see - that's not a thing, raiding isn't going to drop blueprint packages. There's no concept of "a faction knowing a specific blueprint package". As I mentioned earlier, there's just tag-based shorthand for populating known ships etc via the .faction files, but even that isn't reliant on or aware of blueprint packages.
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 #6671 on: July 19, 2020, 04:42:18 PM »

I don't see an API hook for getKnownBlueprints() from the FactionAPI.

I'm not sure I understand - FactionAPI.getKnownShips() etc is all there, right?

In the .faction files, being able to specify by tag (NOT by blueprint package) is just shorthand for populating the knownShips etc fields. Where a "knowing" a specific hull came from isn't information that's retained.

... but if the package drops then the player can still learn them. Especially since fleet composition isn't completely customize-able, that could really mess with player faction npc fleets.

Ah, I think I see - that's not a thing, raiding isn't going to drop blueprint packages. There's no concept of "a faction knowing a specific blueprint package". As I mentioned earlier, there's just tag-based shorthand for populating known ships etc via the .faction files, but even that isn't reliant on or aware of blueprint packages.

Ok great that's one less thing to worry about. Thanks!
Logged

Originem

  • Purple Principle
  • Captain
  • ****
  • Posts: 430
  • Dancing like a boss.
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6672 on: July 20, 2020, 05:54:43 AM »

What's the AI difference of ships which have shield or not?
If I set the radius of shield to 0 in the combat, would the ship's act like the ship without shield?

And how to render weapons below the ship?
« Last Edit: July 20, 2020, 10:41:22 AM by Originem »
Logged
My mods


Hiroyan495

  • Lieutenant
  • **
  • Posts: 61
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6673 on: July 20, 2020, 06:12:43 AM »

What files are affected by a ship being removed from a mod?

So far I removed it from "hulls", "variants" (folders), ship_data.csv, sim_opponents.csv, unique_bounty_data.csv and from the files in "factions".
« Last Edit: July 21, 2020, 06:18:05 AM by Hiroyan495 »
Logged

Mondaymonkey

  • Admiral
  • *****
  • Posts: 777
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6674 on: July 20, 2020, 07:10:55 AM »

and from the files in "factions".

In "factions" folder there are "default ship roles".

Also, descriptions and title screen variants, skins (if there are one for this hull), missions (if they use it) and I am not sure it's a full list.
Logged
I dislike human beings... or I just do not know how to cook them well.
Pages: 1 ... 443 444 [445] 446 447 ... 710