Fractal Softworks Forum

Please login or register.

Login with username, password and session length

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Topics - Darloth

Pages: 1 2 [3] 4
31
http://puu.sh/cmthZ/3475566feb.png

Either they've managed to somehow cram a ballistic weapon into that medium energy slot, or the info screen telling me that mule has a medium energy slot is wrong.

Investigating the data files reveals that it's the second option:
The pirate skin (mule_d_pirates.skin) grants the UNIVERSAL type to WS 003, but the info popup clearly states medium energy.

32
I'm looking at messing with the +5 speed boost that's granted in deep hyperspace.

Is there an easy way of checking whether this is currently being applied to a fleet?  It would be ideal if this showed up as a stat bonus in MutableFleetStats or something, but I can't tell what it would be listed as there.

If there's an easy way to change it that would also be excellent, but I suspect there is not, and for doing per-ship over-burn changes I would need it to be separate anyway.

Finally, are there any unexpected problems anyone can think of that I might run into doing something like:

Code
public boolean IsFleetInDeepHyperspace(CampaignFleetAPI fleet)
{
    FleetDataAPI data = fleet.getFleetData();
if(data.getMinBurnLevel() < data.getBurnLevel()
{
return true;
} else {
return false;
}
}

33
Suggestions / Reassign hotkeys for menu
« on: August 26, 2014, 01:18:19 PM »
So we have this nice menu at the bottom, and in the hopefully soonish new version there will be an amazingly handy looking Intel tab.

My only problem with it is that it's an intEl tab, and that just doesn't seem right.

I know that I is currently for Inventory, but honestly it's not really a traditional RPG inventory and I don't really think of it that way - I usually can't remember it's on I. We never really use items from fleet cargo (occasional mods aside - and even then they're usually used from a dialog, not the cargo bay directly) and it would be fine on C, for Crew or indeed Cargo.

What about Character, then? Well... actually, I very rarely need to get to this menu in a hurry.  For me it could have no hotkey at all, but there's no reason it can't move to R or T or something.

Opinions?

(I'm aware some people will be very used to the current hotkeys, but I don't see that as a huge reason to keep them.  None of these buttons are time-sensitive, you can always pause and just use the mouse to get there, so it would be a minor and non-impacting thing to have to learn new ones - it's also not the entire set, and sooner is always better than later if you're going to change them at all.)

P.S. It would also mean you could get rid of the [ I ] in Crew & Cargo [ I ]

34
Modding / Fleet Conference Beacon
« on: September 28, 2013, 10:18:20 AM »
Quote from: Some annoying salesdrone
Ever wanted to call a halt half-way through hyperspace, just to redestribute your supply profiles or perhaps dress down an incompetent underling?

Now, with the 'DraniTech Hyperspatial Fleet Conference/Enforcement Reusable Communication Protocol (Mk 1.1g-expandable) you can!

This mod does almost nothing on its own, but it provides an interface that other mods can hook into to provide options for a dialog that the player can trigger at any time they like by pressing G. (Won't work when the game is paused until the next version.)

These other mods can then do pretty much anything on-command.  For example, the next version of Tradewinds (see sig) will use this system to provide more uses for trade commodities, letting you change them into supplies or fuel.  Alternative uses are as varied as your imagination!

(Core mod download)
Here is the core mod itself - It can be safely added to in-progress games

(Examples)
Here is an example dialog option with accompanying followup option, so that you can see how to implement an option.  Please note that this does not need jars!

(Core source)
Here is the source code of both the interface and the core plugin

Note: It's the responsibility of the mod adding interaction options to handle -removing- those options if necessary. Usually this means that once you've added a mod that adds options, you can't remove it safely (at least until 0.6.1a, maybe past then)

Attached is a picture of the beacon I'm not even using anymore! It's literally the only thing I thought was worth screenshotting! (it was kitbashed from Starsector graphics, as usual, and now it isn't in the mod!)


[attachment deleted by admin]

35
Modding / Doesn't save statics?
« on: September 21, 2013, 07:16:58 PM »
I have a public static List<String> in one of my classes, and the game doesn't seem to save it.

As it saves nearly everything else, I'm currently assuming this is because it's static?

Is this intentional please, or a bug?  I wasn't sure, so I posted it here...

36
So, if I use devmode with the core game, everything is fine.

If, however, I use the mod attached to this post, I get a "found invalid classes being serialized" error after the captain skill screen when I click start, when making a new game.  The log says:
Quote from: starsector.log
16195 [Thread-6] ERROR com.fs.starfarer.combat.D  - java.lang.RuntimeException: Found invalid classes being serialized
java.lang.RuntimeException: Found invalid classes being serialized
   at com.fs.starfarer.campaign.save.CampaignGameManager.super(Unknown Source)
   at com.fs.starfarer.campaign.save.CampaignGameManager.super(Unknown Source)
   at com.fs.starfarer.title.B.dialogDismissed(Unknown Source)
   at com.fs.starfarer.ui.K.dismiss(Unknown Source)
   at com.fs.starfarer.ui.impl.oooOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO.dismiss(Unknown Source)
   at com.fs.starfarer.campaign.save.OooO.actionPerformed(Unknown Source)
   at com.fs.starfarer.ui.O00o.super(Unknown Source)
   at com.fs.starfarer.ui.F.processInput(Unknown Source)
   at com.fs.starfarer.ui.newsuper.o00000(Unknown Source)
   at com.fs.starfarer.new.øÒÒ000(Unknown Source)
   at com.fs.oOOO.super.new(Unknown Source)
   at com.fs.starfarer.combat.D.o00000(Unknown Source)
   at com.fs.starfarer.StarfarerLauncher$2.run(Unknown Source)
   at java.lang.Thread.run(Thread.java:619)

Since this is dev-mode and modded at that, I realize this is going to be way down on your priority list to even investigate, but I thought I should mention it.  It works fine without devmode, as expected.

Additionally, if I load a game it works, but then the same error happens if I quit to the main menu.

[attachment deleted by admin]

37
See here for update notice!

Okay, so I finally got fed up of using a text editor, not having autocomplete, and most of all Janino not supporting generics.  To fix this, I looked through the available free Java IDEs, and found IntelliJ IDEA Community Edition.  It's free, has all of the features anyone modding will ever really need, and has what I think is a nice interface.

Given that, here's a tutorial for how to set it up so that you too can get autocomplete on starfarer scripts, along with how to make a jar file out of your mod's scripts and other code, so that you too can use generics (they're SO much easier).

First, you'll need to download it(Remember to pick the community edition - it's the free one. If you end up doing major java database development or groovy / android stuff then maybe the other one would be useful, but there's really nothing much in there that would be helpful for starsector.)(Starfarer!)

Once it's installed, you're also going to need the Java 7 SDK.  Getting this can be a little bit of a pain, as Oracle make you register an account to download old versions - you can do that somewhere around here, or find it elsewhere if you prefer.  Install it into some folder you can find again later.

Okay, so now you are ready to actually start IntelliJ IDEA for the first time.  Once it's loaded, create a new project.
You will get a screen with lots of options, titled: New Project.
Most of those options are pretty unimportant actually - there are three things you want to set here:
  • First, make sure it says Java Module from the list of types on the left. 
  • Second, set the name and location to whatever you want (Note: do NOT set the location to anywhere in your starsector folder - you'll regret that later, but we'll get to that.)
  • Third, you need to set the Project SDK to the Java 7 SDK you downloaded and installed earlier, and you'll need to click the New button, select JDK, and then point it at the right folder to do this. 
  • You can safely ignore everything in More Settings, just leave those as the defaults.
Press Next, and it will ask you to select extra technologies - usually only Groovy will be an option, and we won't be using that, so just press Finish.

You should end up on the main screen, a big grey background on the right, and then a foldertree tray window at the left, with one folder named whatever you named your project, and also External Libraries as a little bookshelf icon.  Open up the folder for your project, and have a look around. The src folder is where you'll put all your source files - most likely you'll make a data.scripts subfolder under this. Leave the .idea folder and the .iml file alone as those are editor-specific project settings you shouldn't need to mess with.

Next we're going to add starsector's own API as another library to draw from (you'd do the same for LazyLib or other libraries, if you want those):
  • Go up to the File menu and select Project Structure.
  • From the tab selector on the left of this new window, pick Libraries.
  • Above the tray just to the right of that, click the green Plus symbol.
  • Pick Java as the type(I don't even know what Maven is, some sort of nugetlike thing?), and you'll get a directory selector tree.  Navigate to your starsector installation, go into starsector-core, and lots of jars will be displayed. You want to ctrl-click multiselect starfarer.api.jar, starfarer.api.zip, lwjgl.jar and lwjgl_util.jar.  With those selected press OK.
  • Press ok again to add it to the only module you have, named whatever you picked.
You should now have some stuff on the right of this screen, three classes and one source.  If the name hasn't been automatically set to starfarer.api at the top right, do that now too, and press Apply.

Next we want a jar file, right? For reasons unknown to me (but probably quite sensible early on) Java calls these artifacts, so go to the artifacts tab on this same menu (see, that's why you clicked Apply and not OK).  Click the green plus on this one again, pick Jar then Empty, and you will get new details on the right:
  • From the Available Elements window, doubleclick the one that has your module's name followed by 'compile output'.
  • Right click on the jar file (in the left window, probably called unnamed.jar at the moment) and select Create Directory.  Call it "source".
  • Right click on that directory and Add Copy Of -> Directory Content.  Select the src directory from the popup.
  • Change the artifact name to something you want - probably matching the module name.
  • Change the output directory at the top of this screen to be wherever your starfarer mod folder is - basically, where you actually want your jar to go.
  • Build on make is also a good idea - this should make the jar file build every time you compile your project.  It's not essential, you can leave it turned off and do it by hand in the menu if you'd prefer it.

We're nearly done now!
Right click on the src folder and select new->Java class. Call it, I dunno, "data.scripts.YourModPlugin" or something.  Note that you can include the path here, and it'll make the necessary folders!

In your new file, just after it says "public class YourModPlugin" type "extends BaseMo" and notice that the autocomplete has (if everything went well!) picked up the starfarer API and can happily tab-complete this to BaseModPlugin. Even better, IntelliJ will put in the appropriate import for you, isn't that awesome? (I think it is!)

Now you can do stuff like "List<StarSystemAPI> places = Global.getSector().getStarSystems();", with none of that pesky casting of object types.  If anything shows up red, click on it to put the caret there, and a lightbulb will probably pop up that you can click on for an explanation and hopefully a suggestion of how to fix it - IntelliJ will often have a solution or a thing that will change it for you to be correct, and I believe alt+enter is the shortcut to get that menu or do that thing if you don't want to use the mouse.

That should be you set, just compile things from the Build menu or I think it's F7 by default, and assuming you checked Build on Make earlier, the jar file should be where you want it. If not, or if you want to do it yourself, there's a Build Artifacts command in the build menu.

There are other tutorials about how to actually USE the jar, but mostly, just point your mod at it with mod_info.json's jars option and everything should work as you expect. 

Two small notes: if you have a class at src/data.scripts.YourModPlugin, because src is the root source folder, you shouldn't include it in paths: your modPlugin line in the mod_info.json should actually read: "modPlugin":"data.scripts.YourModPlugin",

Second thing: By default, IntelliJ clears out the entire output folder whenever you compile.  This is why you do NOT want to point it at your starfarer mods folder, you'll lose other stuff like resources.csv.  It doesn't clear stuff where it puts the .jar file, just wherever you're actually compiling too. If you left it as the default, and made sure not to put your project under your starfarer folder, all will be well.

(If anyone really needs screenshots, let me know - but they'll just be of windows and menus, and since there's a limit of 4 per post, I want to see where people get stuck, IF they get stuck, before taking any.  Hope that helps, and happy modding!)

Edit: Just in case it might help, I attached the entire project I created as I was writing this tutorial - you should be able to load it and poke around in settings / structure to see how it's set up. One caveat is I didn't actually set my jar to be written to my starfarer folder, so you will have to do that manually if you use the attachment.


[attachment deleted by admin]

38
General Discussion / Fighters, MaxBurn, and Hyperspace
« on: September 18, 2013, 03:23:26 PM »
So fighters have a burn rating, but DON'T have fuel costs or fuel per ly ratings.

This basically just means that they can slow you down, but are they somehow still being stowed for hyperspace travel?

I think their max burn ratings should be ignored when you have a carrier.  I'm unsure what should happen to them in hyperspace... maybe they should be entirely unusable there? Maybe you need a carrier to take them, or to use them in a fight? I really don't know.

39
Modding / JSON help
« on: September 16, 2013, 06:14:29 PM »
Please help.

I tried to use JSONs and now my eyes hurt.  I'm having Heavy Rain flashbacks. (JAAAAYSON!)

Here is a JSON.

I want to parse it into a Map<LocationAPI, Map<String, PriceSet> (but anything sane would do, if that doesn't make sense).  Can anybody show me, how, please? (One criteria: I'd rather not need to know the names in code, ideally it should work everything out just from the json...)

I spent about 30 minutes flailing at this before commenting the whole lot out and just hardcoding it.

{
   "Corvus":
   {
      "mechparts": "low"
      "widgets": "high"
   }
   
   "Anar":
   {
      "widgets": "low"
   }
   
   "Askonia":
   {
      "mechparts": "high"
   }   
}

P.S. - feel free to change anything to arrays.

40
Mods / Tradewinds 0.3
« on: September 16, 2013, 06:09:10 PM »
(Backstory: I made some big claims aaaages ago - now, finally, I have something ingame and working! 0.6a helped a lot in this regard)

Current version: 0.3
Compiled Mod
Source

Tradewinds:

This mod adds a variety of commodities that can be carried from place to place across the sector.  All of the (two) core systems are supported, along with a variety of additional systems, and each system has a different set of prices for certain goods.  Additionally, some extra trade-fleets can be found plying the spacelanes, delivering these goods to random stations.  If you are of a piratical bent, you can destroy them to recover their loot.

Screenshot (oh so exciting trading screen! It's hard to get an action packed screenshot for this mod...):


License is CC-attribution-WTF at the moment, as in: I'd like to be credited, but otherwise you can do whatever you want with it. Do note that the graphics are a derivative work based on starsector core graphics, so this license does not apply to them - they still belong to Alex / David / Fractal Softworks.

Notes:
Balance is still shaky, and arguable.  There's also not yet much you can DO with these resources EXCEPT sell them (hopefully for more than you got them).  Also if you have no idea how much something is supposed to cost, you'll always get the medium 'default' price if you check in hyperspace.

Also... I found and fixed rather a lot of crash bugs in this before deciding it was ready.  There is a reasonable chance I missed at least one.  If you find one, then my apologies - please let me know about it and ideally post the exception from the starfarer.log.  Thanks!

Changelog:
0.2 - Improved resource handling in stations and trade fleets that aren't the player.  Also now supports hyperspace! (There isn't anywhere to trade IN hyperspace yet... but if there were, it would now be supported. It's set to medium prices for everything, so if you want to see the 'base' price, check there!)
0.2b - Removed dependency on Corvus and Askonia existing.
0.2c - fixed bug introduced by 0.2 where the mod would crash in unfamiliar systems.  Added Mirage and Seiiki to the supported systems list.
0.3 - Broke saves, Expanded range of prices, added item descriptions, added daily price fluctuations, added random chance to permanantly change the price of a certain good in a random system - potentially by a lot! Also loads of bugfixes, crash fixes, and generally better code.

Future plans:
0.35 - refine events, make them temporary, add cargo removal for notsoldhere and massive-demand events.
0.4 - Add stopgap goods sinks - stations get rid of some of their goods after a while
0.5 - Add feature to combine high tech, low tech and agri-goods to make supplies, add an item that you jettison to spawn the interaction?  Also do this for Reactive Gasses + Refined Infernium
0.6 - Add systems, stations in those systems which add a specific type of cargo
0.7 - Upgrade Cargo fleets: fly between systems, initially buying what is cheap in their home system and flying to somewhere pre-set that it is expensive, and then selling and buying a cheap good instead.  Don't just randomly wander off and despawn
0.8 - Other fleets are spawned with / generate resources-loot when they are defeated.

1.0 - Cargo fleets that look at the price table, pick a cheap good to buy, an expensive place to sell, and go there automatically.
1.1 - Dynamic pricing based on evaluation of all goods in a given system.

(Of course, the order of these and whether I actually do them may well change depending on how hard and how fun they are, but that's my plan at the moment!)

Credits: David, for the brilliant crate and fuel tank sprites that I have used for various other goods.  Alex - for making Starsector's modding API a joy to use, and of course for Starsector itself.

41
Modding / No ResourcesAPI
« on: September 16, 2013, 03:04:48 PM »
Correct me if I'm wrong, but there doesn't seem to be any way of changing any of the resources from resources.csv ingame?

I'm about to resort to a cheap hack and some cunning but annoying inventory manipulation to get the effect I want, which could be much alleviated if I could change the prices...

How difficult would it be for one of the upcoming versions to just include a quick ResourcesAPI that lets you go
ResourcesAPI resApi = Globals.getResourcesAPI();
resApi.setPrice("supplies",50);
resApi.setPrice("fuel",100);

If it's easy, I would like to request that this gets added in the next few versions. I'm aware that a real economy implementation would make this obsolete, but in the meantime that one method would make a lot of things so much easier.

42
Suggestions / Marine supply cost
« on: September 15, 2013, 01:01:51 PM »
I'm okay with marines costing a lot of supplies to use, but I don't think they should cost a lot of supplies just to keep around.

Assuming that a marine eats 150% what a crewmember eats, and also has more equipment to maintain, 0.02 or at a push 0.03 per marine would be a lot better than 0.1, which is huge.

On the other hand, I'm fine with it costing a lot of supplies to USE the marines - make it cost one supply per returning marine after a boarding attempt (failed or not) to represent maintenance on their stuff. Heck, if necessary make it cost FIVE supplies, but have this tied to when you USE the marines, not just having them.  You can build a Thunder interceptor chassis for that, which should cover everything a marine powersuit would need, right? (Thrusters, zappy thing, explody thing, cutty/melty thing, some dakka?)

43
Modding / Goods and cargos
« on: August 18, 2012, 06:40:48 AM »
I made these recolours of the lovely supply crate for my own purposes, but I thought that, since I actually quite like how they've turned out, I should make them available for everyone else as well.

Most of the credit should go to whoever made the original supply crate (David I presume), it's been a joy to work with!


[attachment deleted by admin]

44
General Discussion / Does the convert button do anything yet?
« on: August 17, 2012, 03:19:29 PM »
I've poked around, searched the forums and examined the files for the Buffalo and Tarsus, but I can't seem to find out whether the Convert button just sits there all gray and unloved, or whether I just don't know how to get it to work.

Does anyone know either way please?

45
Modding / I plan to make a (proper) mod
« on: August 15, 2012, 02:00:05 PM »
And so I'm making a topic for it now.

Mostly, I'm making a topic so I can't just forget about the idea, decide I don't have enough time or that it'll be way too difficult.  I do reserve the right to give up in a fussy/pleased huff if Alex does all the stuff I am planning before I finish doing it the Wrong way :)

You see, I've had a think about the tools we currently have available, and I think it should be possible to add a campaign mod.  Not multiple systems, don't get me wrong, but I have a (fairly cheesy, mostly inspired by I-War 2) story in mind, a protagonist and an antagonist, fleets to plunder with a bit more purpose to it, an eventual final battle (after rolling through several system defense fleets, of course!) an upgradable eventually-super-flagship, possibly some blueprint based item construction and some good old fashioned quest McGuffins.

All I have right now is a couple of pages full of notes, some ideas for really cool and overpowered new ship systems that I hope will be fun to play with, and a design that lets me get away with -suspiciously- little artwork.  I know that talk is cheap and that everyone has big ideas, most of which never see the light of day, but that's why I'm making this topic.  Hopefully in the next few days / weeks I will turn this into something worth your time.

Pages: 1 2 [3] 4