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 ... 489 490 [491] 492 493 ... 706

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

Histidine

  • Admiral
  • *****
  • Posts: 4661
    • View Profile
    • GitHub profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7350 on: May 02, 2021, 09:13:16 AM »

In BaseHubMission.setPersonMissionRef, when/where is the ref then unset from memory?

Hello, new. Been messing around with a mod (BSG Revived) since I got the game. Adding the ships into my own game using the wikis modding guide. I've managed to get the ships to show as blueprints, the weapons as well. I can spawn the ships using their variants and they come fully locked and loaded. I have the ability to construct them at my colonies but my issue is the game isnt reading the variant files (more accurately I messed up somewhere and it *cant* read them) so these ships are included in patrol fleets but show as having no armament. I have the ships in the default_shiproles, that file is in the folders its meant to be in. Got the ship_data sorted, wings as well. Weapons_data, a-ok as far as I can see. I tagged all relevant ships and weapons as rare_bp rather than the bsg_bp tag it originally came with because I wasnt including the original mods faction in my universe.

And umm...dunno really, gone through all the ships in the shipeditor, made sure the variants are all lined up nice and neat. Sorry if this is a rambling mess, I havent ever fiddled with the guts of a mod (or made one) before. Any pointers would be helpful!
Check if the mod's weapons have their autofit tags set (e.g. vanilla LMG has "pd6, kinetic3, SR"). Also try adding the "no_autofit" tag to one or more ships; if those ships then spawn with weapons, that makes it clear where the problem is.

If that doesn't fix it, post the mod and I might have time to look for obvious issues.

here's the .skin file, could someone throw me a hand on this?
Wild guess: Remove the manufacturer tag with its empty string.
« Last Edit: May 02, 2021, 09:15:25 AM by Histidine »
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23988
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7351 on: May 02, 2021, 11:04:36 AM »

In BaseHubMission.setPersonMissionRef, when/where is the ref then unset from memory?

When abort() is called, either because the mission wasn't accepted, or because it was completed. See:
changes.add(new VariableSet(person.getMemoryWithoutUpdate(), key, true));
and VariableSet.abort()
Logged

Sallymoronic

  • Ensign
  • *
  • Posts: 7
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7352 on: May 02, 2021, 11:52:06 AM »

In BaseHubMission.setPersonMissionRef, when/where is the ref then unset from memory?

Hello, new. Been messing around with a mod (BSG Revived) since I got the game. Adding the ships into my own game using the wikis modding guide. I've managed to get the ships to show as blueprints, the weapons as well. I can spawn the ships using their variants and they come fully locked and loaded. I have the ability to construct them at my colonies but my issue is the game isnt reading the variant files (more accurately I messed up somewhere and it *cant* read them) so these ships are included in patrol fleets but show as having no armament. I have the ships in the default_shiproles, that file is in the folders its meant to be in. Got the ship_data sorted, wings as well. Weapons_data, a-ok as far as I can see. I tagged all relevant ships and weapons as rare_bp rather than the bsg_bp tag it originally came with because I wasnt including the original mods faction in my universe.

And umm...dunno really, gone through all the ships in the shipeditor, made sure the variants are all lined up nice and neat. Sorry if this is a rambling mess, I havent ever fiddled with the guts of a mod (or made one) before. Any pointers would be helpful!
Check if the mod's weapons have their autofit tags set (e.g. vanilla LMG has "pd6, kinetic3, SR"). Also try adding the "no_autofit" tag to one or more ships; if those ships then spawn with weapons, that makes it clear where the problem is.

If that doesn't fix it, post the mod and I might have time to look for obvious issues.

here's the .skin file, could someone throw me a hand on this?
Wild guess: Remove the manufacturer tag with its empty string.

You're a bloody star! That did the job of the ships coming with weapons now I just need to figure out how to have the mods weapons set as priority for the mod ships. I went through the vanilla weapons_data and chose tags that sorta matched the modded weapons and set those to 20 (kinetic20 and missile20, in this case). Am I understanding right that the higher the number the "better" a weapon is for any given role as read by the game?
Logged

Harmful Mechanic

  • Admiral
  • *****
  • Posts: 1340
  • On break.
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7353 on: May 02, 2021, 10:13:43 PM »

In drop groups, can we call the new mixed-type weapons by the mount type they fit in? IE:
Code
wpn_:{tier:3, tags:[<REDACTED>, !restricted], weaponType:HYBRID}
Or does the game call them by their base type in the weapon file for this purpose?
Logged

lethargie

  • Commander
  • ***
  • Posts: 183
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7354 on: May 03, 2021, 08:28:01 AM »

im trying to spawn a muzzle flash on a weapon from another weapon.

engine.spawnMuzzleFlashOrSmoke(weapon.getShip(),
                    weapon.getSlot(),
                    muzzleSource2,
                    counter,
                    weapAngle + currentAngle);

where weapon is the weapon calling advance on a everyframeeffect and muzzlesource2 is the weaponSpecApi of another weapon that has the same turret/barrel offset. On a hardpoint the flash seems to line up properly, but turreted has the muzzle flash with a strong offset from the actual position. Why?

Hmm - probably because the slot type of weapon and muzzleSourc2 doesn't match up? Hardpoints and turrets have different fire offsets.


muzzlesource2 is a weaponSpecApi. I cant specify if its hardpoint or turret. Weapon.getSlot() gets me the slot of the weapon im currently in the everyFrameEffect. MuzzleFlash2 is the spec of a weapon I got from global.getsettings. It,s a copy of the spec of weapon, except it has muzzle flash definition. The goal is to spawn a muzzle flash for a beam weapon.

What the problem look ingame is the flash always come out of the position of the unrotated turret barrel
« Last Edit: May 03, 2021, 08:42:58 AM by lethargie »
Logged

bob888w

  • Commander
  • ***
  • Posts: 106
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7355 on: May 04, 2021, 07:33:48 PM »

Not necessarily about coding, but I need help finding a mod I was previously interested in... I recalled that the mod included a paragon turned orbital farm and thats about it. Can anyone provide me a name?
Logged

Harmful Mechanic

  • Admiral
  • *****
  • Posts: 1340
  • On break.
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7356 on: May 04, 2021, 07:39:06 PM »

Not necessarily about coding, but I need help finding a mod I was previously interested in... I recalled that the mod included a paragon turned orbital farm and thats about it. Can anyone provide me a name?

I don't know about anybody else, but if this thread got clogged up with this sort of question, it would be dramatically less useful to me. I've set up a new thread over here for what-was-that-mod questions.
Logged

DesperatePeter

  • Commander
  • ***
  • Posts: 167
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7357 on: May 04, 2021, 11:19:16 PM »

Is there any way for a mod to interact with the ship refit screen (specifically the weapon group settings)?

I searched the API Doc but didn't find anything promising.

Ideally, I would like to add another GUI-element to that screen. But being able to listen for InputEvents and having access to the FleetMember-API would also do.

SafariJohn

  • Admiral
  • *****
  • Posts: 3010
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7358 on: May 05, 2021, 07:33:14 AM »

Does Reinforced Bulkheads make enemy ships always recoverable? Without story points?
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 #7359 on: May 05, 2021, 03:54:42 PM »

1) I know WeaponSpecAPI is shared among all weapons of that spec. But I can't remember if WeaponAPI is - or if that is unique to the WeaponSlotAPI of the ShipAPI.

In other words, if I iterate through WeaponAPIs on a ship under the apply method of a skill, will it only affect that ship's weapons?

2) "apply" from implementing ShipSkillEffect is only ran once at the start of combat correct? It's not run every frame is it?
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23988
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7360 on: May 05, 2021, 04:00:04 PM »

Is there any way for a mod to interact with the ship refit screen (specifically the weapon group settings)?

I searched the API Doc but didn't find anything promising.

Ideally, I would like to add another GUI-element to that screen. But being able to listen for InputEvents and having access to the FleetMember-API would also do.

I don't believe this is possible, at least not easily. I don't *think* the information as to what fleet member is selected for refit is exposed at all.

Does Reinforced Bulkheads make enemy ships always recoverable? Without story points?

It should, but there've been some reports of "always recoverable" ships ending up in story recovery; not sure what might be going wrong there but it could also affect this sometimes.

1) I know WeaponSpecAPI is shared among all weapons of that spec. But I can't remember if WeaponAPI is - or if that is unique to the WeaponSlotAPI of the ShipAPI.

In other words, if I iterate through WeaponAPIs on a ship under the apply method of a skill, will it only affect that ship's weapons?

2) "apply" from implementing ShipSkillEffect is only ran once at the start of combat correct? It's not run every frame is it?

1) A WeaponAPI is made for the ship.
2) Neither! It's run whenever the ship's captain changes. So for example if you transfer command.
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 #7361 on: May 05, 2021, 04:04:41 PM »

1) A WeaponAPI is made for the ship.
2) Neither! It's run whenever the ship's captain changes. So for example if you transfer command.

Ah thanks and that answers my third question too - which was do I have to unapply WeaponAPI changes? - looks like is a definite yes.  :)
Logged

Retry

  • Captain
  • ****
  • Posts: 420
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7362 on: May 05, 2021, 09:41:30 PM »

Hello, once again I find myself trying to be too clever for my own good.

I'm currently trying to experiment with a hullmod that converts Phase Ships into conventional omni-shielded warships, where the stats of the shield is dependent on the stats of the original phase cloak.  I'm not entirely sure if it's actually feasible in practice (in terms of gameplay balance), but that's why I want to try it out.

I know going from shielded to phase is practically impossible since that requires glow sprites that normal ships don't have, but I've been having issues with getting the omni-shield part working in the first place, so I'm beginning to wonder if it's just my lack of experience or if going from phase->shields is also impossible.

I currently want to try making the shield's upkeep directly dependent on the ship's original cloak upkeep as the shield upkeep, use activation cloak cost efficiency (which is Activation Cost/Vent Rate iirc?) as part of a function to calculate shield efficiency, and the cloak cooldown time (or some other metric) to calculate shield arc (which doesn't matter much in Vanilla but might be relevant with mod-added ships).

The relevant part of the script is below, in the "ApplyEffectsAfterShipCreation" section:



(The exact formulas used for the shield attributes are WIP)

When used on an actual phase ship, it looks like this:



Some of the values look odd, but the new system stats in the UI appear as if it were a shielded vessel now.  However, the ship still functions like a phase ship when tested in battle; right clicking causes the modified Afflictor to phase instead of activate a shield despite the presence of the hullmod.  I thought it had something to do with the ridiculous flux upkeep from my messed-up formula, but when I switched it manually to a reasonable number (ex: 0.5f -> 50% shield dissipation), the Afflictor still Phases instead of Shields.  The shield part not working at all is currently the biggest roadblock, I'm not sure what I'm overlooking here, could I get a few pointers on how to get that part functioning (if it's possible at all)?

Additionally to that, is there a way to grab the base value (unmodified by officers, other hullmods, caps/vents, scripted battlefield shenanigans, etc) of attributes off a ship, such as:
-Phase Activation Cost & Phase Upkeep
-Flux Dissipation (can't find anything in the FluxTrackerAPI or ShipAPI, perhaps I'm looking in the wrong place?)
-Phase Cooldown (iirc there's a skill that reduces this, and I'd prefer that skills or hullmods not accidentally buff (or nerf) the shield conversion)
-[OPTIONAL] Getting the efficiencies directly, if possible (a lot of the ship.csv data for phase stuff is written as ratios already, so that'd allow me to simplify stuff slightly if I can pull them)

The current method I'm using from the ShipAPI grabs the current flux stats, which means currently means when I adjust certain attributes by, say, adding flux or vents, the shield's efficiency will change with it, which is extremely amusing but not intentional.  I was hoping there was a better way that I'm overlooking to do this, which is less volatile to external changes from other hullmods and officers?
Logged

ElPresidente

  • Commander
  • ***
  • Posts: 152
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7363 on: May 06, 2021, 12:43:43 AM »

I'm encountering several weird issues while fixing up an abandoned mod.

Namely, SOME ships cost 0CP to deploy in combat, despite having a defined Fleet Point cost and not being civillian. I checked, double-checked and tripple-checked the hull file and the ship_data and I can't find anything that would cause this.

Another issue is that a ship that should spawn with a built-in weapon does not. No errors, and I can see the weapon equipped on the ship in the codex. However, in actual combat the mount is empty. Weird.
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 #7364 on: May 06, 2021, 02:41:07 PM »

I'm encountering several weird issues while fixing up an abandoned mod.

Namely, SOME ships cost 0CP to deploy in combat, despite having a defined Fleet Point cost and not being civillian. I checked, double-checked and tripple-checked the hull file and the ship_data and I can't find anything that would cause this.

Make sure that "supplies/rec" is not 0 in ship_data. That is what determines DP - not fleet points. The weapon thing I'm not sure about. Maybe a script is at work there? Or also check for a skin file changing built in weapons if that were to exist.



If I check for Global.getSector().getPlayerFleet().getBattle() being null, is that a reliable way of ensuring the player fleet is not currently in combat when the script is running? Or is there a way to do that at all?

Context:
I'm testing out a skill that changes OP costs for bombers by adding/removing a hullmod. I am trying to prevent an exploit where the player sets his/her character on a ship, assigns the extra OP - and then assigns the character to another ship. I am handling this by simply removing all non-built in fighters (assuming clearing the list even does that) and returning the wings back to the player's inventory.

But! I don't want to do that if the player is switching flagships in combat because the AI ship would lose all the wings (is the theory). I only want this to occur if the player is in the refit screen - with the reasoning that once the battle is over the player character is in the same flagship as when the battle started even they switch ships during battle.


Warning: DO NOT TRY THIS!

*EDIT*

Errr, ok it looks like "apply" and "unapply" are both called when you change the piloted ship in the refit screen??

I have:                 ship.getVariant().clear();

under "unapply"

 - And when I switch ships it immediately clears the variant of the ship I'm switching to rather than the one I am switching from. So I'm pretty confused at this point haha.  ;D

*EDIT 2*
Ok yikes yeah the behavior is really inconsistent. Sometimes it calls:                ship.getVariant().removePermaMod("archeus_warship_bays_high");

 - and sometimes it doesn't. It also clears the variant but doesn't seem to update the UI or finalize things until moving to a different screen? So if I switch to a different ship with my character it clears the variant and adds the hullmod - if I immediately switch to another ship it sometimes preserves the variant and sometimes doesn't but it seems to consistently remove the hullmod.

However, if I switch to a ship and then go out of the refit screen then it finalizes the variant clear and updates the UI - but if I switch again it doesn't remove the hullmod.
« Last Edit: May 06, 2021, 03:38:41 PM by Morrokain »
Logged
Pages: 1 ... 489 490 [491] 492 493 ... 706