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 - Okim

Pages: [1] 2 3
1
Modding / Advanced faction modding
« on: January 10, 2022, 09:27:48 PM »
Hey,

haven't found any exact info on this, so making a thread.

Is there any way to keep a faction from having colonies / stations? Just be a 'ghost' faction that is present in news, spawns fleets from independent colonies / stations or random spots on the map.
There are some refugees, merc and scavengers factions in the game folders, but they don't have anything in their files indicating a 'switch' that makes them 'just spawning fleets'.

I believe that these triggers are hidden in API which i would like to avoid messing with :D

2
Modding / Some fancy ships ;)
« on: January 03, 2022, 09:22:51 AM »
Hey all.

Just made these to test the skills and techs.
Based on ancient Project Ironclads mod's Rostov frigate.

[attachment deleted by admin]

3
Discussions / Elite: Dangerous
« on: January 10, 2015, 01:02:10 AM »
Hi, guys.

I think that this game does not require to be introduced - it is a well known universe that gave birth to privateer and X long time ago.

Info on the game can be found here: http://elitedangerous.com/

My question is - have anyone played it? And is there any other place to buy the game other than from the site?
Here in Russia buying the game with the current Euro-Rub rates means that the game costs 3 times more than it would cost 6 month ago.

4
Discussions / Space Engineers
« on: January 01, 2015, 11:04:06 AM »
All of you are probably aware of this interesting construction-focused game (steam linky: http://store.steampowered.com/app/244850/). I heard something about this game long time ago, but really payed attention to it when i saw Upgradecup playing it for weeks in a row. Then i saw Trylobot playing it too, so i decided to give it a try. "Two great Sector modders are playing the same thing - i must try it" - kind of what i was thinking at that time.

At first the game was interesting in creative where eveyone tried to be, well, creative by building the largest and coolest ship ever (or station) or smashin the other guy`s ships (in multiplayer). It was a lot of fun, but my attention was really attracted by the survival mode, where you have to mine, refine, produce stuff and then use it to construct ships and stations. Occasional NPC ships that were passing through the game area could be fought, boarded and grinded down or modified and used by player.

Eventually my interest for this game has passed, but with the recent infinite worlds addition and derelict stations/ships being hidden here and there my interest in the game raised once again.

SO!

Here is a little story of a long journey of mine (that is currently a single 40+ in-game hours game) that describes my efforts, some interesting observations and which shows some nice pictures: http://steamcommunity.com/app/244850/discussions/0/627456486775794698/

5
Suggestions / Black Market suggestion
« on: December 30, 2014, 12:29:15 AM »
It would be nice to have crew always be present at black markets as currently supplies and fuels are. I guess that there are always a steady amount of those who wish to get hired avoiding official channels for their own reasons (like having troubles with the law or being unable to pay taxes or simply being not qualified/healthy enough by faction`s ship crew standards or whatever else reason). Green crew suits pretty well here.

And from a modder`s perspective: it also would be very nice to be able to directly adjust the commodities that are always available at particular market types.

6
Modding / Unusual crash
« on: December 27, 2014, 11:09:59 AM »
Hi.

Getting this odd crash upon attempting to trade with a particular market:

Spoiler
Quote
1695566 [Thread-5] INFO  com.fs.starfarer.api.impl.campaign.fleets.FleetFactory  - Creating trade fleet of tier 1 for market [Marauders Hideout] (volume: 318)
1695567 [Thread-5] INFO  com.fs.starfarer.api.impl.campaign.fleets.EconomyFleetManager  - Spawned 10 point trade fleet from [Marauders Hideout] to [Black Widows Hideout]
1695582 [Thread-5] INFO  com.fs.starfarer.api.impl.campaign.shared.MarketConnectionActivityData  - Updating connection: [stal_rzhavaya]: trade (s: 5, l: 1), smuggling: (s: 0, l: 0)
1698085 [Thread-5] INFO  com.fs.starfarer.api.impl.campaign.events.TradeInfoUpdateEvent  - Picking market updates
1698085 [Thread-5] INFO  com.fs.starfarer.api.impl.campaign.events.TradeInfoUpdateEvent  - Adding Weapon Components(Cold Sands)
1717253 [Thread-5] ERROR com.fs.starfarer.combat.O0OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO  - java.lang.OutOfMemoryError: Java heap space
java.lang.OutOfMemoryError: Java heap space
   at com.fs.starfarer.ui.Q.<init>(Unknown Source)
   at com.fs.starfarer.ui.s.<init>(Unknown Source)
   at com.fs.starfarer.campaign.ui.marketinfo.oOOO.<init>(Unknown Source)
   at com.fs.starfarer.campaign.ui.marketinfo.B.??0000(Unknown Source)
   at com.fs.starfarer.campaign.ui.marketinfo.O0OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO.super.int$new(Unknown Source)
   at com.fs.starfarer.campaign.ui.marketinfo.O0OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO.sizeChanged(Unknown Source)
   at com.fs.starfarer.ui.o0oOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO.setSize(Unknown Source)
   at com.fs.starfarer.coreui.float.super(Unknown Source)
   at com.fs.starfarer.coreui.float.?00000(Unknown Source)
   at com.fs.starfarer.campaign.ui.marketinfo.MarketInfoPanel.sizeChanged(Unknown Source)
   at com.fs.starfarer.ui.o0oOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO.setSize(Unknown Source)
   at com.fs.starfarer.campaign.ui.T.sizeChanged(Unknown Source)
   at com.fs.starfarer.ui.o0oOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO.setSize(Unknown Source)
   at com.fs.starfarer.ui.Q.setSize(Unknown Source)
   at com.fs.starfarer.coreui.OO0o.sizeChanged(Unknown Source)
   at com.fs.starfarer.ui.o0oOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO.setSize(Unknown Source)
   at com.fs.starfarer.ui.Q.setSize(Unknown Source)
   at com.fs.starfarer.ui.String.int$5.actionPerformed(Unknown Source)
   at com.fs.starfarer.ui.String.int.setCurrentTab(Unknown Source)
   at com.fs.starfarer.ui.String.int.setCurrentTab(Unknown Source)
   at com.fs.starfarer.ui.String.P.showCoreInternal(Unknown Source)
   at com.fs.starfarer.ui.String.P.showCore(Unknown Source)
   at com.fs.starfarer.api.impl.campaign.rulecmd.OpenCoreTab.execute(OpenCoreTab.java:39)
   at com.fs.starfarer.campaign.rules.super.execute(Unknown Source)
   at com.fs.starfarer.campaign.rules.D.runScript(Unknown Source)
   at com.fs.starfarer.api.impl.campaign.rulecmd.FireBest.applyRule(FireBest.java:96)
   at com.fs.starfarer.api.impl.campaign.rulecmd.FireBest.execute(FireBest.java:46)
   at com.fs.starfarer.api.impl.campaign.rulecmd.FireBest.fire(FireBest.java:52)
   at com.fs.starfarer.api.impl.campaign.RuleBasedInteractionDialogPluginImpl.fireBes t(RuleBasedInteractionDialogPluginImpl.java:110)
   at com.fs.starfarer.api.impl.campaign.RuleBasedInteractionDialogPluginImpl.optionS elected(RuleBasedInteractionDialogPluginImpl.java:139)
   at com.fs.starfarer.ui.String.P$1.o00000(Unknown Source)
   at com.fs.starfarer.ui.String.A.actionPerformed(Unknown Source)
[close]

Looks like a loop of sorts. So far this happens with at least 3 different commodities, but always with the same entity. The dialogue with that entity loads up correctly, but when you click on 'open trade' - it hangs and then crashes.

7
Modding / [request] Pirate/merc odds and other difficult-to-modify values
« on: November 26, 2014, 12:56:48 AM »
Hi.

It would be great to have the following values being put into a separate and easy to access/replace json file (or probably even settings):

- odds for a merc fleet to be spawned instead of pirates
- number of pirate fleets per market size
- a list of possible lootable commodities that you can get by destroying ships (like the current metals we get) with an ability to perform faction checks (allowing/not allowing certain loot to be dropped by some factions)
- a list of commodities that you get for scrapping your own ships (now there is just a few tons of supplies and fuel)
- odds for different boarding resolutions (the one that we have in fleet encounter for different boarding actions (with an ability to perform faction check and disallow boarding for certain factions at all)

Why asking? It is simple - currently to modify a single value from the list above you need to rewrite a huge amount of scripts and recompile it in a huge jar (like replacing the original fleet interaction with a modified version where you call a modified version of fleet encounter script where you put all the resources you wish to get for salvage just for blowing up the ship and etc.). Having the list of salvageable commodities somewhere in data.scripts where you can easily replace this file is much-much easier to mod.

We have now an external list of market condition values that is easy to mod. Something like that for the things listed above would be awesome to have.

8
Modding / [how-to] Using 'Wait', interruptions outside the rules
« on: November 17, 2014, 11:56:12 AM »
Hi.

So the question is this - how to properly set up a wait() thingy outside the rules.csv (i.e. for interaction dialogues that are not based on rules).

Is it actually possible to do that?

9
Modding / [how-to] economy-related values and such
« on: November 15, 2014, 12:14:17 PM »
Hi.

There are some values that new economy is using that might cause confusion for modders as most of them aren`t explained anywhere.

For example these two:

Quote

market.getDemand(Commodities.REGULAR_CREW).getDemand().modifyFlat(id, 100);
market.getDemand(Commodities.REGULAR_CREW).getNonConsumingDemand().modifyFlat(id, 99);

What`s the difference between these two? I`ve done some javadoc digging and eventually discovered somewhere that the first value sets a demand that will be consumed in order to produce stuff. Will it be consumed at some fraction or will the market wait for the whole demand to be met - i don`t know. Probably depends on how market condition script is written.

The 'getNonConsumingDemand' is a specified amount of goods that will be available for sale at this market. Will it be accounted for the demand met or not is probably also set up in conditions scripts.


Now these two are a true mystery:
Quote
   "defaultConnectionMult":1,
   "defaultConnectionFlat":1,

What they do i can only guess.

10
Modding / [how-to] How to init a dialogue with a custom entity?
« on: November 14, 2014, 12:06:14 AM »
Hi.

I have a custom entity with tag "wrecks". I have a set of rules that 'should' run whenever a player is interacting with an entity with "wrecks" tag. Everything looks ok so far, right? In game I can click on an entity, so it is possible to interact with it. But there is no dialog pop up or anything - my fleet just floats over the entity.

If I set the entity tag to those that are used by stations or relays - everything works fine.

The question is simple - do I need to overwrite some interactionDialogue files and if yes - which ones and most importantly - HOW?


Entity settings:

Spoiler
   "rsf_wrecks":{
      "defaultName":"Station Wrecks", # used if name=null in addCustomEntity()
      "defaultRadius":50, # used if radius<0 in addCustomEntity()
      "customDescriptionId":"orbital_station_default",
      "interactionImage":"graphics/illustrations/space_wreckage.jpg",
      "icon":"graphics/icons/station0.png",
      "iconWidth":24,
      "iconHeight":24,
      "sprite":"graphics/stations/station-rsf-wreck-1.png",
      "spriteWidth":128,
      "spriteHeight":128,
      "renderShadow":true,
      "useLightColor":false,
      "showInCampaign":true,
      "showIconOnMap":false,
      "showNameOnMap":false,
      "scaleNameWithZoom":false,
      "tags":["wrecks"],
      "layers":[STATIONS], # what layer(s) to render in. See CampaignEngineLayers.java for possible values
   },
[close]

Rules for interaction dialogue:

Spoiler
# swrecks interactions,,,,,,
swrecksOpen,OpenInteractionDialog,$tag:wrecks,"ShowDefaultVisual
FireBest InitSWrecksDialog",,,
swrecksInit,InitSWrecksDialog,$tag:wrecks,"$menuState = main 0
#SetTextHighlightColors buttonText ""255,0,0,255""
#SetTextHighlights $shipOrFleet
FireAll PopulateOptions",Your $shipOrFleet approaches the massive field of debris. Apparently it once was an orbital station that was destroyed by someone or something. You can`t do anything with it in current version.,,
swrecksOptionLeave,PopulateOptions,$tag:wrecks,"SetShortcut crLeave ""ESCAPE""",,100:crLeave:Leave the wrecks alone,
swrecksLeave,DialogOptionSelected,$tag:wrecks,DismissDialog,,,
[close]

11
Hi.

Tried to create my own rule, but it doesn`t seem to work. The point of this rule is to create starting relationships between player and other factions based on player choices.

The rule is packed into a jar and put in 'package com.fs.starfarer.api.impl.campaign.rulecmd' as it must be present there in order to use it in rules.csv. Here is the code that it uses:


Spoiler
Quote
package com.fs.starfarer.api.impl.campaign.rulecmd;

import java.util.List;
import java.util.Map;

import com.fs.starfarer.api.Global;
import com.fs.starfarer.api.campaign.InteractionDialogAPI;
//import com.fs.starfarer.api.campaign.ReputationActionResponsePlugin.ReputationAdjustme ntResult;
import com.fs.starfarer.api.campaign.RepLevel;
import com.fs.starfarer.api.campaign.rules.MemoryAPI;
//import com.fs.starfarer.api.impl.campaign.CoreReputationPlugin.RepActionEnvelope;
//import com.fs.starfarer.api.impl.campaign.CoreReputationPlugin.RepActions;
import com.fs.starfarer.api.util.Misc.Token;

/**
 * SetRep <factionId> <RepActions action>
 */
public class SetStartingRep extends BaseCommandPlugin {
  
   public boolean execute(String ruleId, InteractionDialogAPI dialog, List<Token> params, Map<String, MemoryAPI> memoryMap) {
      String Faction = params.get(0).getString(memoryMap);

        String prefix = "";

        if (Faction.contains("rsf"))
        {
            Global.getSector().getFaction("player").setRelationship("ISA", -0.2f);
            Global.getSector().getFaction("player").setRelationship("XLE", 0f);
            Global.getSector().getFaction("player").setRelationship("UIN", 0f);
            Global.getSector().getFaction("player").setRelationship("FFS", -0.1f);
            prefix = "RSF";

        }

        else if (Faction.contains("xle"))
        {
            Global.getSector().getFaction("player").setRelationship("ISA", 0f);
            Global.getSector().getFaction("player").setRelationship("RSF", 0f);
            Global.getSector().getFaction("player").setRelationship("UIN", 0f);
            Global.getSector().getFaction("player").setRelationship("FFS", -0.5f);
            prefix = "XLE";
        }

        else if (Faction.contains("uin"))
        {
            Global.getSector().getFaction("player").setRelationship("ISA", 0f);
            Global.getSector().getFaction("player").setRelationship("RSF", 0f);
            Global.getSector().getFaction("player").setRelationship("XLE", 0f);
            Global.getSector().getFaction("player").setRelationship("FFS", -0.5f);
            prefix = "UIN";
        }

        else if (Faction.contains("isa"))
        {
            Global.getSector().getFaction("player").setRelationship("UIN", 0f);
            Global.getSector().getFaction("player").setRelationship("RSF", -0.1f);
            Global.getSector().getFaction("player").setRelationship("XLE", 0f);
            Global.getSector().getFaction("player").setRelationship("FFS", -0.1f);
            prefix = "ISA";
        }

        if (Faction.contains("_t"))
        {
            Global.getSector().getFaction("player").setRelationship(prefix, RepLevel.NEUTRAL);
            Global.getSector().getFaction("player").setRelationship("independent",RepLevel.FAVORABLE);
            Global.getSector().getFaction("player").setRelationship("pirates", RepLevel.HOSTILE);
        }

        else if (Faction.contains("_s"))
        {
            Global.getSector().getFaction("player").setRelationship(prefix, RepLevel.SUSPICIOUS);
            Global.getSector().getFaction("player").setRelationship("independents", RepLevel.NEUTRAL);
            Global.getSector().getFaction("player").setRelationship("pirates", RepLevel.SUSPICIOUS);
        }

        else if (Faction.contains("_b"))
        {
            Global.getSector().getFaction("player").setRelationship(prefix, RepLevel.FAVORABLE);
            Global.getSector().getFaction("player").setRelationship("independents", RepLevel.NEUTRAL);
            Global.getSector().getFaction("player").setRelationship("pirates",RepLevel.HOSTILE);
        }

        return !Faction.isEmpty();
   }
}
[close]

The rules.csv has ' SetStartingRep "rsf_t" ' as one of the options. I don`t get any errors nither in the way of crashes or any entries in the log. The rule seems to be running (as it compiles without problems), but has no effect.

A little example. If you select trader and then RSF as your faction - you get a call for SetStartingRep with "rsf_t" string, so it should trigger the 'contains "rsf"' check and 'contains "_t"' check. Those should set pirates and ISA to be hostile towards you, but i get only neutral stance with all factions.

Guess there is something i`m doing wrong with the return value or this whole thing should not work that way at all.

I wonder what is generated first - player or factions? If it is the later - than there is no way to set up starting relationship at all via rules other than somehow wire your choices with SectorGen.

12
Suggestions / [modding-related] Weapons and commodities
« on: November 01, 2014, 05:25:33 AM »
Hi.

Got myself into some funny situations while remodding Ironclads like independents selling a bunch of ALIEN weapons at OPEN market or rock fly salvaged parts being freely available at the nearest trading center.

Issues with guns: current mechanics allows markets to sell faction weapons taken from what their designated ship role variants are using AND a totally random weapon (at much lower availability rates).
Issues with goods: trading center market condition appears to be selling/buying ALL available commodities.

Suggestions for guns:

1. make markets to spawn a random weapon based on default_ship_roles.
2. OR allow modders to put a flag in weapons.csv for guns they don`t wish to be sold anywhere.

Suggestions for commodities:

There is only one here - allow modders to put a flag (like - 'unique') to prevent stuff from getting to the markets.

13
Modding / Regarding fleet creation and weapon/ship abundance
« on: October 24, 2014, 01:01:33 AM »
Hi.

Was harassing Alex with some modding questions regarding fleets and weapon/ship availability. Decided to share the answers with the community and continue asking questions here rather than in PM.

So, here are the answers I`ve got from Alex (my questions are quoted):

Quote
1. I can`t find a file that contains fleet compositions. I looked in factions, but there are only ship types per faction and fleet type names. Where can I find that file and if faction-specific fleet composition possible?


The old-style fleet compositions should still work (using the same json format/java methods to spawn them), but they're no longer used anywhere by vanilla, and not exactly supported - i.e. if something breaks them later on down the line, I won't be fixing them.

The new way involves using code and "shipRoles" to spawn ships. Basically, you define - per faction, with defaults in default_ship_roles.json - what ships the faction uses for which roles. For example, what's a light combat ship? Etc. Then you spawn ships using a "quality factor" based on the market's stability (which makes higher or lower "quality" variants more or less likely to be picked), so the fleets end up being dynamic, both based on the faction and the market that spawned them.

For an example of how this works, take a look at com.fs.starfarer.api.impl.campaign.fleetsPatrolFleetManager.


Quote
2. Is there any way to set up faction-specific ship/weapon choices for markets? I.e. - specific factnion only sells guns/ships restricted to it. I can force some supply fleets to carry specific weapons, but I wish it to remain as much market-dependable as it is now in vanilla.



If you're using the default implementations of OpenMarketPlugin/MilitarySubmarketPlugin/etc, what'll happen is the ships/weapons available will be based on the ships the faction has configured in its shipRoles, and the weapons those ships carry. So, it sort of automatically "fits" the faction, even including higher-quality stuff being available on stable markets. It does also throw in a few totally random weapons for variety.

(Also, note: old-style "weapon delivery" doesn't work anymore. You could make it work by adding stuff directly to submarket cargo if you really wanted to, though.)
 
 
Quote
I actually feared that things will get nasty code-wise regarding faction-specific weapons/ships, but what you did with markets picking up the weapons based on preffered ship variants... you surely didn`t forget us modders while thinking this system out.


Saved me a lot of content-work, too Smiley


Quote
Is there any way to mark weapons/hulls as non-available for sell at all (rather than not including them on ship hulls)? Not speaking of built-in guns here - more of alien-based weapons and some high-tech stuff.


Add a "SYSTEM" tag for weapons, this should work 100% in the next release. You can also provide custom implementations of submarket plugins which can filter out whatever you want, it'll get callbacks pre player interaction.
 
 

14
Discussions / Shallow Space RTS (indie as it seems)
« on: August 25, 2014, 08:44:03 AM »
Hi there.

Recently found here info on Factorio and got myself addicted to this game. So i decided to share one of my own discoveries with the community.

The game is called Shallow Space. That`s a space RTS that is inspired by Nexus: Jupiter Incident and Homeworld. Looks pretty and complex enough. I`ve found some interface similarities with Homeworld which makes me happy. Also the models got me thinking that i surely want to mess with them from modding perspective...

Here is the link: http://shallow-space.com/press-pack/

Game doesn`t seem to be in early access of any type, but rumors are there that it`s going to be on kickstarter in some near future.

15
Modding / Custom Dialogs
« on: September 23, 2013, 10:24:11 AM »
First - its mostly a request/suggestion that aims for easier codding process.
Secondly - there might be other ways to work with dialogs that i`m not aware off.

The thing is simple - i`ve made a primitive trading system based on dialog options. Once you visit a station you have an option to access it`s trading network.

In-game Example: http://www.lordsofthestars.com/other/screenshot010.png

A new window pops up where you can buy/sell various resources. Most of the resources have their own buy/sell options per station. There are 6 types of resources and 6 types of stations. Currently there are near 20 options that cover various buy/sell variations (one station buys res for 10 credits and another - for 11 etc.

Example of buy options for a Mining Facility:

Spoiler
if (station.getName() == "Mining Station")
            {
                addText("");
                addText("This Mining Station sells:");
                addText("- common minerals for 6 credits per 1 unit");
                addText("- rare minerals for 80 credits per 1 unit");
                addText("- exotic minerals for 2000 credits per 1 unit");
                addText("");
                addText("Credits:"+ (int) credits + ": cargo space available: " + (int) playerFleet.getCargo().getSpaceLeft());
                if (credits >= 60f) {options.addOption("Buy 10 units of common minerals for 60 credits", OptionId.COM_B6);}
                if (credits >= 600f) {options.addOption("Buy 100 units of common minerals for 600 credits", OptionId.COM_B600);}
                if (credits >= 400f) {options.addOption("Buy 5 units of rare minerals for 400 credits", OptionId.RAR_B400);}
                if (credits >= 1600f) {options.addOption("Buy 20 units of rare minerals for 1600 credits", OptionId.RAR_B1600);}
                if (credits >= 2000f) {options.addOption("Buy 1 ton of exotic minerals for 2000 credits", OptionId.EXO_B1);}
            }
[close]

Each option has its own 'if selected' check and that is a huge list of similar 'do-this-do-that' operations that differ only by price and amount of bought/sold resources.

Here is an example of few of the options for different buy values of the same resource.

Spoiler
       else if (option == OptionId.COM_B10)
        {
            addText("Added 10 units of common minerals to your cargo bay. Payed 70 credits");
            cargo.addItems(CargoAPI.CargoItemType.RESOURCES, "materials1",  10);
            cargo.getCredits().subtract(70);
            optionSelected(null, OptionId.TRADE_RESOURCES);
        }

        else if (option == OptionId.COM_B60)
        {
            addText("Added 10 units of common minerals to your cargo bay. Payed 60 credits");
            cargo.addItems(CargoAPI.CargoItemType.RESOURCES, "materials1",  10);
            cargo.getCredits().subtract(60);
            optionSelected(null, OptionId.TRADE_RESOURCES);
        }
[close]

In game it looks perfect. You click an option - you get a message, lose money and receive bought stuff. But in the file its such a mess that i takes eons to scroll all the options to find the needed data. If there was a possibility to somehow use just one function for buy/sell with different variables being applied through add.option function or any other means - it would be much easier to code.


Pages: [1] 2 3