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 ... 6 7 [8] 9 10 ... 706

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

EnderNerdcore

  • Commander
  • ***
  • Posts: 172
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #105 on: January 12, 2013, 11:49:42 PM »

One more crazy one for tonight. I'm trying to create a ship system that benefits other ships in the fleet in a similar manner to battlefield objectives, such as raising weapon ranges, etc.

But I can't find a way to do it! It's easy to make it apply to the ship using the system, but the only idea I've had so far to use it with the fleet is by trying to invoke BattleObjectivesEffectsPlugin.

However, any attempt to actually use this in the system code results in a crash even just trying to enter the refit screen for the ship.

Am I missing something or is this currently not possible?
Logged

LazyWizard

  • Global Moderator
  • Admiral
  • *****
  • Posts: 1363
    • View Profile
    • GitHub Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #106 on: January 12, 2013, 11:56:43 PM »

It's possible, but you will need the current CombatEngineAPI to do it. Once you have the engine, you can use CombatEngineAPI's getShips(), then filter those with ShipAPI's getOwner().

The easiest/most reusable way to get at the current engine is to add something similar to the following script under data/scripts/plugins:
Code
package data.scripts.plugins;

import com.fs.starfarer.api.combat.CombatEngineAPI;
import com.fs.starfarer.api.combat.EveryFrameCombatPlugin;
import java.util.List;

public class CombatUtils implements EveryFrameCombatPlugin
{
    private static CombatEngineAPI engine;
    private static float combatTime = 0f;

    public static CombatEngineAPI getCombatEngine()
    {
        return engine;
    }

    public static float getElapsedCombatTime()
    {
        return combatTime;
    }

    @Override
    public void advance(float amount, List events)
    {
        combatTime += amount;
    }

    @Override
    public void init(CombatEngineAPI engine)
    {
        CombatUtils.engine = engine;
        CombatUtils.combatTime = 0f;
    }
}
Logged

MrDavidoff

  • Captain
  • ****
  • Posts: 398
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #107 on: January 13, 2013, 12:24:34 AM »

Hey guys,

this one will be really weird, but Ill go with it anyways...

Would it be possible to have a weapon, that would actually emit shield´, in fixed direction, of course.
( :P)



Logged

Romeo_One

  • Captain
  • ****
  • Posts: 393
  • "Let me do the german dance for you..."
    • View Profile
    • Rejection - The Fight for Unity
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #108 on: January 13, 2013, 12:36:30 AM »

Eh like an Omni shield?
Logged

MrDavidoff

  • Captain
  • ****
  • Posts: 398
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #109 on: January 13, 2013, 12:40:38 AM »

Eh like an Omni shield?


I better explain, what I need.

I wanted to create somesort of a shiled generator, that would be in fix pos. and cover
some part of the ship. (ship not having any vanila omni or front shields)

First I tried it with drones, that would act as seperateparts of the ship, however, they
are always "floating" a bit and ..just doesnt seem right.

Now, if a weapon would emit a ..i would suspect a front sheild, it would be much eaiser
and precise to put them on the ship - using weapon slots.. either make them hidden, built-in etc.

Logged

Okim

  • Admiral
  • *****
  • Posts: 2161
    • View Profile
    • Okim`s Modelling stuff
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #110 on: January 13, 2013, 03:30:39 AM »

With new decorative weapon type and ability to assign scripts i suppose you can do something like that. Look at shipAPI, shieldsAPI and weaponAPI files. There might be some clues.

MrDavidoff

  • Captain
  • ****
  • Posts: 398
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #111 on: January 13, 2013, 04:03:54 AM »

With new decorative weapon type and ability to assign scripts i suppose you can do something like that. Look at shipAPI, shieldsAPI and weaponAPI files. There might be some clues.

Ill look into it then :)

I would love to figure it out, but sadly i feel its outside my league, never messed with these files,
(saying ahead - chances of me making it work are slim, no promises here  :D )
Logged

Cycerin

  • Admiral
  • *****
  • Posts: 1665
  • beyond the infinite void
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #112 on: January 13, 2013, 07:13:44 AM »

Has anyone looked at what's possible with Weapon and Beam effects yet? Like, for instance a missile that does damage over time after impacting the enemy?
Logged

silentstormpt

  • Admiral
  • *****
  • Posts: 1060
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #113 on: January 13, 2013, 07:29:04 AM »

Has anyone looked at what's possible with Weapon and Beam effects yet? Like, for instance a missile that does damage over time after impacting the enemy?

This, not yet supported;

My turn to ask for something, is there a way to get the EXACT coords of weapons or/and ships, i've had huge issues grabbing points inside the bounds, even with the polygon methods on the library that lazy shared. This would be useful for a huge number of projects for every mod that now using decorative weapons or modified combat engines
« Last Edit: January 13, 2013, 09:00:05 AM by silentstormpt »
Logged

EnderNerdcore

  • Commander
  • ***
  • Posts: 172
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #114 on: January 13, 2013, 09:00:27 AM »

With new decorative weapon type and ability to assign scripts i suppose you can do something like that. Look at shipAPI, shieldsAPI and weaponAPI files. There might be some clues.

Ill look into it then :)

I would love to figure it out, but sadly i feel its outside my league, never messed with these files,
(saying ahead - chances of me making it work are slim, no promises here  :D )

Have you tried drones similar to the sensor drones on the Apogee, but making their accel & top speed values very high so that they are able to maintain position perfectly?
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23986
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #115 on: January 13, 2013, 10:03:35 AM »

Okay, thank you very much Alex, my bad.
I thought in missions ships where still associated with factions.
And yes in campaign mode it works properly.

Thank you again and sorry for wasting your time ;)

No problem, glad that's all it was :)

IS there anyway to make it so when a mirv splits it doesn't leave a crapload of particles behind?

Apparently, no - looking at that code, it's entirely hardcoded. Ugh. You know, it'd really help to have a list of "things that aren't moddable that would be nice to have be moddable" somewhere, as *I* don't tend to run into them, but you guys do. So something like this, shield colors/custom tech styles, etc. Not talking about something at the level of new features - just things that the engine clearly already does that just happen to not be exposed at all. Then I could just cherry-pick a few with each subsequent release and hopefully make a good dent in the list over time.
Logged

Wyvern

  • Admiral
  • *****
  • Posts: 3784
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #116 on: January 13, 2013, 10:06:59 AM »

Is there some easy way to mod the value of one flux capacitor?  I'm thinking in particular of Okim's Ironclads mod, where the original ship flux capacities & shield strengths were built around the old 100 flux per capacitor value - resulting in the current game making flux capacitors (arguably) "too good" relative to where they should be.
Logged
Wyvern is 100% correct about the math.

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23986
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #117 on: January 13, 2013, 10:12:45 AM »

Is there some easy way to mod the value of one flux capacitor?  I'm thinking in particular of Okim's Ironclads mod, where the original ship flux capacities & shield strengths were built around the old 100 flux per capacitor value - resulting in the current game making flux capacitors (arguably) "too good" relative to where they should be.

Also hardcoded - another great candidate for that list.
Logged

EnderNerdcore

  • Commander
  • ***
  • Posts: 172
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #118 on: January 13, 2013, 12:51:33 PM »

It's possible, but you will need the current CombatEngineAPI to do it. Once you have the engine, you can use CombatEngineAPI's getShips(), then filter those with ShipAPI's getOwner().

The easiest/most reusable way to get at the current engine is to add something similar to the following script under data/scripts/plugins:
Code
package data.scripts.plugins;

import com.fs.starfarer.api.combat.CombatEngineAPI;
import com.fs.starfarer.api.combat.EveryFrameCombatPlugin;
import java.util.List;

public class CombatUtils implements EveryFrameCombatPlugin
{
    private static CombatEngineAPI engine;
    private static float combatTime = 0f;

    public static CombatEngineAPI getCombatEngine()
    {
        return engine;
    }

    public static float getElapsedCombatTime()
    {
        return combatTime;
    }

    @Override
    public void advance(float amount, List events)
    {
        combatTime += amount;
    }

    @Override
    public void init(CombatEngineAPI engine)
    {
        CombatUtils.engine = engine;
        CombatUtils.combatTime = 0f;
    }
}
So question here. I tried to take a shortcut and simply call CombatEngineAPI:

Code
        public CombatEngineAPI engine;

However, it's always returning null (I know this because I nested a number of ifs to see what exactly I was getting a null pointer from, and it's this).
I was trying to keep all the code in this one java file, but it's looking like I might need to simply write the plugin file as you have there. Is this true, or is there some other way I can keep CombatEngineAPI from returning a null value?
Logged

LazyWizard

  • Global Moderator
  • Admiral
  • *****
  • Posts: 1363
    • View Profile
    • GitHub Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #119 on: January 13, 2013, 01:22:59 PM »

So question here. I tried to take a shortcut and simply call CombatEngineAPI:

Code
        public CombatEngineAPI engine;

However, it's always returning null (I know this because I nested a number of ifs to see what exactly I was getting a null pointer from, and it's this).
I was trying to keep all the code in this one java file, but it's looking like I might need to simply write the plugin file as you have there. Is this true, or is there some other way I can keep CombatEngineAPI from returning a null value?

All that line of code does is create an empty variable (if I wrote "public String warAndPeace;", I wouldn't automatically have the book's text assigned to that variable ;)). You need to get the engine the game is using, which is what the plugin does.
Logged
Pages: 1 ... 6 7 [8] 9 10 ... 706