Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Pages: 1 ... 244 245 [246] 247 248 ... 710

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

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24112
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3675 on: November 16, 2017, 01:30:38 PM »

If I'm understanding the question right, I'd suggest taking a look at FleetInteractionDialogPluginImpl.java - it sets up a battle, pulls in nearby fleets, etc.
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 #3676 on: November 16, 2017, 01:56:26 PM »

Yes, wow there is a whole lot of detail in that file.  Thank you!
Logged

Regoso

  • Ensign
  • *
  • Posts: 25
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3677 on: November 28, 2017, 07:06:45 PM »

This has probably been answered before (and iv looked just cant get a solid post to make it work)but ima ask anyway. Trying to use a decorative weapon to cover other weapons, so far its being rendered below them.



.wpn
Spoiler

{
   "specClass":"beam",
   "id":"laserupperdeck",
   "type":"DECORATIVE",
   "size":"LARGE",
   "showDamageWhenDecorative":true,
   "renderBelowAllWeapons":false,
   "alwaysAnimate":"true",
   "turretSprite":"graphics/weapons/decorative/Dec_1.png",
   "hardpointSprite":"graphics/weapons/decorative/Dec_1.png",
   "turretOffsets":[0, 0],
   "turretAngleOffsets":[0],
   "hardpointOffsets":[0, 0],
   "hardpointAngleOffsets":[0],
   "fringeColor":[255,255,255,255],
   "coreColor":[255,255,255,255],
   "glowColor":[255,255,255,255],
   "width":1.0,
   "textureType":ROUGH,
   "textureScrollSpeed":1.0,
   "pixelsPerTexel":1.0,
}

[close]

weapon slot
Spoiler
      "angle": 0,
      "arc": 0,
      "id": "WS0030",
      "locations": [
        44,
        -24.5
      ],
      "mount": "TURRET",
      "size": "SMALL",
      "type": "DECORATIVE"
[close]

not getting any errors its just showing up under the other weapons.
Logged

AxleMC131

  • Admiral
  • *****
  • Posts: 1722
  • Amateur World-Builder
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3678 on: November 28, 2017, 08:49:16 PM »

This has probably been answered before (and iv looked just cant get a solid post to make it work)but ima ask anyway. Trying to use a decorative weapon to cover other weapons, so far its being rendered below them.

...

not getting any errors its just showing up under the other weapons.

@Regoso Weapons on ships have a special render order that specifies which weapons appear over the top of others. I can't remember all the details, but the most basic rule is that the game will always render weapons closest to the ship's center of mass last, ie. "on top". A quick example is the Onslaught - if you look at the central large ballistic turret, you'll notice that its weapon will always render over the top of whatever you stick in the small turrets in front of it.

If it isn't already, you should be able to trick the game into placing your decorative weapon over another weapon with the following steps:

- Increase the height of the canvas your decorative weapon sprite is on, so it occupies the very front end of the canvas, with a bit of empty space behind it.
- Adjust the position of the decorative mount on the ship file to be closer to the center of the ship.
- Fine tune the decorative weapon's offset accordingly

That will result in the decorative weapon's actual coordinate position being closer to the ship's center of mass than the weapon (even though it should appear in the same location). It should therefore be rendered after the weapon itself, and appear on top. Hope that helps!  ;)



EDIT: I've also just been informed that apparently Large weapons will always render over Mediums (and Smalls) regardless of relative position, but since your file is saved as a LARGE weapon, it should be alright. Though just in case, it may also pay to change the mount itself to LARGE as well (instead of SMALL).
« Last Edit: November 28, 2017, 09:15:29 PM by AxleMC131 »
Logged

bananana

  • Commander
  • ***
  • Posts: 228
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3679 on: November 29, 2017, 02:45:15 AM »



i've been looking for this for so long
Logged
Any and ALL sprites i ever posted on this forum are FREE to use. even if i'm using them myself. Don't ever, EVER ask for permission, or i will come to your home and EAT YOUR DOG!!!
i do NOT want to see my name appear in the credits section of any published mod and will consider it a personal insult.

AxleMC131

  • Admiral
  • *****
  • Posts: 1722
  • Amateur World-Builder
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3680 on: November 29, 2017, 08:39:26 PM »

i've been looking for this for so long

Hehe, seriously, thank MesoTronik. I just gave his feedback in my own words on his behalf. :P
Logged

Histidine

  • Admiral
  • *****
  • Posts: 4682
    • View Profile
    • GitHub profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3681 on: November 30, 2017, 11:59:36 PM »

Is there a way I can flag a fleet so that other fleets' AI ignore it (don't try to engage it in battle, etc.)?

I'm asking because I don't think I want to run this for every CampaignFleetAPI that ever spawns:
Code: java
	public void setFleetDoNotAttackStations(CampaignFleetAPI fleet)
{
if (FLEETS_ATTACK_STATIONS) return;
for (CampaignFleetAPI station : allFleets)
{
if (fleet.getAI() == null) continue;
fleet.getAI().doNotAttack(station, 9999999);
}
}
(allFleets will have a peak size equal to maybe half the number of markets in the Sector)
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24112
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3682 on: December 01, 2017, 01:49:07 PM »

Hmm - I think you're stuck with something like that for the moment. If we're talking on the order of 100ish stations there (which it sounds like it's probably less) then I think that would be a negligible cost compared to the work of creating the fleet in the first place.
Logged

Histidine

  • Admiral
  • *****
  • Posts: 4682
    • View Profile
    • GitHub profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3683 on: December 01, 2017, 06:27:40 PM »

Well it's not so much the runtime resource cost that I'm worried about as the prospect of save file bloat.
(Or am I just looking for a premature optimization here?)
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24112
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3684 on: December 01, 2017, 07:02:48 PM »

Ah - well, you could clear that out on save and re-add on load, if it turns out to be significant.

Edit: to clear it out, you'd need to set the time to 0 and then call advance() on the AI - I'm reasonably sure that would work.

So you'd:
1) clear it out in ModPlugin.beforeGameSave()
2) restore it in ModPlugin.afterGameSave() and ModPlugin.onGameLoad()
« Last Edit: December 01, 2017, 07:07:43 PM by Alex »
Logged

Mongreal

  • Ensign
  • *
  • Posts: 46
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3685 on: December 03, 2017, 01:35:18 PM »

Is there a way to change the firerate of a weapon while it's firing ?
Well, I did manage to make a frankenstein-plugin that could act on the firerate but it was way too random and unreliable.
What I'm trying to achieve here is a slow spooling-up ramp for some gatlings. I'd like to have all of thoses starting at the same firerate and the larger ones achieve faster max firerate but accelerating at a slower pace.
I tried different things after the mitigated success of my first attempt but it doesn't work anymore.
Is there a clean way to do this ? Cleaner than "checking the cooldown after each round is fired and if that cooldown is equal or inferior to the last shot, if that's the case, decrease the cooldown of the next shot, and repeat that until the maximal fire rate is reached" ?
Logged

gruberscomplete

  • Captain
  • ****
  • Posts: 253
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3686 on: December 07, 2017, 07:37:43 PM »

Is it possible to change fleet distributions so that fleets have mostly 1-2 ships instead of like 8?

Is there a mod that does this?
Logged
Click here for FREE ships!               Plentysector               Robots With Souls

Gwyvern

  • Captain
  • ****
  • Posts: 318
  • I build ships.
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3687 on: December 12, 2017, 05:38:45 PM »

Is there a way to make missiles behave like projectiles?

(IE: Fade out after reaching max range, and being untargetable by PD)

If not, is there a way to get projectiles to leave persistent trails like missiles do?

This would save me from having to resort to particle effects. (which is a win win for everyone!)
« Last Edit: December 12, 2017, 05:42:44 PM by Gwyvern »
Logged

xenoargh

  • Admiral
  • *****
  • Posts: 5078
  • naively breaking things!
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3688 on: December 12, 2017, 07:32:44 PM »

You cannot get them to be ignored by PD without writing a new PDAI that specifically ignored them, no.

However, if they're not a guided projectile, they can have a "trail" that's generated as a particle via my FX library.  If they're guided, however, you'll probably have to settle for them being missiles that are simply indestructible.
Logged
Please check out my SS projects :)
Xeno's Mod Pack

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 #3689 on: December 13, 2017, 04:25:47 AM »

Are there any ways to warp/twist the sprite in game?
Logged
My mods


Pages: 1 ... 244 245 [246] 247 248 ... 710