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: Anubis-class Cruiser (12/20/24)

Pages: 1 ... 86 87 [88] 89 90 ... 752

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

Talkie Toaster

  • Captain
  • ****
  • Posts: 261
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #1305 on: January 31, 2014, 11:19:44 AM »

Ah, ok - that's pretty much how I'd do it, yeah. You don't really need to involve the PluginPick, though, could just retrieve the data directly from within the BCP.

The BCC could stand to have a generic map of stuff you could use to pass things like that around, but since it doesn't, this slightly-roundabout way is the best way to go.

You *could* also use a static variable somewhere, but I'd recommend against it - if you're putting references to fleet members and such there, there's a good chance of causing a memory leak when a different save is loaded.
Ah, okay then- thanks.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 25011
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #1306 on: January 31, 2014, 11:38:48 AM »

Yeah, I figure a simple version wouldn't be too bad.  Then again, writing a simple AI wasn't too bad, either- it was the polish that was hard; your AI does a heck of a lot of stuff, and the game's more-or-less built around that stuff. 

Just trying to get this release-ready so that people can chew on the first bits, y'know :)

Yeah, makes sense. Don't want to do everything all at once.
Logged

Xalendi

  • Commander
  • ***
  • Posts: 198
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #1307 on: January 31, 2014, 01:37:38 PM »

Ok, trying to create blinking running lights for my ship, and run into this error:
Spoiler
Code
43688 [Thread-11] ERROR com.fs.graphics.o0oO  - Error loading [graphics/weapons/decorative/lights/stormlights_00.png] resource, not found in [C:\Program Files\Fractal Softworks\Starsector\starsector-core\..\mods\Eloi,../starfarer.res/res,CLASSPATH]
java.lang.RuntimeException: Error loading [graphics/weapons/decorative/lights/stormlights_00.png] resource, not found in [C:\Program Files\Fractal Softworks\Starsector\starsector-core\..\mods\Eloi,../starfarer.res/res,CLASSPATH]
at com.fs.util.Object.Ò00000(Unknown Source)
at com.fs.util.Object.Ó00000(Unknown Source)
at com.fs.graphics.o0oO.String(Unknown Source)
at com.fs.graphics.o0oO.Ò00000(Unknown Source)
at com.fs.graphics.o0oO$1.run(Unknown Source)
at java.lang.Thread.run(Thread.java:619)
43703 [Thread-6] INFO  sound.Sound  - Loading sound [sounds/sfx_impacts/gun_hit_glancing_01.ogg]
43703 [Thread-11] ERROR com.fs.graphics.o0oO  - Error loading [graphics/weapons/decorative/lights/stormlights_00.png] resource, not found in [C:\Program Files\Fractal Softworks\Starsector\starsector-core\..\mods\Eloi,../starfarer.res/res,CLASSPATH]
java.lang.RuntimeException: Error loading [graphics/weapons/decorative/lights/stormlights_00.png] resource, not found in [C:\Program Files\Fractal Softworks\Starsector\starsector-core\..\mods\Eloi,../starfarer.res/res,CLASSPATH]
at com.fs.util.Object.Ò00000(Unknown Source)
at com.fs.util.Object.Ó00000(Unknown Source)
at com.fs.graphics.o0oO.String(Unknown Source)
at com.fs.graphics.o0oO.Ò00000(Unknown Source)
at com.fs.graphics.o0oO$1.run(Unknown Source)
at java.lang.Thread.run(Thread.java:619)
43703 [Thread-11] ERROR com.fs.graphics.o0oO  - Error loading [graphics/weapons/decorative/lights/stormlights_01.png] resource, not found in [C:\Program Files\Fractal Softworks\Starsector\starsector-core\..\mods\Eloi,../starfarer.res/res,CLASSPATH]
java.lang.RuntimeException: Error loading [graphics/weapons/decorative/lights/stormlights_01.png] resource, not found in [C:\Program Files\Fractal Softworks\Starsector\starsector-core\..\mods\Eloi,../starfarer.res/res,CLASSPATH]
at com.fs.util.Object.Ò00000(Unknown Source)
at com.fs.util.Object.Ó00000(Unknown Source)
at com.fs.graphics.o0oO.String(Unknown Source)
at com.fs.graphics.o0oO.Ò00000(Unknown Source)
at com.fs.graphics.o0oO$1.run(Unknown Source)
at java.lang.Thread.run(Thread.java:619)
43703 [Thread-11] ERROR com.fs.graphics.o0oO  - Error loading [graphics/weapons/decorative/lights/stormlights_01.png] resource, not found in [C:\Program Files\Fractal Softworks\Starsector\starsector-core\..\mods\Eloi,../starfarer.res/res,CLASSPATH]
java.lang.RuntimeException: Error loading [graphics/weapons/decorative/lights/stormlights_01.png] resource, not found in [C:\Program Files\Fractal Softworks\Starsector\starsector-core\..\mods\Eloi,../starfarer.res/res,CLASSPATH]
at com.fs.util.Object.Ò00000(Unknown Source)
at com.fs.util.Object.Ó00000(Unknown Source)
at com.fs.graphics.o0oO.String(Unknown Source)
at com.fs.graphics.o0oO.Ò00000(Unknown Source)
at com.fs.graphics.o0oO$1.run(Unknown Source)
at java.lang.Thread.run(Thread.java:619)
43703 [Thread-11] ERROR com.fs.graphics.o0oO  - Error loading [graphics/weapons/decorative/lights/stormlights_02.png] resource, not found in [C:\Program Files\Fractal Softworks\Starsector\starsector-core\..\mods\Eloi,../starfarer.res/res,CLASSPATH]
java.lang.RuntimeException: Error loading [graphics/weapons/decorative/lights/stormlights_02.png] resource, not found in [C:\Program Files\Fractal Softworks\Starsector\starsector-core\..\mods\Eloi,../starfarer.res/res,CLASSPATH]
at com.fs.util.Object.Ò00000(Unknown Source)
at com.fs.util.Object.Ó00000(Unknown Source)
at com.fs.graphics.o0oO.String(Unknown Source)
at com.fs.graphics.o0oO.Ò00000(Unknown Source)
at com.fs.graphics.o0oO$1.run(Unknown Source)
at java.lang.Thread.run(Thread.java:619)
43703 [Thread-11] ERROR com.fs.graphics.o0oO  - Error loading [graphics/weapons/decorative/lights/stormlights_02.png] resource, not found in [C:\Program Files\Fractal Softworks\Starsector\starsector-core\..\mods\Eloi,../starfarer.res/res,CLASSPATH]
java.lang.RuntimeException: Error loading [graphics/weapons/decorative/lights/stormlights_02.png] resource, not found in [C:\Program Files\Fractal Softworks\Starsector\starsector-core\..\mods\Eloi,../starfarer.res/res,CLASSPATH]
at com.fs.util.Object.Ò00000(Unknown Source)
at com.fs.util.Object.Ó00000(Unknown Source)
at com.fs.graphics.o0oO.String(Unknown Source)
at com.fs.graphics.o0oO.Ò00000(Unknown Source)
at com.fs.graphics.o0oO$1.run(Unknown Source)
at java.lang.Thread.run(Thread.java:619)
43703 [Thread-11] ERROR com.fs.graphics.o0oO  - Error loading [graphics/weapons/decorative/lights/stormlights_03.png] resource, not found in [C:\Program Files\Fractal Softworks\Starsector\starsector-core\..\mods\Eloi,../starfarer.res/res,CLASSPATH]
java.lang.RuntimeException: Error loading [graphics/weapons/decorative/lights/stormlights_03.png] resource, not found in [C:\Program Files\Fractal Softworks\Starsector\starsector-core\..\mods\Eloi,../starfarer.res/res,CLASSPATH]
at com.fs.util.Object.Ò00000(Unknown Source)
at com.fs.util.Object.Ó00000(Unknown Source)
at com.fs.graphics.o0oO.String(Unknown Source)
at com.fs.graphics.o0oO.Ò00000(Unknown Source)
at com.fs.graphics.o0oO$1.run(Unknown Source)
at java.lang.Thread.run(Thread.java:619)
43703 [Thread-11] ERROR com.fs.graphics.o0oO  - Error loading [graphics/weapons/decorative/lights/stormlights_03.png] resource, not found in [C:\Program Files\Fractal Softworks\Starsector\starsector-core\..\mods\Eloi,../starfarer.res/res,CLASSPATH]
java.lang.RuntimeException: Error loading [graphics/weapons/decorative/lights/stormlights_03.png] resource, not found in [C:\Program Files\Fractal Softworks\Starsector\starsector-core\..\mods\Eloi,../starfarer.res/res,CLASSPATH]
at com.fs.util.Object.Ò00000(Unknown Source)
at com.fs.util.Object.Ó00000(Unknown Source)
at com.fs.graphics.o0oO.String(Unknown Source)
at com.fs.graphics.o0oO.Ò00000(Unknown Source)
at com.fs.graphics.o0oO$1.run(Unknown Source)
at java.lang.Thread.run(Thread.java:619)
43703 [Thread-11] ERROR com.fs.graphics.o0oO  - Error loading [graphics/weapons/decorative/lights/stormlights_04.png] resource, not found in [C:\Program Files\Fractal Softworks\Starsector\starsector-core\..\mods\Eloi,../starfarer.res/res,CLASSPATH]
java.lang.RuntimeException: Error loading [graphics/weapons/decorative/lights/stormlights_04.png] resource, not found in [C:\Program Files\Fractal Softworks\Starsector\starsector-core\..\mods\Eloi,../starfarer.res/res,CLASSPATH]
at com.fs.util.Object.Ò00000(Unknown Source)
at com.fs.util.Object.Ó00000(Unknown Source)
at com.fs.graphics.o0oO.String(Unknown Source)
at com.fs.graphics.o0oO.Ò00000(Unknown Source)
at com.fs.graphics.o0oO$1.run(Unknown Source)
at java.lang.Thread.run(Thread.java:619)
43703 [Thread-11] ERROR com.fs.graphics.o0oO  - Error loading [graphics/weapons/decorative/lights/stormlights_04.png] resource, not found in [C:\Program Files\Fractal Softworks\Starsector\starsector-core\..\mods\Eloi,../starfarer.res/res,CLASSPATH]
java.lang.RuntimeException: Error loading [graphics/weapons/decorative/lights/stormlights_04.png] resource, not found in [C:\Program Files\Fractal Softworks\Starsector\starsector-core\..\mods\Eloi,../starfarer.res/res,CLASSPATH]
at com.fs.util.Object.Ò00000(Unknown Source)
at com.fs.util.Object.Ó00000(Unknown Source)
at com.fs.graphics.o0oO.String(Unknown Source)
at com.fs.graphics.o0oO.Ò00000(Unknown Source)
at com.fs.graphics.o0oO$1.run(Unknown Source)
at java.lang.Thread.run(Thread.java:619)
43703 [Thread-11] ERROR com.fs.graphics.o0oO  - Error loading [graphics/weapons/decorative/lights/stormlights_05.png] resource, not found in [C:\Program Files\Fractal Softworks\Starsector\starsector-core\..\mods\Eloi,../starfarer.res/res,CLASSPATH]
java.lang.RuntimeException: Error loading [graphics/weapons/decorative/lights/stormlights_05.png] resource, not found in [C:\Program Files\Fractal Softworks\Starsector\starsector-core\..\mods\Eloi,../starfarer.res/res,CLASSPATH]
at com.fs.util.Object.Ò00000(Unknown Source)
at com.fs.util.Object.Ó00000(Unknown Source)
at com.fs.graphics.o0oO.String(Unknown Source)
at com.fs.graphics.o0oO.Ò00000(Unknown Source)
at com.fs.graphics.o0oO$1.run(Unknown Source)
at java.lang.Thread.run(Thread.java:619)
43703 [Thread-11] ERROR com.fs.graphics.o0oO  - Error loading [graphics/weapons/decorative/lights/stormlights_05.png] resource, not found in [C:\Program Files\Fractal Softworks\Starsector\starsector-core\..\mods\Eloi,../starfarer.res/res,CLASSPATH]
java.lang.RuntimeException: Error loading [graphics/weapons/decorative/lights/stormlights_05.png] resource, not found in [C:\Program Files\Fractal Softworks\Starsector\starsector-core\..\mods\Eloi,../starfarer.res/res,CLASSPATH]
at com.fs.util.Object.Ò00000(Unknown Source)
at com.fs.util.Object.Ó00000(Unknown Source)
at com.fs.graphics.o0oO.String(Unknown Source)
at com.fs.graphics.o0oO.Ò00000(Unknown Source)
at com.fs.graphics.o0oO$1.run(Unknown Source)
at java.lang.Thread.run(Thread.java:619)
43703 [Thread-11] ERROR com.fs.graphics.o0oO  - Error loading [graphics/weapons/decorative/lights/stormlights_06.png] resource, not found in [C:\Program Files\Fractal Softworks\Starsector\starsector-core\..\mods\Eloi,../starfarer.res/res,CLASSPATH]
java.lang.RuntimeException: Error loading [graphics/weapons/decorative/lights/stormlights_06.png] resource, not found in [C:\Program Files\Fractal Softworks\Starsector\starsector-core\..\mods\Eloi,../starfarer.res/res,CLASSPATH]
at com.fs.util.Object.Ò00000(Unknown Source)
at com.fs.util.Object.Ó00000(Unknown Source)
at com.fs.graphics.o0oO.String(Unknown Source)
at com.fs.graphics.o0oO.Ò00000(Unknown Source)
at com.fs.graphics.o0oO$1.run(Unknown Source)
at java.lang.Thread.run(Thread.java:619)
43703 [Thread-11] ERROR com.fs.graphics.o0oO  - Error loading [graphics/weapons/decorative/lights/stormlights_06.png] resource, not found in [C:\Program Files\Fractal Softworks\Starsector\starsector-core\..\mods\Eloi,../starfarer.res/res,CLASSPATH]
java.lang.RuntimeException: Error loading [graphics/weapons/decorative/lights/stormlights_06.png] resource, not found in [C:\Program Files\Fractal Softworks\Starsector\starsector-core\..\mods\Eloi,../starfarer.res/res,CLASSPATH]
at com.fs.util.Object.Ò00000(Unknown Source)
at com.fs.util.Object.Ó00000(Unknown Source)
at com.fs.graphics.o0oO.String(Unknown Source)
at com.fs.graphics.o0oO.Ò00000(Unknown Source)
at com.fs.graphics.o0oO$1.run(Unknown Source)
at java.lang.Thread.run(Thread.java:619)
43703 [Thread-11] ERROR com.fs.graphics.o0oO  - Error loading [graphics/weapons/decorative/lights/stormlights_07.png] resource, not found in [C:\Program Files\Fractal Softworks\Starsector\starsector-core\..\mods\Eloi,../starfarer.res/res,CLASSPATH]
java.lang.RuntimeException: Error loading [graphics/weapons/decorative/lights/stormlights_07.png] resource, not found in [C:\Program Files\Fractal Softworks\Starsector\starsector-core\..\mods\Eloi,../starfarer.res/res,CLASSPATH]
at com.fs.util.Object.Ò00000(Unknown Source)
at com.fs.util.Object.Ó00000(Unknown Source)
at com.fs.graphics.o0oO.String(Unknown Source)
at com.fs.graphics.o0oO.Ò00000(Unknown Source)
at com.fs.graphics.o0oO$1.run(Unknown Source)
at java.lang.Thread.run(Thread.java:619)
43703 [Thread-11] ERROR com.fs.graphics.o0oO  - Error loading [graphics/weapons/decorative/lights/stormlights_07.png] resource, not found in [C:\Program Files\Fractal Softworks\Starsector\starsector-core\..\mods\Eloi,../starfarer.res/res,CLASSPATH]
java.lang.RuntimeException: Error loading [graphics/weapons/decorative/lights/stormlights_07.png] resource, not found in [C:\Program Files\Fractal Softworks\Starsector\starsector-core\..\mods\Eloi,../starfarer.res/res,CLASSPATH]
at com.fs.util.Object.Ò00000(Unknown Source)
at com.fs.util.Object.Ó00000(Unknown Source)
at com.fs.graphics.o0oO.String(Unknown Source)
at com.fs.graphics.o0oO.Ò00000(Unknown Source)
at com.fs.graphics.o0oO$1.run(Unknown Source)
at java.lang.Thread.run(Thread.java:619)
43719 [Thread-6] INFO  sound.Sound  - Loading sound [sounds/sfx_impacts/gun_hit_glancing_02.ogg]
43719 [Thread-11] ERROR com.fs.graphics.o0oO  - Error loading [graphics/weapons/decorative/lights/stormlights_08.png] resource, not found in [C:\Program Files\Fractal Softworks\Starsector\starsector-core\..\mods\Eloi,../starfarer.res/res,CLASSPATH]
java.lang.RuntimeException: Error loading [graphics/weapons/decorative/lights/stormlights_08.png] resource, not found in [C:\Program Files\Fractal Softworks\Starsector\starsector-core\..\mods\Eloi,../starfarer.res/res,CLASSPATH]
at com.fs.util.Object.Ò00000(Unknown Source)
at com.fs.util.Object.Ó00000(Unknown Source)
at com.fs.graphics.o0oO.String(Unknown Source)
at com.fs.graphics.o0oO.Ò00000(Unknown Source)
at com.fs.graphics.o0oO$1.run(Unknown Source)
at java.lang.Thread.run(Thread.java:619)
43719 [Thread-11] ERROR com.fs.graphics.o0oO  - Error loading [graphics/weapons/decorative/lights/stormlights_08.png] resource, not found in [C:\Program Files\Fractal Softworks\Starsector\starsector-core\..\mods\Eloi,../starfarer.res/res,CLASSPATH]
java.lang.RuntimeException: Error loading [graphics/weapons/decorative/lights/stormlights_08.png] resource, not found in [C:\Program Files\Fractal Softworks\Starsector\starsector-core\..\mods\Eloi,../starfarer.res/res,CLASSPATH]
at com.fs.util.Object.Ò00000(Unknown Source)
at com.fs.util.Object.Ó00000(Unknown Source)
at com.fs.graphics.o0oO.String(Unknown Source)
at com.fs.graphics.o0oO.Ò00000(Unknown Source)
at com.fs.graphics.o0oO$1.run(Unknown Source)
at java.lang.Thread.run(Thread.java:619)
[close]

...the hell? I didn't tell it to look in the main game files. It should be looking in the mod folder...

Also, how do I tell my ship to use the lights? There doesn't seem to be a '"stormlights.wpn" goes in this Decorative Slot' option in the editor, or the Hull file

Don't suppose anyone knows how this happened? Sorry for being impatient.
Logged

xenoargh

  • Admiral
  • *****
  • Posts: 5078
  • naively breaking things!
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #1308 on: January 31, 2014, 04:10:57 PM »

It is looking in the mod folder:

Code
C:\Program Files\Fractal Softworks\Starsector\starsector-core\..\mods\Eloi,../starfarer.res/res,CLASSPATH

And it's probably borking becaue you haven't used the right naming conventions- animated weapons need to use 00, 01 etc. at the end of their names, to designate which frame they are.

Lastly, "stormlights.wpn" needs to be weapon_data.csv, like any other weapon.  Then in the editor, you need to set it up with a DECORATIVE BUILT_IN type slot and you'll see it.
Logged
Please check out my SS projects :)
Xeno's Mod Pack

Xalendi

  • Commander
  • ***
  • Posts: 198
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #1309 on: January 31, 2014, 05:21:40 PM »

Thanks. Between you and MesoTronik, I think I know where I've gone wrong. Thanks!
Logged

Arumac

  • Lieutenant
  • **
  • Posts: 98
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #1310 on: February 02, 2014, 02:24:42 PM »

Quick question. Is there an on hit/impact sound for projectiles. I have a projectile that will either explode, or use xenoargh's heat projectile onhit script. I know how to set explosion SFX, however I'm not sure how to apply a different sound for when the projectile hits something without exploding (triggering the heat script).
Logged

Debido

  • Admiral
  • *****
  • Posts: 1183
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #1311 on: February 02, 2014, 04:52:09 PM »

I've been looking at the engine contrail, and editing the engine_styles.json file etc.

The end effect I want is something like the 'tron' cycles or the oldy Homeworld ship trails aka

Spoiler
[close]

I can get the 'exhaust' to be stationary by setting the "contrailMaxSpeedMult":0f,

Also for me to change the engine glow I needed to replace the engineglow32/s.png file, which then affects all using that engine glow.

How do I set my own style where I can specify my own engine glow and contrail FX files?
Logged

Gotcha!

  • Admiral
  • *****
  • Posts: 1124
    • View Profile
    • Welcome to New Hiigara
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #1313 on: February 02, 2014, 05:18:15 PM »

...you will be my hero.

And mine too, for obvious reasons. ;D
Logged
  

Debido

  • Admiral
  • *****
  • Posts: 1183
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #1314 on: February 02, 2014, 05:51:34 PM »

I have to be honest I'm more of a fan of the Homeworld type contrail. The Tron contrail has not jitter, without that little bit of occasional jitter you get a straight line and you lose the sense of speed a bit. If you have jitter within the stream you get slight variation that human brain then interprets as 'movement'.

I'm thinking I'm going to have to get a lot of help from Xenoargh on this matter. He's done some cool polishing of the projectiles sprites.
Logged

MShadowy

  • Admiral
  • *****
  • Posts: 911
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #1315 on: February 02, 2014, 06:48:53 PM »

I definitely have to second favoring the Homeworld style contrails, they have a much more organic and pleasing aesthetic to them in my opinion.  I suspect it might be spoofable through using decorative weapon slots in place of the regular engines and having it leave behind a particle trail if the ship happens to be moving, though that would not be the ideal solution I suspect.

In any case, I also have a question.  I can't quite get this code to work for the replacement Pandora; the intended effect is intended to be a kind of "lightning shotgun."  Unfortunately I can't figure out how to get it to implement the override that needs to be done, so it crashes at runtime.

Spoiler
Code
package data.scripts.plugins;

import com.fs.starfarer.api.Global;
import com.fs.starfarer.api.combat.CombatEngineAPI;
import com.fs.starfarer.api.combat.CombatEntityAPI;
import com.fs.starfarer.api.combat.BeamEffectPlugin;
import com.fs.starfarer.api.combat.DamageType;
import com.fs.starfarer.api.combat.EveryFrameCombatPlugin;
import com.fs.starfarer.api.combat.EveryFrameWeaponEffectPlugin;
import com.fs.starfarer.api.combat.OnHitEffectPlugin;
import com.fs.starfarer.api.combat.ShipAPI;
import com.fs.starfarer.api.combat.WeaponAPI;
import com.fs.starfarer.api.util.IntervalUtil;
import java.awt.Color;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import org.lazywizard.lazylib.CollisionUtils;
import org.lazywizard.lazylib.MathUtils;
import org.lazywizard.lazylib.combat.CombatUtils;
import org.lwjgl.util.vector.Vector2f;

public class PandoraZapMaster implements BeamEffectPlugin, EveryFrameWeaponEffectPlugin
{
    private static float maxTargs = 6f;
    private static float RANGE = 1000f;
    private static float ANGLE = 60f;
    private static float dam = 250f;
    private static float emp = 0f;
    private IntervalUtil fireInterval = new IntervalUtil(0.3f, 0.4f);
    private static final float EMITTER_THICKNESS = 24f;
    private static final Color EMITTER_FRINGE = new Color(125,155,115,150);
    private static final Color EMITTER_CORE = new Color(165,215,145,255);
    private CombatEntityAPI activeArc = null;
   
    @Override
    public void advance(float amount, CombatEngineAPI engine, WeaponAPI emitter)
    {
        if (activeArc != null) {
            if (!engine.isEntityInPlay(activeArc)) {
                activeArc = null;
            }
}
       
        ShipAPI ship;
        ShipAPI attacker = emitter.getShip();
       
        WeaponAPI weapon;
       
        for (Iterator iter = Global.getCombatEngine().getShips().iterator(); iter.hasNext();) {           
            ship = (ShipAPI) iter.next(); //Loads the current ship the iterator is on into 'ship'
           
            if (ship == attacker) continue; //No point in counting the firing ship, so skip it
            //check if the ship is in an arc surrounding the weapons facing - TODO
           
            for (int x = 0; x < maxTargs; x++) {
                if (emitter.isFiring() && (MathUtils.getDistance(ship, attacker) <= (RANGE))) { 
                    //spawn emp arcs from the weapon to the target ship(s) and apply damage
                    if (ship != null && ship instanceof ShipAPI) {
                        fireInterval.advance(amount);
                        if (fireInterval.intervalElapsed()) {
                            activeArc = engine.spawnEmpArc(emitter.getShip(), emitter.getLocation(),
                            emitter.getShip(), activeArc, DamageType.ENERGY, dam, emp, RANGE, null,
                            EMITTER_THICKNESS, EMITTER_FRINGE, EMITTER_CORE);
                        }
                    }
                    //apply some fuzzy maths so that the emp arcs aren't all hitting the same point - TODO
                   
                }
            }
        }
       
    }

}
[close]

Some of the packages being loaded aren't necessary I realize but I'll trim the imports when I've got things finalized.  The other thing I need to do is figure out how to implement the new ship system (an engine jammer) but I figure that that can wait until I get to it.
« Last Edit: February 02, 2014, 09:43:54 PM by MShadowy »
Logged

Debido

  • Admiral
  • *****
  • Posts: 1183
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #1316 on: February 02, 2014, 07:05:25 PM »

It's easy to get a long contrail, but I don't seem to be editing the right contrail file or something (though there is only one). Also it looks like the default behavior for the contrail is to apply some sort of Gaussian blur, so I can't get that hard defined edge between the main 'core' and the thin 'transparent outer layer'.

The next thing is the engine that spawns the 'contrail' particle is heavily dependent on the speed. So if you go to fast you can breaks in the contrail...making it look awful. Not sure, need better information on this. Currently stabbing away in the dark.
Logged

Sundog

  • Admiral
  • *****
  • Posts: 1779
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #1317 on: February 02, 2014, 10:44:23 PM »

Is it possible for a missile to use "behaviorSpec":{"behavior":"PROXIMITY_FUSE", ... } like the flak cannon? I haven't been able to get it to work, but I might just be missing something. Is there an example somewhere?

@McShadowy: The problem with your script is that the third argument of advance needs to be a BeamAPI rather than a WeaponAPI.

Tecrys

  • Admiral
  • *****
  • Posts: 609
  • repair that space elevator!
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #1318 on: February 04, 2014, 12:06:00 PM »

I've got a little question here: I want to have an onhit effect for a weapon that heals hull and armor of the ship which fired the weapon.
I have no idea of coding but if anyone could help me with this please I would be very thankful.
Logged
Symbiotic Void Creatures 0.5.0-alpha for 0.97a is out
https://fractalsoftworks.com/forum/index.php?topic=28010.0

Debido

  • Admiral
  • *****
  • Posts: 1183
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #1319 on: February 04, 2014, 12:09:54 PM »

Heal beam or healing projectile? Both?
Logged
Pages: 1 ... 86 87 [88] 89 90 ... 752