Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Pages: 1 ... 56 57 [58] 59 60 ... 710

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

Zaphide

  • Admiral
  • *****
  • Posts: 799
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #855 on: September 22, 2013, 07:31:23 PM »

Well, I think you would just need to change the neutral check in OrbitalStationInteractionDialogPluginImpl to instead check the free transfer flag on the station in context (sorry I don't have code in front of me so I can't provide an example but 1 line change I think).

It does mean you'll need to mess around with jar's and so on.
Logged

Verrius

  • Captain
  • ****
  • Posts: 369
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #856 on: September 22, 2013, 07:39:18 PM »

I would think it was this:
Quote
void showCore(CoreUITabId tabId, SectorEntityToken other, boolean noCost, CoreInteractionListener listener);
Doing this:
Quote
visual.showCore(CoreUITabId.FLEET, station, true, this);
Doesn't do free transfers. Unless it's suppose to be false to do free transfers? Iunno, I won't be able to try until tomorrow anyway.

Note that the original looks like this:
Quote
visual.showCore(CoreUITabId.FLEET, station, station.getFaction().isNeutralFaction(), this);

Pretty important part of what I'm trying to do, just been kinda living with it up until this point so I'd like to get this figured out.

Zaphide

  • Admiral
  • *****
  • Posts: 799
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #857 on: September 22, 2013, 08:07:27 PM »

I would think it was this:
Quote
void showCore(CoreUITabId tabId, SectorEntityToken other, boolean noCost, CoreInteractionListener listener);
Doing this:
Quote
visual.showCore(CoreUITabId.FLEET, station, true, this);
Doesn't do free transfers. Unless it's suppose to be false to do free transfers? Iunno, I won't be able to try until tomorrow anyway.

Note that the original looks like this:
Quote
visual.showCore(CoreUITabId.FLEET, station, station.getFaction().isNeutralFaction(), this);

Pretty important part of what I'm trying to do, just been kinda living with it up until this point so I'd like to get this figured out.

Yeah that's it I think. I haven't played round with it much but I'm going to change that tonight to fix an issue. Will report back if successful :)

Also, in case anyone is interested, I'm using IntelliJ IDEA as my Java IDE and have set it up so only the dialogPlugins get compiled into a jar (which is then automatically deposited into the appropriate <mod>/jars directory). This does mean I still can't use generics/enums etc throughout the rest of the mod files but it does maintain that quick-edit functionality for everything other than the dialogPlugins. Although generics are great it's pretty easy to get by without them.

If anyone is making their own dialogPlugins I highly recommend an IDE :) I did try getting it going from the command prompt (prior to setting things up in IntelliJ) but is was pretty painful (I did learn a lot about jars though!).
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24116
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #858 on: September 22, 2013, 10:47:56 PM »

Huh, turns out the noCost parameter is actually completely ignored - I think that happened during the move to the new core UI. Added to list of things to fix. My bad :)
Logged

Erick Doe

  • Global Moderator
  • Admiral
  • *****
  • Posts: 2489
  • "Pretty cunning, don't you think?"
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #859 on: September 23, 2013, 06:04:06 AM »

How do I set faction relations in 0.6a?

I've tried with:

Quote
      FactionAPI zorg = sector.getFaction("Zorg");

      zorg.setRelationship("hegemony", -1);
      zorg.setRelationship("tritachyon", -1);
      zorg.setRelationship("pirates", -1);
      zorg.setRelationship("independent", -1);
      zorg.setRelationship("player", 0);

in ZorgGen.java

But that doesn't work anymore.


Also:
Working down a checklist. The Zorg mod's campaign is almost ready!

However, I ran into this issue while trying to have a custom image at a station:
Quote
Caused by: org.codehaus.commons.compiler.CompileException: File data/scripts/world/zorg/ZorgGen.java, Line 61, Column 82: Cannot determine simple type name "InteractionDialogImageVisual"

That refers to:
Quote
station.setCustomInteractionDialogImageVisual(new InteractionDialogImageVisual("illustrations", "zorg_interior", 1200, 1200));

I can't figure out why it isn't working. There is a "zorg_interior.png" in the illustrations folder. "station" is the token of the station in ZorgGen.java.

Any ideas?
Logged

Thaago

  • Global Moderator
  • Admiral
  • *****
  • Posts: 7214
  • Harpoon Affectionado
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #860 on: September 23, 2013, 08:52:18 AM »

Hi everyone - a little help with packaging into jars with Netbeans?

Everything has gone fine until I attempted to have Starsector load the jar. Then I get:Unsupported major.minor version 51.0
as the error.

Looking this up, its because I've compiled the jar for java 7 rather than java 6... have other people run into this issue as well?

Am I correct that the fix is going to be to downloading the jdk 1.6 and compiling with that set as the platform?

Thanks!
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24116
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #861 on: September 23, 2013, 08:55:06 AM »

@Erick Doe:

#1: No, that's still how it works. Not sure why it's not working for you but that's how it works in vanilla. My first guess would be that this code isn't actually running, for whatever reason.


#2: Guessing you didn't import the InteractionDialogImageVisual class.

import com.fs.starfarer.api.InteractionDialogImageVisual;


Am I correct that the fix is going to be to downloading the jdk 1.6 and compiling with that set as the platform?

Fairly sure you can just tell netbeans to compile for java6 compliance, while still using the java7 jdk. Haven't used netbeans myself, though, so not 100% sure, but I'd be pretty surprised if it didn't let you.
Logged

Uomoz

  • Admiral
  • *****
  • Posts: 2663
  • 'womo'dz
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #862 on: September 23, 2013, 08:58:26 AM »

Am I correct that the fix is going to be to downloading the jdk 1.6 and compiling with that set as the platform?

Fairly sure you can just tell netbeans to compile for java6 compliance, while still using the java7 jdk. Haven't used netbeans myself, though, so not 100% sure, but I'd be pretty surprised if it didn't let you.

I use netbeans and it needs the 1.6jdk download to compile for java6.
Logged

Thaago

  • Global Moderator
  • Admiral
  • *****
  • Posts: 7214
  • Harpoon Affectionado
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #863 on: September 23, 2013, 09:14:28 AM »

Thanks very much!
Logged

frag971

  • Commander
  • ***
  • Posts: 242
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #864 on: September 23, 2013, 02:06:25 PM »

Is there any mod that modifies Experience gains? say x3 or x1.1
Logged
Let's say I'm captaining the ISS Slightly Lopsided Isosceles Triangle here.

MShadowy

  • Admiral
  • *****
  • Posts: 911
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #865 on: September 23, 2013, 02:43:45 PM »

Iiiii... this isn't actually doing anything, right?

Code
public zzazzPaintUIPlugin(CampaignFleetAPI fleet, ShipAPI ship, FleetMemberAPI hull) {    
                
            String spriteName = initShadowyards.spriteNames.toString();
            String styleName = initShadowyards.getStyles.toString();
            
            for (FleetMemberAPI member : playerFleet.getFleetData().getMembersListCopy()) {    
                String hullType = member.getSpecId();
                
                if (initShadowyards.spriteNames.keySet().contains(hullType)); {
                    //iterate through the available styles
                    List styleList = new ArrayList(initShadowyards.getStyles.values());
                    Collections.sort(styleList);                    
                    
                    //List spriteList = new ArrayList(initShadowyards.spriteNames.values());
                    //Collections.sort(spriteList);
                    
                    List styles = styleList;
                    Iterator iter = styles.iterator();
                    while (iter.hasNext()) {                                                
                        options.getSelectorValue(styles);
                        options.addOption(styleName, styles);
                        Global.getSettings().getSprite(styles + spriteName);
                    }
                    ship.setSprite(hullType, styles + spriteName);
                }
            }
}

E: should probably add that this is segment of code I'm trying to get to handle the sprite replacing.
« Last Edit: September 23, 2013, 02:51:36 PM by MShadowy »
Logged

Erick Doe

  • Global Moderator
  • Admiral
  • *****
  • Posts: 2489
  • "Pretty cunning, don't you think?"
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #866 on: September 23, 2013, 04:38:24 PM »

@Erick Doe:

#1: No, that's still how it works. Not sure why it's not working for you but that's how it works in vanilla. My first guess would be that this code isn't actually running, for whatever reason.


#2: Guessing you didn't import the InteractionDialogImageVisual class.

import com.fs.starfarer.api.InteractionDialogImageVisual;

Thanks!
Logged

Zaphide

  • Admiral
  • *****
  • Posts: 799
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #867 on: September 23, 2013, 06:38:37 PM »

Is there a way of flagging a mod for compatibility (and incompatibility) with other mods?

I've noticed (in other mods) there are a few different variables you can add to mod_info.json along those lines. Do these actually do anything?

Ideally I would like to be able to say 'this mod will only work with these other mods', or failing that, 'this mod will not work with these other mods' and have StarSector enforce that at mod selection time.
Logged

Kiloman

  • Ensign
  • *
  • Posts: 35
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #868 on: September 24, 2013, 01:23:46 AM »

So I've been mulling some ideas for new weapons, in particular I was considering an 'IFF Disruptor' that type missile. The idea was that it would be a simple unguided missile; if you could land a hit on the hull, it would override the ship's IFF transmitter for a period of time, causing missiles friendly to that ship to target it.

In practice, I'm not sure if this is possible for a few reasons:

First of all, I'd need to disable the friendly-fire protections on a per-ship basis. I think I could do this by conditionally changing the collision class to MISSILE_FF when the projectile was sufficiently close to the hacked ship, but I'm not sure.

Second, I'd need to override the missile target selection logic to override the target owner != missile owner check. Theoretically this could be done by extending the core classes under com.fs.starfarer.combat.ai.missile (HeatseakerAI, MirvAI, etc); however the target selection methods are both private and obfuscated, so I would in fact have to completely re-implement all of the various type-specific logic in my mod.

Am I missing anything? Alex, does what I'm describing make any sense?
Logged

Erick Doe

  • Global Moderator
  • Admiral
  • *****
  • Posts: 2489
  • "Pretty cunning, don't you think?"
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #869 on: September 24, 2013, 05:02:27 AM »

@Erick Doe:

#1: No, that's still how it works. Not sure why it's not working for you but that's how it works in vanilla. My first guess would be that this code isn't actually running, for whatever reason.


#2: Guessing you didn't import the InteractionDialogImageVisual class.

import com.fs.starfarer.api.InteractionDialogImageVisual;

Thanks!

Just a heads up:

I had to rename the custom image that I wanted to use to one of the vanilla images, like "cargo_loading". For some reason it didn't work (crash to desktop) when I entered the custom file's name "zorg_interior". It works fine now, but it is still a little odd to me that I can't use a custom name for the file.

To clarify, I had to rename the image file in my mod from "zorg_interior" to "cargo_loading". Otherwise the game crashes to desktop when trying to dock with the station that uses the custom image.
Logged
Pages: 1 ... 56 57 [58] 59 60 ... 710