Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Pages: 1 ... 172 173 [174] 175 176 ... 710

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

nuclear_ash

  • Ensign
  • *
  • Posts: 4
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #2595 on: December 18, 2015, 11:45:29 PM »

What magic is behind the tug ship? Why there's always only 1 ship of that type even in the mods? And where to look for tug cable buff code? Say if I want to change it from +1 burn to +2 burn.
« Last Edit: December 19, 2015, 03:11:14 AM by nuclear_ash »
Logged

speeder

  • Captain
  • ****
  • Posts: 364
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #2596 on: December 19, 2015, 12:14:45 PM »

How I add some initial stock of stuff before the "economy stabilization" so that after it finishes markets already have industrial goods for sale (instead of still picking up to speed with the initial raw material production) ?

I tried adding a market

Code
@Override
    public void onNewGame()
    {
        super.onNewGame();
        initialStockMarket = Global.getFactory().createMarket("initial_stock", "initial stock", 9);
        initialStockMarket.getCommodityData(Commodities.HEAVY_MACHINERY).setAverageStockpile(1000000000000f);
        initialStockMarket.setFactionId(Factions.INDEPENDENT);
        Global.getSector().getEconomy().addMarket(initialStockMarket);
    }

But it didn't worked, seemly.
Logged

murumuru

  • Ensign
  • *
  • Posts: 7
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #2597 on: December 19, 2015, 04:47:28 PM »

I am creating generic fleets using FleetFactoryv2, thus using FleetParams.
What do following parameters do and mean?
Code
java.lang.String fleetType
float qualityBonus
float qualityOverride
float officerNumMult
int levelLimit
I did not find the descriptions in the docs, if I missed them then I would be grateful for a link.

Next are the questions about FleetAssignment.
Can I send the fleet into another system just by something like
Code
fleet.addAssignment(FleetAssignment.RAID_SYSTEM, randomSectorEntityToken, days);
, if I can do so, then is time to travel included into days or they start counting only when fleet arrives into target system?
Will it look around the system for targets or will stay near the randomSectorEntityToken?
If fleet will not travel to the system due to some reason, will it just abandon the task and start next one?
Will FleetAssignment.GO_TO_LOCATION_AND_DESPAWN despawn fleet if the fleet will not be able to reach the location before the end of the days allocated for the assignment?
Is it even possible to send fleet to entity in another system, if yes, then how?

And at last, is there a description of .faction file structure?
In particular, I am interested in "custom" section: what is available and still works there and "shipRoles".
« Last Edit: December 19, 2015, 06:42:03 PM by murumuru »
Logged

StarSchulz

  • Captain
  • ****
  • Posts: 458
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #2598 on: December 19, 2015, 09:28:56 PM »

Can anyone point me in the right direction on starting a faction mod? there has got to be some kind of tips page around here somewhere! x.x I finally think i have a reasonable idea on where i want to go with it, but i don't know how to code it all unless i spend a week tearing apart and reverse engineering an existing faction mod.

Histidine

  • Admiral
  • *****
  • Posts: 4688
    • View Profile
    • GitHub profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #2599 on: December 19, 2015, 10:15:04 PM »

What magic is behind the tug ship? Why there's always only 1 ship of that type even in the mods?
Not sure what you mean. Are you saying there aren't enough tugs in the store? That's controlled by the submarket plugin for each submarket type.
And where to look for tug cable buff code? Say if I want to change it from +1 burn to +2 burn.
com/fs/starfarer/api/impl/campaign/TowCable.java
(make a modified version of this Java class and make the tow_cable entry (or your own hullmod) in hull_mods.csv point to your class)

How I add some initial stock of stuff before the "economy stabilization" so that after it finishes markets already have industrial goods for sale (instead of still picking up to speed with the initial raw material production) ?

I tried adding a market

Code
@Override
    public void onNewGame()
    {
        super.onNewGame();
        initialStockMarket = Global.getFactory().createMarket("initial_stock", "initial stock", 9);
        initialStockMarket.getCommodityData(Commodities.HEAVY_MACHINERY).setAverageStockpile(1000000000000f);
        initialStockMarket.setFactionId(Factions.INDEPENDENT);
        Global.getSector().getEconomy().addMarket(initialStockMarket);
    }

But it didn't worked, seemly.
Try setting the (non-average) stockpile as well.
Or if you need stuff added to cargo, there's this (though I have no idea if it's actually necessary or even does anything):
Code: java
        if (market.getFactionId().equals("templars"))
        {
            CargoAPI cargoTemplars = market.getSubmarket("tem_templarmarket").getCargo();
            cargoTemplars.addCommodity(commodityID, amountToAdd * 0.2f);
            return;
        }
        if (market.getSubmarket(Submarkets.SUBMARKET_OPEN) == null)    // some weirdo mod
        {
            return;
        }
       
        CargoAPI cargoOpen = market.getSubmarket(Submarkets.SUBMARKET_OPEN).getCargo();
        CargoAPI cargoBlack = cargoOpen;
        if (market.hasSubmarket(Submarkets.SUBMARKET_BLACK))
            cargoBlack = market.getSubmarket(Submarkets.SUBMARKET_BLACK).getCargo();
        CargoAPI cargoMilitary = null;
        if (market.hasSubmarket(Submarkets.GENERIC_MILITARY))
            cargoMilitary = market.getSubmarket(Submarkets.GENERIC_MILITARY).getCargo();
       
        if (commodityID.equals("agent") || commodityID.equals("saboteur"))
        {
            if (cargoMilitary != null)
            {
                cargoOpen.addCommodity(commodityID, amountToAdd * 0.02f);
                cargoMilitary.addCommodity(commodityID, amountToAdd * 0.11f);
                cargoBlack.addCommodity(commodityID, amountToAdd * 0.02f);
            }
            else
            {
                cargoOpen.addCommodity(commodityID, amountToAdd * 0.04f);
                cargoBlack.addCommodity(commodityID, amountToAdd * 0.11f);
            }
        }
        else if(!market.isIllegal(commodity))
            cargoOpen.addCommodity(commodityID, amountToAdd * 0.15f);
        else if (commodityID.equals("hand_weapons") && cargoMilitary != null)
        {
            cargoMilitary.addCommodity(commodityID, amountToAdd * 0.1f);
            cargoBlack.addCommodity(commodityID, amountToAdd * 0.05f);
        }
        else
            cargoBlack.addCommodity(commodityID, amountToAdd * 0.1f);

I am creating generic fleets using FleetFactoryv2, thus using FleetParams.
What do following parameters do and mean?
Code
java.lang.String fleetType
float qualityBonus
float qualityOverride
float officerNumMult
int levelLimit
I did not find the descriptions in the docs, if I missed them then I would be grateful for a link.
qualityBonus adds to the market's stability for determining the allowed variants (like how fleets from badly destabilized markets have more (D) ships).
qualityOverride ignores the stability value completely and just uses the specified quality threshold (0.0 - 1.0).
officerNumMult allows more officers in the fleet, of course (still limited to 10).
levelLimit caps the level of officers in the fleet.
Logged

murumuru

  • Ensign
  • *
  • Posts: 7
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #2600 on: December 20, 2015, 01:31:48 AM »

qualityOverride ignores the stability value completely and just uses the specified quality threshold (0.0 - 1.0).
What do I use to avoid the override, just zero?
Logged

Stalker

  • Lieutenant
  • **
  • Posts: 65
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #2601 on: December 20, 2015, 12:47:38 PM »

My game keeps hard crashing Java SE with no error on new campaign start, whenever it tries to spawn a patrol for one of my new planets:

44185 [Thread-5] INFO  com.fs.starfarer.api.impl.campaign.fleets.PatrolFleetManager  - 0 out of a maximum 4 patrols in play for market [Shivan Origin]

Right after that, the game hard crashes. Anyone have any ideas?

EDIT1: Commenting out the sector file in question allows the new game to be created. What could be wrong with my sector java file? I made it based on other ones I made that actually work. Here it is: https://github.com/mechwars/Freespace/blob/initial-version/sources/data/scripts/world/freespace/Cocytus.java

EDIT2: I just tried copying an existing system that worked and just changed the faction. Crash. Could the faction file be the issue? I'm boggled here without an error message to work with.

EDIT3: Redid the faciton file and I'm still getting the crash. Changed the system to use a different faction, and it loads fine. I have no idea why the faction is crashing on load with no error.

SOLVED: You can't have 0 probability for smalls ships in your faction file. Your faction must have some chance for small ships, or a new game will just crash on load. Not sure if this is a bug or not, but it was the one key difference between the faction that crashed and the ones that didn't.

This faction doesn't have carriers, so I'm just having it fall back to combat ships if it picks one.
« Last Edit: December 21, 2015, 04:40:06 AM by Stalker »
Logged

Histidine

  • Admiral
  • *****
  • Posts: 4688
    • View Profile
    • GitHub profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #2602 on: December 20, 2015, 08:16:01 PM »

qualityOverride ignores the stability value completely and just uses the specified quality threshold (0.0 - 1.0).
What do I use to avoid the override, just zero?
-1
Logged

TrashMan

  • Admiral
  • *****
  • Posts: 1325
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #2603 on: December 21, 2015, 03:32:59 AM »

I'm having trouble getting my beam cannons to look right.

Do these lines:
   "fringeColor":[250,250,220,255],
   "coreColor":[5,255,10,155],
   "glowColor":[0,255,10,255],
   "width":10.0,

Even do anything?
Also, is it R,G,B, luminosity? Or is the other different.

Currently, my beams are far too wide and far too white.
Logged

Stalker

  • Lieutenant
  • **
  • Posts: 65
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #2604 on: December 21, 2015, 04:20:37 AM »

I'm having trouble getting my beam cannons to look right.

Do these lines:
   "fringeColor":[250,250,220,255],
   "coreColor":[5,255,10,155],
   "glowColor":[0,255,10,255],
   "width":10.0,

Even do anything?
Also, is it R,G,B, luminosity? Or is the other different.

Currently, my beams are far too wide and far too white.

It's RGB+Luminosity. You have that right.

I believe the order in-game goes core -> fringe -> glow. So right now, your almost-white glow has a whole lot more luminosity than your core, which is probably contributing to the all white issue.

I'm not sure why your beam is wide. 10f is not a very wide beam.
Logged

TrashMan

  • Admiral
  • *****
  • Posts: 1325
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #2605 on: December 21, 2015, 04:07:19 PM »

Can you make an animated turret base?

I basically wanted to make an animated Vertical Launch Missile System:
Here's part of the code

Code
{
"id":"vns_mis_cruise1",
"specClass":"projectile",
"type":"MISSILE",
"size":"LARGE",
"turretUnderSprite":"graphics/weapons/animated/vmls/vmls00.png",
"turretSprite":"",
"hardpointSprite":"",

"numFrames":5,
"frameRate":30,

The graphiccs are there, but any time I try to start the game it complains that it cannot load image [01]
 
Logged

speeder

  • Captain
  • ****
  • Posts: 364
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #2606 on: December 22, 2015, 09:49:00 AM »

What is the game engine encoding?

ie: What is the encoding on strings on the source, on csv files, and on json files?

here csv files keep breaking, I am suspecting it is a encoding issue (because I am in Brazil, thus many of my apps use Windows-1252 encoding... also my Windows itself is set to use japanese encoding because of japanese games I have here).

Also if I ever wanted to write stuff in my own language (Brazillian portuguese), knowing the encoding is needed too (the Ç character byte for example, change a lot between each possible encoding)
Logged

Snrasha

  • Admiral
  • *****
  • Posts: 705
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #2607 on: December 22, 2015, 10:11:58 AM »

Hi, i search script who change parameter according to difficulty. But, i have just find in CharacterCreationData : setdifficulty and getdifficulty, but i do not find parameter. (Less salvage, for example, with easy difficult)


Thank you.

update: I have see in rule.csv:
Quote
ngcDifficultyOptions,NGCStep3,,"SetTooltip ngcEasy ""- Reduces damage taken by 50%\n- Increases damage dealt by 50%\n- Increases sensor range by 500 units\n- Increases salvage by 50%\n- Reduces level of enemy officers by 50%\n- Extra 10,000 credits\n- Extra starting ship & officer""

SetTooltipHighlightColors ngcEasy hColor hColor hColor hColor hColor hColor

SetTooltipHighlights ngcEasy ""50%"" ""50%"" ""500"" ""50%"" ""50%"" ""10,000""
[...]
ngcEasyOption,NewGameOptionSelected,$option == ngcEasy,"AddText ""- Reducing damage taken by 50%\n- Increasing damage dealt by 50%\n- Increasing sensor range by 500 units\n- Increasing salvage by 50%\n- Reducing level of enemy officers by 50%"" textFriendColor
But...
« Last Edit: December 22, 2015, 12:54:13 PM by Snrasha »
Logged
I am pretty bad on english. So, sorry in advance.

Gladiator Society
Add battle options on Com Relay/ Framework for modders for add their own bounty.

Sanguinary Autonomist Defectors A fan-mod of Shadowyard.

speeder

  • Captain
  • ****
  • Posts: 364
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #2608 on: December 22, 2015, 03:29:27 PM »

How I get all commodities on the market of a certain demand type? (example: Lobster and Luxury goods at the same time, or all types of crew at the same time)
Logged

Histidine

  • Admiral
  • *****
  • Posts: 4688
    • View Profile
    • GitHub profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #2609 on: December 23, 2015, 08:13:16 AM »

In commodities.csv, does a larger number in the decay column mean the commodity decays faster or slower?
Logged
Pages: 1 ... 172 173 [174] 175 176 ... 710