Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 456 457 [458] 459 460 ... 462

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

SirHartley

  • Captain
  • ****
  • Posts: 272
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6855 on: October 16, 2020, 04:41:14 AM »

That would directly override Vanilla .csv values, which is not something I want to do due to compatibility issues - but I thank you for the pointers!
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 17257
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6856 on: October 16, 2020, 08:35:21 AM »

(That's the only way that comes to mind, yeah. Hmm...)
Logged

shoi

  • Commander
  • ***
  • Posts: 159
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6857 on: October 16, 2020, 12:13:29 PM »

Trying to change a fighter's variant to another version in combat.

It works...but it also overwrites that variant for every other wing in the game.

Any ideas? I've tried cloning the variant and assigning it to the wing using fleetmember, which doesn't seem to do anything either =/
Code
			if(parent != null)
{
CombatEngineAPI engine = Global.getCombatEngine();
List<FighterWingAPI> wings = parent.getAllWings();

for(FighterWingAPI wing : wings)
{
if(!wing.getWingId().equals("armaa_bit_wing"))
{
continue;
}
//wing.setVariantId("custom");
//List<ShipAPI> fighters = wing.getWingMembers();
ShipAPI fighter = wing.getLeader();
//for(ShipAPI fighter : fighters)
//{
//fighter.getMutableStats().getVariant().setHullVariantId("variant"+ship.getName());
MutableShipStatsAPI stats = fighter.getMutableStats();
ShipVariantAPI newVariant = stats.getVariant().clone();
stats.getVariant().setOriginalVariant(null);
fighter.getFleetMember().setVariant(newVariant,false,true);


stats.getVariant().clearSlot("WS0001");
stats.getVariant().addWeapon("WS0001",ship.getVariant().getWeaponId("WS0001"));
fighter.setHitpoints(0f);
ship.setHitpoints(0f);

//}


}
}
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 17257
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6858 on: October 16, 2020, 12:17:37 PM »

Ah - that's basically just never going to work. The ship is created from the variant once, and if you change the variant's weapons, that's not going to re-create the ship. You'd need to spawn another ship and replace this one with it, though that might have implications e.g. for things already targeting the "old" version etc, though in theory that should work.
Logged

shoi

  • Commander
  • ***
  • Posts: 159
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6859 on: October 16, 2020, 05:35:32 PM »

That's actually exactly what I did, I changed the variant then forced the fighter to redock, which let it spawn in with the new weapons.

Alas, i'll just take this since i can't find a better  solution. This is for a ship that isn't very common anyway so it's probably fine
Logged

Tokanova

  • Ensign
  • *
  • Posts: 1
    • View Profile
    • Email
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6860 on: October 16, 2020, 06:48:56 PM »

Hi there, I was just wondering, why are there such strict modding guidelines?
IE, why all the effort to try and balance mods?
I was just wondering, because I was thinking of getting into modding and just making OP BS for the heck if it,  and when I read the 'guidelines' thread I was a bit worried.

These are just mods right? Can't users decide if they themselves want to play with OP mods or not, instead of putting the burden of balance on the modders?
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 17257
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6861 on: October 16, 2020, 07:04:20 PM »

Hi! The guidelines are for if you want to make a mod that "fits in" nicely with vanilla/other mods and is balanced etc, so it's there to help you do that *if you want*, not to restrict what you can do.
Logged

SafariJohn

  • Admiral
  • *****
  • Posts: 1797
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6862 on: October 16, 2020, 07:24:20 PM »

If you know you are making OP BS and that is your goal, then I say go for it! There is quite a bit of silly stuff lurking around the modiverse.

The guidelines thread is to help new modders avoid breaking things, because if you push stats, systems, etc. too far then the ship or whatever becomes boring or the AI can't use it or what-not.

The idea of balancing mods is to keep vanilla and "balanced" mod content at the same relative power. For example, if every mod makes their capital ship the same strength as the Paragon battleship, then the Paragon stops being special because it is not relatively strong anymore.
Logged

Ed

  • Captain
  • ****
  • Posts: 438
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6863 on: October 17, 2020, 10:10:27 AM »

Trying to make a hullmod that increases range of modules on a ship

Code
        List<ShipAPI> children = ship.getChildModulesCopy();
        if(children != null && !children.isEmpty()) {
        for (ShipAPI module : children) {
        module.getMutableStats().getBallisticWeaponRangeBonus().modifyMult(id, 1 + RANGE_MULT);
        }
        }

Does not work when put in applyEffectsAfterShipCreation, but does in advanceInCombat

I don't want it in advanceInCombat because it becomes more combat bloat, how to fix it? using customdata to make it run once also doesn't help because the game still has to check for the custom value and in the end also becomes bloat
Logged
Check out my ships

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 17257
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6864 on: October 17, 2020, 03:45:43 PM »

Well, the game handles this sort of thing by putting the hullmod on all the modules. See for example the "Targeting Supercomputer" that stations have, which is built into every station module that has guns, etc.
Logged

Ed

  • Captain
  • ****
  • Posts: 438
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6865 on: October 17, 2020, 08:00:48 PM »

Well, the game handles this sort of thing by putting the hullmod on all the modules. See for example the "Targeting Supercomputer" that stations have, which is built into every station module that has guns, etc.
I want to reuse the modules on different ships, and not all of them will have this hullmod
Logged
Check out my ships

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 17257
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6866 on: October 17, 2020, 08:13:10 PM »

Hmm - then you can either:
1) Use the advanceInCombat() method, which will have minimal impact if, say, you set a flag once you've applied the stats change and check this flag and exit out early, or
2) Make multiple variants of these modules

Ah, I see you said this regarding #1:
I don't want it in advanceInCombat because it becomes more combat bloat, how to fix it? using customdata to make it run once also doesn't help because the game still has to check for the custom value and in the end also becomes bloat

If you just put a boolean into customdata and check if it's present, that's nothing to be concerned about at all unless you're doing it thousands of times (or perhaps considerably more) every frame. A single check like that, you really, really don't need to worry about! That's pretty much a standard approach to "not doing things".
Logged

Histidine

  • Admiral
  • *****
  • Posts: 2822
    • View Profile
    • Bitbucket profile
    • Email
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6867 on: October 17, 2020, 08:27:17 PM »

The hullmod could automatically propagate itself to the modules (and remove itself from modules if the parent hull no longer has it). A bit like how the Interferences modded hullmod automatically adds itself when needed.
Logged

shoi

  • Commander
  • ***
  • Posts: 159
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6868 on: October 20, 2020, 02:52:20 PM »

Code
				

for(DamagingProjectileAPI proj : explodingProjectiles)
{
if(interval2.intervalElapsed())
{
DamagingProjectileAPI newProj = (DamagingProjectileAPI)
engine.spawnProjectile(ship, null, "armaa_einhanderGunS",proj.getLocation(), shotAngle, proj.getVelocity());
engine.spawnProjectile(ship, null, "armaa_einhanderGunS",proj.getLocation(), shotAngle2, proj.getVelocity());
shotAngle+=30;
shotAngle2+=30;
}


if(proj.isFading())
{
toRemove.add(proj);

}
}

explodingProjectiles.removeAll(toRemove);

I have this running in a for loop for a list of projectiles.
So it spawns bullets in a certain pattern until it starts to fade, then I add it to another arraylist to be deleted once the loop ends. Once the projectile gets removed, the engine stops spawning bullets at its location.

BUT

if the projectile hits something first, it just spawns bullets endlessly. So clearly it isn't being removed from the array because it never faded. My question is, what can I evaluate to remove an "expired" bullet from the arraylist? I tried checking if proj == null to no success :(


fix:onHit script that just deletes bullet
« Last Edit: October 21, 2020, 01:38:39 AM by shoi »
Logged

shoi

  • Commander
  • ***
  • Posts: 159
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6869 on: October 21, 2020, 10:32:14 PM »

weapon.getCooldownRemaining() works fine normally, but when  I use it to check cooldown time is 0 on something under some type of time mod (say temporal shell) it starts firing off inconsistently. Is there something extra I need to do for those cases?
Logged
Pages: 1 ... 456 457 [458] 459 460 ... 462