Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Pages: 1 ... 620 621 [622] 623 624 ... 710

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

Liral

  • Admiral
  • *****
  • Posts: 718
  • Realistic Combat Mod Author
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9315 on: October 31, 2022, 10:53:27 AM »

wonder if your mod tries to spawn a BeamAPI as a projectile

I am worried that it might be, but I had thought this check would stop that problem:

Code
        if (direct.get("compartment") <= 0 && object instanceof DamagingProjectileAPI) {
            DamagingProjectileAPI projectile = (DamagingProjectileAPI) object;
            if (Ricochet.isCaused(projectile, ship)) Ricochet.occur(projectile, ship);
            reportDamage(0, 0, direct.get("emp"), 0, object, ship);
            return;
        }

Here is my new ricochet check and driver code.  The error occurs in the method occur.

Methods Called
Code: Methods Called
public final class Ricochet {
    ...

    /**
     * Return whether this {@link DamagingProjectileAPI} could ricochet.
     * <p></p>
     * @param projectile {@link DamagingProjectileAPI} hitting the armor of a
     *                   {@link ShipAPI}
     * <p></p>
     * @return {@link Boolean} whether the {@link DamagingProjectileAPI} will
     *         bounce off the armor of a {@link ShipAPI}
     */
    private static boolean isAble(final DamagingProjectileAPI projectile) {
        return getDamageType(projectile) == KINETIC
                && projectile.getProjectileSpec() != null
                && projectile.getProjectileSpec().getOnHitEffect() == null;
    }

    /**
     * Return whether this {@link DamagingProjectileAPI} ricochets off this
     * {@link ShipAPI} this time.
     * <p></p>
     * @param projectile {@link DamagingProjectileAPI} hitting the armor of a
     *                   {@link ShipAPI}
     * <p></p>
     * @return {@link Boolean} whether the {@link DamagingProjectileAPI} will
     *         bounce off the armor of a {@link ShipAPI}
     */
    public static boolean isCaused(final DamagingProjectileAPI projectile, final ShipAPI ship) {
        return isAble(projectile)
                && Collision.getClosestSegment(projectile.getLocation(), ship) != null
                && Collision.isPointWithinBounds(getLocationBehind(projectile.getLocation(),
                                                 Misc.normalise(projectile.getVelocity())), ship)
                && PROBABILITY * 90 * Math.random() > Collision.getObliqueAngle(projectile, ship);
    }

    /**
     * Bounce a {@link DamagingProjectileAPI} off the armor of a
     * {@link ShipAPI} at the same angle it hit.
     * <p></p>
     * @param projectile {@link DamagingProjectileAPI} hitting the armor of a
     *                   {@link ShipAPI}
     * @param ship {@link ShipAPI} being hit
     */
    public static void occur(final DamagingProjectileAPI projectile, final ShipAPI ship) {
        Global.getCombatEngine().spawnProjectile(
            projectile.getSource(),
            projectile.getWeapon(),
            projectile.getWeapon().getId(),
            projectile.getLocation(),
            getRicochetFacing(getRicochetVector(projectile, ship)),
            ship.getVelocity()
        );
    }
}
[close]
« Last Edit: October 31, 2022, 11:02:16 AM by Liral »
Logged

SafariJohn

  • Admiral
  • *****
  • Posts: 3023
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9316 on: October 31, 2022, 05:52:15 PM »

An excellent question :)

Take a look at com.fs.starfarer.api.impl.campaign.plog.SModRecord, in particular its use of WeakReference<FleetMemberAPI>, it's an approach (about the only one I could think of) to solving this exact problem.

Short of, yes, trying to search through everything and then still not accounting for whatever random way some mod might be storing a fleet member.

It worked!!!

...Kind of. By changing all memory references of FleetMemberAPI to WeakReference<FleetMemberAPI> I was able to to get garbage collection to acknowledge that the FleetMemberAPI in question was due to be annihilated. The one problem I'm having is that garbage collection seems to happen on a completely arbitrary basis, so I may have to add a sentence or two in the upcoming forum post about how players need to save and load to force garbage collection if the station isn't recognizing that they have a redeemable ship hull. If you know a way to force garbage collection without saving and loading I'm all ears, but otherwise I'm pretty happy with how this turned out.

EDIT: saving/loading only seems to force garbage collection in dev mode, so it looks like I'll have to find a way around this unfortunately. See reply
It turns out regular old saving forces garbage collection, so it seems like telling players to do that might just be my solution. If there's an easy way to force garbage collection via the API (which there doesn't seem to be) I will be happy to implement it, but otherwise I'm very happy to just tell people to save their game since that doesn't seem like it requires a lot of effort on their part.

EDIT: I set up a script to run System.gc() when the player interacts with my station. This has completely solved all of my issues and eliminated the need for the player to save. Unless there's some sort of hidden consequences for doing this, I'm going to keep it this way.

If you think you need to force garbage collection, you probably need to rethink what you are doing. It is a code smell; a red flag of bad design.
Logged

Wyvern

  • Admiral
  • *****
  • Posts: 3803
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9317 on: November 01, 2022, 11:04:52 AM »

So, it's weapon mirroring question time again!

I've got this working in almost every context. Combat, fleet screen, and refit all work correctly. There's just one spot that still has problems: the mouseover tooltip in the refit screen. See attached image. You'll note that the weapon on the ship is displayed correctly, while the weapon in the tooltip has a non-mirrored base sprite with a mirrored array of missiles.
(Interestingly, if you -click- on the weapon, the drop-down list correctly displays it in fully non-mirrored form, including in the mouseover tooltip.)

@Alex: How do I fix this? Maybe I'm missing something, but I don't see anything obvious in the API that would let me do... anything relevant. (I'm guessing that, under the hood, that tooltip is constructed from the WeaponSpecAPI object, without reference to the weapon's SpriteAPI objects?)

Code that I'm using to mirror a weapon, as called from a WeaponEffectPluginWithInit's init method:
Code

public static void mirror( WeaponAPI weapon ) {
if( weapon == null ) return;
weapon.ensureClonedSpec();

mirror( weapon.getBarrelSpriteAPI() );
mirror( weapon.getSprite() );
mirror( weapon.getUnderSpriteAPI() );

List<Vector2f> fireOffsets = weapon.getSpec().getHardpointFireOffsets();
List<Float> angleOffsets = weapon.getSpec().getHardpointAngleOffsets();
mirrorOffsets( fireOffsets, angleOffsets );

fireOffsets = weapon.getSpec().getTurretFireOffsets();
angleOffsets = weapon.getSpec().getTurretAngleOffsets();
mirrorOffsets( fireOffsets, angleOffsets );

fireOffsets = weapon.getSpec().getHiddenFireOffsets();
angleOffsets = weapon.getSpec().getHiddenAngleOffsets();
mirrorOffsets( fireOffsets, angleOffsets );
}

public static void mirror( SpriteAPI s ) {
if( s == null ) return;
s.setWidth( -s.getWidth() );
s.setCenter( -s.getCenterX(), s.getCenterY() );
}

public static void mirrorOffsets( List<Vector2f> fireOffsets, List<Float> angleOffsets ) {
for( int i = 0; i < fireOffsets.size(); i++ ) {
// ensureClonedSpec does -not- clone the individual Vector2f objects, so we have to make new ones.
// Fortunately, it does clone the lists, so we can actually make changes here.
Vector2f v = (Vector2f)fireOffsets.get( i );
fireOffsets.set( i, new Vector2f( v.getX(), -1f * v.getY() ) );
}
for( int i = 0; i < angleOffsets.size(); i++ ) {
angleOffsets.set( i, -1f * (Float)angleOffsets.get( i ) );
}
}

[attachment deleted by admin]
Logged
Wyvern is 100% correct about the math.

NikoTheGuyDude

  • Commander
  • ***
  • Posts: 231
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9318 on: November 01, 2022, 12:29:27 PM »

Is it possible to spawn a derelict, in combat, without destroying a ship? I'm planning to make debris fields spawn a bunch of bits and pieces of destroyed ships (among other things). How would I do this without spamming the chat with "ship destroyed"?
Logged

NikoTheGuyDude

  • Commander
  • ***
  • Posts: 231
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9319 on: November 01, 2022, 01:36:17 PM »

I'm trying to do this:
Code
            engine.spawnEmpArc(
                ship,
                ourCoordinates,
                null,
                ship,
                DamageType.ENERGY,
                500f,
                2000f,
                5000f,
                "tachyon_lance_emp_impact",
                20f,
                Color(25, 100, 155, 255),
                Color(255, 255, 255, 255)
            )

, however, it NPES on the 3rd line of this method, in EmpArcEntity.class:
Code
    public WeightedRandomPicker<D.Oo> getPotentialTargets(boolean var1) {
        float var2 = this.maxRange;
        int var3 = this.source.getOriginalOwner();
        WeightedRandomPicker var4 = new WeightedRandomPicker();
.

This is really weird-it seems like this method is called every time spawnEmpArc is called, thereby trying to access a potentially null variable... when the documentation of spawnEmpArc says damagesource can be null. Am I misunderstanding this? Or is the documentation just incorrect?
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24128
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9320 on: November 01, 2022, 02:41:17 PM »

I believe this is impossible, but is there any way to display "Heat" instead of "Flux" for a specific ship for the little combat indicator next to it?

Yeah, I don't think so - sorry!

It worked!!!

...Kind of. By changing all memory references of FleetMemberAPI to WeakReference<FleetMemberAPI> I was able to to get garbage collection to acknowledge that the FleetMemberAPI in question was due to be annihilated. The one problem I'm having is that garbage collection seems to happen on a completely arbitrary basis, so I may have to add a sentence or two in the upcoming forum post about how players need to save and load to force garbage collection if the station isn't recognizing that they have a redeemable ship hull. If you know a way to force garbage collection without saving and loading I'm all ears, but otherwise I'm pretty happy with how this turned out.

EDIT: saving/loading only seems to force garbage collection in dev mode, so it looks like I'll have to find a way around this unfortunately. See reply

You could call System.gc() but that will definitely cause a noticeable hitch/frame drop.

Have you considered also trying to detect that the ship did in fact get destroyed by using a FleetEventListener or something similar? You could then just use the WeakReference to make sure you're not hanging on to the reference past the ship being gone, for whatever other reason.

EDIT: I set up a script to run System.gc() when the player interacts with my station. This has completely solved all of my issues and eliminated the need for the player to save. Unless there's some sort of hidden consequences for doing this, I'm going to keep it this way.

(Ah!)


@Alex: How do I fix this? Maybe I'm missing something, but I don't see anything obvious in the API that would let me do... anything relevant. (I'm guessing that, under the hood, that tooltip is constructed from the WeaponSpecAPI object, without reference to the weapon's SpriteAPI objects?)

Hmm, I don't think you could. My guess is at that point it's using the base, non-mirrored weapon spec. I'm guessing your code does the mirroring at some point after the weapon is actually mounted?

... I guess you might mess around with, like, adding mirrored weapons to the player cargo, but I don't think there's a callback pre opening the weapon picker dialog. I think you're probably sol on this one, to be honest.


Is it possible to spawn a derelict, in combat, without destroying a ship? I'm planning to make debris fields spawn a bunch of bits and pieces of destroyed ships (among other things). How would I do this without spamming the chat with "ship destroyed"?

I don't *think* so. But you could temporarily set its hullSize to FIGHTER to avoid those messages.


This is really weird-it seems like this method is called every time spawnEmpArc is called, thereby trying to access a potentially null variable... when the documentation of spawnEmpArc says damagesource can be null. Am I misunderstanding this? Or is the documentation just incorrect?

Oh wow, fixed that up. That line is completely unnecessary, too, just a leftover code fragment.


(@Liral: ahh, I'm not sure. And it's a bit much for me to really dive into right now, unfortunately!)
Logged

Wyvern

  • Admiral
  • *****
  • Posts: 3803
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9321 on: November 01, 2022, 03:10:55 PM »

@Alex: How do I fix this? Maybe I'm missing something, but I don't see anything obvious in the API that would let me do... anything relevant. (I'm guessing that, under the hood, that tooltip is constructed from the WeaponSpecAPI object, without reference to the weapon's SpriteAPI objects?)

Hmm, I don't think you could. My guess is at that point it's using the base, non-mirrored weapon spec. I'm guessing your code does the mirroring at some point after the weapon is actually mounted?

... I guess you might mess around with, like, adding mirrored weapons to the player cargo, but I don't think there's a callback pre opening the weapon picker dialog. I think you're probably sol on this one, to be honest.
I think you're misunderstanding where the problem is. That's not the weapon picker dialog - the weapon picker dialog works fine; no mirroring happens in it.

What breaks is the mouseover tooltip when you have the weapon installed in a location that makes it mirror: it appears to be retrieving weapon offsets from the cloned weaponspec (where they've been mirrored, and have to be mirrored in order for the missile positioning on the ship to be correct), and then combining that with the un-mirrored weapon sprite (i.e., ignoring the weapons' adjustments to its SpriteAPI objects).

...This doesn't, necessarily, mean that I'm not sol with getting this to work without API changes, of course, but I figure it's worth clarifying.
Logged
Wyvern is 100% correct about the math.

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24128
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9322 on: November 01, 2022, 06:35:27 PM »

Ah, you're absolutely right, my apologies!

<after 15 minutes digging into it> ... my further apologies, you still appear to be sol. This is also fairly tricky code to change, I don't think I can do it with any expectation of it working right without something to test against. If you were to provide a very small mod that does this to a weapon, I could give it a go, but, full disclosure: I couldn't spend *too* much time on it, so if it e.g. doesn't get done in less than a half an hour it doesn't get done.
Logged

Wyvern

  • Admiral
  • *****
  • Posts: 3803
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9323 on: November 01, 2022, 07:07:10 PM »

Fair enough, and thank you for taking a look! Here's your mini-mod; it makes resonator MRMs (and only resonator MRMs) mirror themselves when installed on the left side of a ship.

(I'd be inclined to suggest, as a possible quick & simple fix, adding a WeaponAPI.getOriginalSpec() method that, when someone calls ensureClonedSpec(), retains a reference to an original unmodified copy. Then use that when assembling the tooltip. ...But, well. I don't know what the actual code there looks like, and perhaps that's not actually quick or simple or even a relevant idea in the first place. Best of luck!)

[attachment deleted by admin]
Logged
Wyvern is 100% correct about the math.

NikoTheGuyDude

  • Commander
  • ***
  • Posts: 231
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9324 on: November 02, 2022, 07:20:18 AM »

I have a mod that adds combat effects for hyperstorms. I add a bunch of nebulae to the combat map, and then add a script that, periodically, checks for nearby ships, does some math, and based on the results, either does or doesnt add another script that spawns a mine with NONE colission class, no targetting indicator, nigh infinite hp, and deletes/spawns another mine of this type every 0.1 seconds, placing every mine in the direction of the source of a EMP arc that will try to hit the ship in a few seconds. The idea is that this adds a threat in the direction of the EMP arc, provoking the AI into raising shields and blocking the arc.

The AI reacts to this pretty decently, however, when in combat, the ships tend to neglect the mine that has 2k energy damage and 6.5k EMP damage sitting right behind it in favor of raising its shield against a kite 700 Su away. On top of that, the AI seems to think they can either hit or avoid the mine, and thus phased ships unphase to use EMP emitter, ships use flares, or phase skimmer to run away. I'm not against them using movement to get away, since the EMP doesnt hit them if they're outside of it's range, but I'd like to make them have a higher priority in blocking the mine, as well as not use PD systems on something they literally cannot hit (why does EMP emitter try to hit things with NONE colission class?).

On top of that, it just seems iffy that the AI doesn't even try to avoid the storming nebulae. Any ideas on how to make the ships avoid the nebulae?
Logged

NikoTheGuyDude

  • Commander
  • ***
  • Posts: 231
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9325 on: November 02, 2022, 07:33:32 AM »

Also, on that note, I know I'm using internal classes (I've casted CombatNebulaAPI to the internal class A, and I've used A's getNebulaAt() method to get Cloud), but, is ther eany awy to get the radius of a nebula cloud? I'm currently just approximating the average with flat unchanged values, but I'd like more accurate measurements.

I also want to know if I can replace the nebula texture at all-I want to make hyperclouds generate with, well, the hypercloud texture.

A few questions about this class as well:
What is "tileHasNebula()"? What is the tile in this context? What kind of values would I have to give to actually get a true value?
I'm really curious about "chargeNearbyClouds()" and "dumpFlux()". You don't have to answer, but, are these used? If not, what were they gonna be used for??
Logged

NikoTheGuyDude

  • Commander
  • ***
  • Posts: 231
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9326 on: November 02, 2022, 07:36:39 AM »

And finally: How would I go about rendering terrain effects in combat?

Let's say I want to render a magnetic field (and storm) in combat, heavily zoomed in, focused on where the playerfleet is. Is it possible to render the effect in combat, animation and all? If so, what's the first steps to doing that? I'm really (never done it before) unfamiliar with like, rendering, and animations, and most types of combat graphics, so I'm pretty clueless here. The most I know to do is get the spriteAPI, and use addLayeredRenderingPlugin to render /something/, but NOT how to animate it.

Same goes for slipstreams, as that's another thing I'd want to render.
Logged

Liral

  • Admiral
  • *****
  • Posts: 718
  • Realistic Combat Mod Author
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9327 on: November 02, 2022, 08:18:59 AM »

(@Liral: ahh, I'm not sure. And it's a bit much for me to really dive into right now, unfortunately!)

 :'(

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24128
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9328 on: November 02, 2022, 09:50:53 AM »

Fair enough, and thank you for taking a look! Here's your mini-mod; it makes resonator MRMs (and only resonator MRMs) mirror themselves when installed on the left side of a ship.

(I'd be inclined to suggest, as a possible quick & simple fix, adding a WeaponAPI.getOriginalSpec() method that, when someone calls ensureClonedSpec(), retains a reference to an original unmodified copy. Then use that when assembling the tooltip. ...But, well. I don't know what the actual code there looks like, and perhaps that's not actually quick or simple or even a relevant idea in the first place. Best of luck!)

Thank you, I really appreciate that! And, that's an excellent suggestion, I was caught up in making the tooltip render the mirrored weapon, but this is *way* simpler. Did it in about 5 minutes and verified that it works using your test mod :)

(Can I just say, this is super cool? I mean, I've seen this before and I think we've talked about some of the details, but it's just so neat that this is even possible and that it works so cleanly!)


I have a mod that adds combat effects for hyperstorms. I add a bunch of nebulae to the combat map, and then add a script that, periodically, checks for nearby ships, does some math, and based on the results, either does or doesnt add another script that spawns a mine with NONE colission class, no targetting indicator, nigh infinite hp, and deletes/spawns another mine of this type every 0.1 seconds, placing every mine in the direction of the source of a EMP arc that will try to hit the ship in a few seconds. The idea is that this adds a threat in the direction of the EMP arc, provoking the AI into raising shields and blocking the arc.

The AI reacts to this pretty decently, however, when in combat, the ships tend to neglect the mine that has 2k energy damage and 6.5k EMP damage sitting right behind it in favor of raising its shield against a kite 700 Su away. On top of that, the AI seems to think they can either hit or avoid the mine, and thus phased ships unphase to use EMP emitter, ships use flares, or phase skimmer to run away. I'm not against them using movement to get away, since the EMP doesnt hit them if they're outside of it's range, but I'd like to make them have a higher priority in blocking the mine, as well as not use PD systems on something they literally cannot hit (why does EMP emitter try to hit things with NONE colission class?).

Honestly, this is just a "how it works is how it works" kind of situation - I don't know the answers to your questions offhand. My *guess* would be that CollsionClass.NONE is what's making the mine not register as a threat shields-wise but this is something you could test. It's entirely possible - likely, even - that CollisionClass.NONE mines are just not a thing the AI knows how to deal with, and it's not likely to learn unless I end up needing this sort of thing for vanilla.


On top of that, it just seems iffy that the AI doesn't even try to avoid the storming nebulae. Any ideas on how to make the ships avoid the nebulae?

Fleets used to do that, but now that it's a thing, they "go slow" instead. Take a look at some unused code in TacticalModule.updateAvoidList() to see how that was done.


Also, on that note, I know I'm using internal classes (I've casted CombatNebulaAPI to the internal class A, and I've used A's getNebulaAt() method to get Cloud), but, is ther eany awy to get the radius of a nebula cloud? I'm currently just approximating the average with flat unchanged values, but I'd like more accurate measurements.

There's no concept of a "radius", a nebula is a bunch of tiles that overlap to create the illusion of something smoother. Just in general, if you're doing this sort of stuff, you're pretty much on your own and I generally discourage it because it'll break horribly with every release. I'd much rather get API requests that make modding better for everyone than a bunch of mods using internals.

I also want to know if I can replace the nebula texture at all-I want to make hyperclouds generate with, well, the hypercloud texture.

You can use MissionDefinitionAPI.setNebulaTex() and .setNebulaMapTex().


A few questions about this class as well:
What is "tileHasNebula()"? What is the tile in this context? What kind of values would I have to give to actually get a true value?

(See: the bit about nebulas being tiles-based, and the bit about being on your own.)

I'm really curious about "chargeNearbyClouds()" and "dumpFlux()". You don't have to answer, but, are these used? If not, what were they gonna be used for??

IIRC waaaaay back nebulas used to be created when ships vented flux - it was never actually fleshed out and it was, not to put too fine a point on it, not good.


And finally: How would I go about rendering terrain effects in combat?

Let's say I want to render a magnetic field (and storm) in combat, heavily zoomed in, focused on where the playerfleet is. Is it possible to render the effect in combat, animation and all? If so, what's the first steps to doing that? I'm really (never done it before) unfamiliar with like, rendering, and animations, and most types of combat graphics, so I'm pretty clueless here. The most I know to do is get the spriteAPI, and use addLayeredRenderingPlugin to render /something/, but NOT how to animate it.

Same goes for slipstreams, as that's another thing I'd want to render.

You're on the right track here! You want a layered rendering plugin and then, well, just a bunch of OpenGL code rendering whatever you're rendering. For stuff like magnetic fields, take a look at the terrain plugin to see how it does its rendering.

For slipstreams, I would not recommend doing it in combat, performance would suffer. You'd want something different and much more performant that gets the basic feeling across.


(@Liral: ahh, I'm not sure. And it's a bit much for me to really dive into right now, unfortunately!)

 :'(

(Sorry! There's only so much deep-dive digging I can reasonably do, especially when it's to do with stuff that's not in the API and is being used in complicated ways and isn't easy for me to reproduce etc etc etc. If I know something offhand or something jumps out, I'm happy to answer, but if I don't, this kind of thing can get inordinately time-consuming.)
Logged

NikoTheGuyDude

  • Commander
  • ***
  • Posts: 231
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9329 on: November 02, 2022, 10:27:35 AM »

Honestly, this is just a "how it works is how it works" kind of situation - I don't know the answers to your questions offhand. My *guess* would be that CollsionClass.NONE is what's making the mine not register as a threat shields-wise but this is something you could test. It's entirely possible - likely, even - that CollisionClass.NONE mines are just not a thing the AI knows how to deal with, and it's not likely to learn unless I end up needing this sort of thing for vanilla.

Yeah, they probably just don't know how to handle it. They DO avoid it though! They raise shields, phase away-but they never prioritize it above anything theyre fighting.
I thought the mines the volatile rift beam or whatever that omega weapon is called had this type of colissionclass, though? (It DOES spawn mines, right?)

Fleets used to do that, but now that it's a thing, they "go slow" instead. Take a look at some unused code in TacticalModule.updateAvoidList() to see how that was done.
I meant in-combat, not campaign.

There's no concept of a "radius", a nebula is a bunch of tiles that overlap to create the illusion of something smoother. Just in general, if you're doing this sort of stuff, you're pretty much on your own and I generally discourage it because it'll break horribly with every release. I'd much rather get API requests that make modding better for everyone than a bunch of mods using internals.
Yeeeah that's about what I thought. And about being on my own-I know, i should've mentioned I know that I'm basically voiding my warranty doing this. I'll make an API request to expose the nebula manager further in a bit (as well as the clouds themselves), maybe.
As for now, since I've got no idea how the tiles work, until either 1. the game updates and my mod breaks horribly, or 2. the game updates with a more fleshed out nebula API, I'll just raycast in 8 directions until the raycasting value doesn't return CombatNebulaAPI.locationHasNebula(raycastingpoint) and approximate a radius/bounds based on the values I get.


Anyway, thanks for the response, really appreciate it!
Logged
Pages: 1 ... 620 621 [622] 623 624 ... 710