Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Pages: 1 ... 201 202 [203] 204 205 ... 710

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

Nick XR

  • Admiral
  • *****
  • Posts: 713
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3030 on: February 01, 2017, 09:48:29 AM »

So I can't figure out how to render a simple sprite during combat.  Hopefully this is the dumbest I'll feel all day. :)

I have a simple 20x20 pixel sprite, I'm just trying to get it to show up anywhere on the screen and I can't.  I've verified through logging that the sprite is loaded correctly and the call to SpriteAPI.renderAtCenter is being called.

Code: java
    public static void tryRendering(){
        renderSprite(new Vector2f(0, 0));
        renderSprite(Global.getCombatEngine().getViewport().getCenter());
        renderSprite(ShipAPI.getLocation());
    }

    public static void renderSprite(Vector2f location) {
        SpriteAPI sprite = Global.getSettings().getSprite("misc", "CoOp_Ready");
        sprite.renderAtCenter(location.x, location.y);
    }

I've looked at some other code that is rendering stuff and the above looks more or less the same so I must be missing something obvious...

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24114
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3031 on: February 01, 2017, 10:28:30 AM »

Where you're calling this code from is the important bit. It should probably be from either in EveryFrameCombatPlugin.renderInWorldCoords() or EveryFrameCombatPlugin.renderInUICoords().
Logged

Nick XR

  • Admiral
  • *****
  • Posts: 713
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3032 on: February 01, 2017, 10:48:09 AM »

Ah, OK.  A lot of things just clicked into place.

I was trying to call it in ShipAIPlugin.advance(). I had made calls to GL11 from there without issue so I just assumed other graphics calls would work.

Thanks!

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24114
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3033 on: February 01, 2017, 10:54:07 AM »

Cool! (In theory, you could also render from where you're trying to, but you'd have to set up the glViewport etc to match what the game is doing, where if you do it in the aforementioned functions, that's already set up for you.)
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 #3034 on: February 01, 2017, 09:17:40 PM »

Quick question on the U.I display for deployment cost.

Am I interpreting it correctly? It doesn't seem to correctly display the proper algorithm for determining the actual deployment cost from "ships.csv"

It should take the ratio of the CR% recovered per day and the CR% per deployment and multiply that by the number in the supplies/rec column.
Instead it seems to only display that number. Really confusing to the player if the CR% per deployment and CR% rec per day are not exactly the same.

I have also "verified"* that it correctly uses the former algorithm in the actual campaign cost of supplies per deployment though. So one of the two is off it seems.



* loosely through seeing supplies drain far faster or slower than the "-x/day" number would indicate.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24114
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3035 on: February 01, 2017, 09:21:46 PM »

Supplies/rec is "supplies to recover from deployment". So for example if a ship costs 20% to deploy and recovers 5% per day, and its recovery cost is 10 supplies, it'll cost 10 supplies to recover 20% over 4 days. If you change the recovery per day to 10%, it'll cost 10 supplies to recover 20% over 2 days.

So it just gives you the main number, the actual cost, upfront, regardless of how many days it's spread out over.
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 #3036 on: February 02, 2017, 12:37:41 AM »

So it just gives you the main number, the actual cost, upfront, regardless of how many days it's spread out over.

Ah thanks! Thought that could be it, but something had me under the opinion it didn't "work" like that in practice.

Ill edit the numbers based upon that and that should fix it.
Logged

Nick XR

  • Admiral
  • *****
  • Posts: 713
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3037 on: February 05, 2017, 11:06:20 PM »

I'm trying to get the "burst size" value stored in weapon_data.csv.  I have a WeaponAPI object (and it's DerivedWeaponStatsAPI) but I'm unable to derive burstSize from using DerivedWeaponStatsAPI.getBurstFireDuration()/DerivedWeaponStatsAPI.getRoF() as it appears RoF takes into account weapon cooldown after shooting.

Thanks!

aZmoDen

  • Ensign
  • *
  • Posts: 15
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3038 on: February 05, 2017, 11:54:02 PM »

Ive made a few hull mods, and was wondering if the ai is free to use them?
If they can is there any way to restrict their use or limit them to factions?
thanks in advance for any answers!
az.
Logged

Histidine

  • Admiral
  • *****
  • Posts: 4682
    • View Profile
    • GitHub profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3039 on: February 06, 2017, 02:49:38 AM »

Ive made a few hull mods, and was wondering if the ai is free to use them?
If they can is there any way to restrict their use or limit them to factions?
By default AI ships will only use the variants specified in their faction files. So an AI faction will only use a hullmod to the extent that it exists on variants the fleet factory picks for its fleets.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24114
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3040 on: February 06, 2017, 09:16:23 AM »

I'm trying to get the "burst size" value stored in weapon_data.csv.  I have a WeaponAPI object (and it's DerivedWeaponStatsAPI) but I'm unable to derive burstSize from using DerivedWeaponStatsAPI.getBurstFireDuration()/DerivedWeaponStatsAPI.getRoF() as it appears RoF takes into account weapon cooldown after shooting.

Thanks!

WeaponAPI.getSpec(), which returns WeaponSpecAPI, which you can call .getBurstSize() on - or is that not in the current release?
Logged

Nick XR

  • Admiral
  • *****
  • Posts: 713
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3041 on: February 06, 2017, 11:51:11 AM »

I'm trying to get the "burst size" value stored in weapon_data.csv.  I have a WeaponAPI object (and it's DerivedWeaponStatsAPI) but I'm unable to derive burstSize from using DerivedWeaponStatsAPI.getBurstFireDuration()/DerivedWeaponStatsAPI.getRoF() as it appears RoF takes into account weapon cooldown after shooting.

Thanks!

WeaponAPI.getSpec(), which returns WeaponSpecAPI, which you can call .getBurstSize() on - or is that not in the current release?

Nope, not in .72a. One more reason to be hyped for .8!! :)

Thanks!

Toxcity

  • Admiral
  • *****
  • Posts: 561
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3042 on: February 09, 2017, 09:54:48 AM »

Is there anyway to reduce the flux cost of a weapon by a flat amount?

The WeaponFluxCostMod() methods work, but are a bit wonky; they can reduce the weapon flux cost below 0, and don't really work with weapons that have a charge up time.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24114
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3043 on: February 09, 2017, 10:43:51 AM »

The way you're trying to do it would be the way to do it, and if that doesn't work, then nothing else comes to mind.
Logged

Machine

  • Commander
  • ***
  • Posts: 114
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3044 on: February 17, 2017, 09:30:40 PM »

The following code is part of a hullmod, it is meant to change the ship's shield color as an indicator of its presence. It currently works, and so does the ship system check, so the shield properly changes to the purple color of an active fortress shield.

After the system is turned off, the ship resumes its new red shield color, however it does so instantly, unlike the fortress shield gradual shift in color, and I have no idea how to achieve something similar.
 
Spoiler
Code
        public void advanceInCombat(ShipAPI ship, float amount)  {
                if ((!ship.getSystem().isActive()) && ((ship.getSystem().getId()!="TSC_RamDrive_System") || (ship.getSystem().getId()!="fortressshield"))) {
                    ship.getShield().setInnerColor(new Color (255,85,25,75));
                    ship.getShield().setRingColor(new Color (215,165,100,255));
                }
        }
[close]
Logged
Pages: 1 ... 201 202 [203] 204 205 ... 710