Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Pages: 1 ... 194 195 [196] 197 198 ... 711

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

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24157
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #2925 on: August 21, 2016, 09:28:06 AM »

@Mr. K:

  PlanetAPI gateway = system.addPlanet("gateway", blaze, "Gateway", "arid", 0, 100, 1000, 381);

Bolded parameter is the orbit radius; change that. No need to change the station if it's orbiting the planet, it'll be moved along with it.

To make the corona impassable (if that's what you're asking?) - increasing the solar wind should do the job. Something like 30 or so (since it's in "burn levels" would make sure any normal fleet can't get through it.


What's the meaning of :
"specialWeaponGlowWidth":15,
"specialWeaponGlowHeight":20,   

This is the size of the glow from stuff like the ammo feeder and the high energy focus. There are default values based on the ship sprite, but sometimes their size doesn't look right and these "special" values let you override that.

And, there are how many steps to deal damage? If the damage dealt at a Vector2f, how to calculate all the damage it takes?

That's hard to answer. Many? :) Too many to list here and have any hope for an exact calculation being correct.

I just need the gorram super (and separate) version of the tow cable and I will only get errors and a nervous breakdown if I were to strain myself with it since I suck at java and recently already went through a massive nervous breakdown and I prefer (for my own mental well-being) that somebody please help me to iron it out so it doesn't crash or something. I need that kryptonian tow cable!

Edited the code in your post so it formats nicely (=java after the "code" tag). The TowCable script is probably one of the trickier ones, so I'd be wary of messing with it. Chances of producing something that works but tanks performance are fairly high.

Also, kind of important: you didn't actually say what you want it to do; there's no question here :)
Logged

Drokkath

  • Captain
  • ****
  • Posts: 281
  • Xenophilic Mutant Commando
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #2926 on: August 21, 2016, 02:47:35 PM »

Edited the code in your post so it formats nicely (=java after the "code" tag). The TowCable script is probably one of the trickier ones, so I'd be wary of messing with it. Chances of producing something that works but tanks performance are fairly high.

Also, kind of important: you didn't actually say what you want it to do; there's no question here :)

I still don't understand it. If I were to right now think harder about it I'd just strain myself.

In my current state, all I can think of is where to even specify the burn level 1 of the regular tow cable to burn level 20+ for my super ships (its annoying when it slows down to a crawl when hauling another ship in the fleet).

This talk of lag and trying to understand coding right now is enough for me to just omit all non-fast ships and blowing them up instead or just making separate entries of them if I like a ship enough but can't make it go faster in the fleet by default. Also thinking of removing the tow cable from the two main modded ships since its +1 burn level for other ships is useless for me. Doesn't give me what my max burn playstyle needs but its just me feeling like crap.
Logged
For I dipt in to the future, far as my gazer eye could see; Saw the vision of the world, and all the wonder that would be.

Orikson

  • Captain
  • ****
  • Posts: 280
  • Always Seen on Discord
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #2927 on: August 22, 2016, 02:21:07 AM »

@Mr. K:

  PlanetAPI gateway = system.addPlanet("gateway", blaze, "Gateway", "arid", 0, 100, 1000, 381);

Bolded parameter is the orbit radius; change that. No need to change the station if it's orbiting the planet, it'll be moved along with it.

To make the corona impassable (if that's what you're asking?) - increasing the solar wind should do the job. Something like 30 or so (since it's in "burn levels" would make sure any normal fleet can't get through it.


Thanks!

I'm not sure which stats I need to modify for the star though. Just in case, here's the system's and star API:

//MAIN SYSTEM AND STAR
       
        StarSystemAPI system = sector.createStarSystem("Citadel");
        system.getLocation().set(-10000, 3000);
        system.setBackgroundTextureFilename("graphics/backgrounds/background2.jpg");

        PlanetAPI blaze = system.initStar("blaze", "star_blue", 250f, 1000f, 4f, 0.5f, 1.0f);
                                 
        blaze.setCustomDescriptionId("citadel_blaze");

What I meant by the star being passable was that I could fly my fleet straight over it. There was no push from the star.
Logged
"A story teller and a trader. Tell me your tales and I'll tell you no lies."

Come join the Starsector Fan Chat! It's decently active.

Link: https://discord.gg/eb5UC

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24157
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #2928 on: August 22, 2016, 07:50:11 AM »

        PlanetAPI blaze = system.initStar("blaze", "star_blue", 250f, 1000f, 4f, 0.5f, 1.0f);

Bolded the solar wind number. It's low, that's probably why you're not feeling much pushback.
Logged

Orikson

  • Captain
  • ****
  • Posts: 280
  • Always Seen on Discord
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #2929 on: August 22, 2016, 09:40:42 AM »

       PlanetAPI blaze = system.initStar("blaze", "star_blue", 250f, 1000f, 4f, 0.5f, 1.0f);

Bolded the solar wind number. It's low, that's probably why you're not feeling much pushback.

Ok, configured the changes. But they don't work after I've restarted.

After trying that, I did some digging through some other mods files. They have a far different set-ups, so maybe I'll have to adjust accordingly.

If any, which mod would a good example of stellar bodies arrangements? Or would it best just to refer to the core files?
« Last Edit: August 22, 2016, 10:06:07 AM by Mr. K »
Logged
"A story teller and a trader. Tell me your tales and I'll tell you no lies."

Come join the Starsector Fan Chat! It's decently active.

Link: https://discord.gg/eb5UC

c plus one

  • Commander
  • ***
  • Posts: 174
  • 'Make Jumpgates Great Again!'
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #2930 on: August 31, 2016, 12:11:23 AM »

Hello!
This thread seems to me that it's the best place to post a request for HELP with fixing a (somewhat?) basic modding mistake. If this isn't the best place to ask for aid, I apologize.


*Chronology*

The Sf-Edit ship editor program is great way to add, remove, alter, relocate, etc. weapon slots on ships. I made several slot changes to the Venture cruiser, and am cautiously optimistic with the result. I've used Sf-Edit dozens of times to make conceptually simple changes to ships, and it's never let me down yet. ;D

I then made multiple, manually-typed performance tweaks (installed refits, altered the slot contents, reorganized the weapon groups) to venture_Balanced.variant .

After slowly checking my code syntax, I saved the file and went to open the game and review my changes from inside the game's Refit Screen.

But before I even got to the main menu, boom! Crash to desktop!  :o


*The most relevant quote from starsector.log* :
Code
10679 [Thread-4] INFO  com.fs.starfarer.loading.SpecStore  - Loading variant [C:\Program Files (x86)\Fractal Softworks\Starsector\starsector-core\data\variants\venture\venture_Balanced.variant]
10679 [Thread-4] INFO  com.fs.starfarer.loading.LoadingUtils  - Loading JSON from [C:\Program Files (x86)\Fractal Softworks\Starsector\starsector-core\data\variants\venture\venture_Balanced.variant]
10684 [Thread-4] INFO  com.fs.profiler.Profiler  - ID     Calls   Duration    Percent
10684 [Thread-4] INFO  com.fs.profiler.Profiler  - --------------------------------
10685 [Thread-4] ERROR com.fs.starfarer.combat.CombatMain  - org.json.JSONException: Expected a ':' after a key at 462 [character 10 line 21]
org.json.JSONException: Expected a ':' after a key at 462 [character 10 line 21]
at org.json.JSONTokener.syntaxError(JSONTokener.java:423)
at org.json.JSONObject.<init>(JSONObject.java:208)
at org.json.JSONTokener.nextValue(JSONTokener.java:352)
at org.json.JSONArray.<init>(JSONArray.java:125)
at org.json.JSONTokener.nextValue(JSONTokener.java:356)
at org.json.JSONObject.<init>(JSONObject.java:210)
at org.json.JSONObject.<init>(JSONObject.java:311)
at com.fs.starfarer.loading.LoadingUtils.????00(Unknown Source)
at com.fs.starfarer.loading.LoadingUtils.?0000(Unknown Source)
at com.fs.starfarer.loading.SpecStore.????00(Unknown Source)
at com.fs.starfarer.loading.SpecStore.????00(Unknown Source)
at com.fs.starfarer.loading.ResourceLoaderState.init(Unknown Source)
at com.fs.state.AppDriver.begin(Unknown Source)
at com.fs.starfarer.combat.CombatMain.main(Unknown Source)
at com.fs.starfarer.StarfarerLauncher$1.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)


*Why this error code is such a problem for me* :

1) I have no idea what com.fs.starfarer.combat.CombatMain is & why it's important, nor what an org.json.JSONException is & why it's important. What these have to do with making very simple changes to installed refits & contents of weapon slots in a single ship variant file is completely opaque to me.

2) My text-editor (Notepad++; it's awesomely useful) shows absolutely nothing amiss inside of venture_Balanced.variant at character 10 line 21! I don't know why Starsector thinks I needed a colon typed there, or anywhere in that neighborhood.

Would someone kindly point out what I did wrong, why the game can't deal with it, and how I can fix the error? I would be grateful.
:)
Logged
Quote from: Lopunny Zen
you are playing them wrong then..

Don't tell me I'm playing anything wrong in a singleplayer sandbox game. Just don't.

TJJ

  • Admiral
  • *****
  • Posts: 1905
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #2931 on: August 31, 2016, 06:56:53 AM »

You'll need to post your modified venture_Balanced.variant.

Quote
1) I have no idea what com.fs.starfarer.combat.CombatMain is & why it's important, nor what an org.json.JSONException is & why it's important. What these have to do with making very simple changes to installed refits & contents of weapon slots in a single ship variant file is completely opaque to me.

com.fs.starfarer.combat.CombatMain is the class in which the exception is occurring.
org.json.JSONException is the class of the exception being thrown.

In the context of fixing your problem, neither is relevant; all that's important to you is:
Code
Loading JSON from [C:\Program Files (x86)\Fractal Softworks\Starsector\starsector-core\data\variants\venture\venture_Balanced.variant]
and
Code
Expected a ':' after a key at 462 [character 10 line 21]
Logged

c plus one

  • Commander
  • ***
  • Posts: 174
  • 'Make Jumpgates Great Again!'
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #2932 on: August 31, 2016, 02:13:08 PM »

You'll need to post your modified venture_Balanced.variant.

Quote
1) I have no idea what com.fs.starfarer.combat.CombatMain is & why it's important, nor what an org.json.JSONException is & why it's important. What these have to do with making very simple changes to installed refits & contents of weapon slots in a single ship variant file is completely opaque to me.

com.fs.starfarer.combat.CombatMain is the class in which the exception is occurring.
org.json.JSONException is the class of the exception being thrown.

I am ignorant of Java, but I thank you for taking the time!  :)


In the context of fixing your problem, neither is relevant; all that's important to you is:
Code
Loading JSON from [C:\Program Files (x86)\Fractal Softworks\Starsector\starsector-core\data\variants\venture\venture_Balanced.variant]
and
Code
Expected a ':' after a key at 462 [character 10 line 21]


As requested, here is my modded iteration of venture_Balanced.variant:
Code
{
    "displayName": "Balanced",
    "fluxCapacitors": 20,
    "fluxVents": 20,
    "hullId": "venture",
    "hullMods": [
"targetingunit",
"stabilizedshieldemitter"
],
    "quality": 0.5,
    "variantId": "venture_Balanced",
    "weaponGroups": [
        {
{
            "autofire": false,
            "mode": "ALTERNATING",
            "weapons": {
                "WS 004": "sabot",
                "WS 007": "sabot"
            }
        },
            "autofire": false,
            "mode": "ALTERNATING",
            "weapons": {
                "WS 005": "harpoonpod",
                "WS 006": "harpoonpod"
            }
        },
{
            "autofire": false,
            "mode": "LINKED",
            "weapons": {
"WS 002": "miningblaster"
}
        },
        {
            "autofire": true,
            "mode": "ALTERNATING",
            "weapons": {
                "WS0003": "lightdualac",
                "WS0004": "lightdualac",
"WS0005": "chaingun",
                "WS0006": "chaingun",
"WS0009": "lightmortar",
                "WS0010": "lightmortar"
            }
        },
        {
            "autofire": true,
            "mode": "LINKED",
            "weapons": {
                "WS 001": "flak",
                "WS 003": "flak",
"WS0001": "mininglaser",
"WS0002": "mininglaser",
"WS0011": "taclaser",
"WS0012": "lightmg",
"WS0013": "lightmg"
            }
        }
    ]
}

I can only assume that code-wise there's something wrong with my syntax, but I cannot identify what. Any ideas what it might be?

For example, I see here that the <code> feature of this forum software causes a ton of extra indents that do not exist in the Notepad++-viewed original of my .variant file; that version is far neater with its whitespace. What I put into <code> above is literally no more than a direct Select All/Copy/Paste from there to here.  ???  I've made NO formatting changes in the Preferences of Notepad++, relative to all of the other modded *.ship and *.variant files that Starsector accurately loads error-free.
Logged
Quote from: Lopunny Zen
you are playing them wrong then..

Don't tell me I'm playing anything wrong in a singleplayer sandbox game. Just don't.

FlashFrozen

  • Admiral
  • *****
  • Posts: 988
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #2933 on: August 31, 2016, 03:59:25 PM »

You've modified the venture variant, with what i'm assuming is either notepad or something

It still seems to retain the original weapon groups and weaponslots so it's conflicting and most likely giving you the errors.

The venture has 7 weapon slots, you have 3 weapon groups of mixed and matched slots sizes and type with 8 different weapons.

8 weapons in 7 slots?
Probably best to redo the modded variant, you are already over op but that's fine, but you'll need to correct the weapons.
« Last Edit: August 31, 2016, 04:04:26 PM by FlashFrozen »
Logged

Obsidian Actual

  • Commander
  • ***
  • Posts: 105
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #2934 on: August 31, 2016, 06:28:57 PM »

Greetings,

After happening upon dmaiski's "armor regeneration" weapon plugin script (http://fractalsoftworks.com/forum/index.php?topic=6452.msg131192#msg131192) from the Radioactive Code Dump, I've managed to link it to a custom invisible weapon that can be mounted on a ship's hardpoint.

The thing is, I now want the script to run if (and only if) the weapon group to which the player has assigned the invisible regen weapon, has toggled that group's autofire to on. This way, the player can simply press Ctrl+(#) to activate/deactivate the armor regeneration during combat, as well as granting them finer control over the hard flux build-up that is in place to balance its usage.

Currently in the public void advance(float v, CombatEngineAPI engineAPI, WeaponAPI weaponAPI) that contains the looping regen code, there is an if conditional that checks if the game is paused or if the weapon is disabled, then simply returns nothing to prevent armor regeneration:

Code
if (engine.isPaused() || weaponAPI.isDisabled())
{
    return;
}

I wish to expand this conditional by adding another OR check to see if the boolean isAutoFiring() is equal to false, but that boolean belongs to WeaponGroupAPI rather than WeaponAPI, and I couldn't find any methods inside WeaponAPI that allows me to look up the current weapon group that the script-attached weapon belongs to.

Something tells me the solution is ridiculously simple, but given how bad I am at Java OOP in general, I'm probably not even seeing it. Any ideas?
Logged

Obsidian Actual

  • Commander
  • ***
  • Posts: 105
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #2935 on: August 31, 2016, 07:09:31 PM »

Never mind, that was hasty of me.

Turns out that ShipAPI has the method WeaponGroupAPI getWeaponGroupFor(WeaponAPI weapon), which returns the weapon group for whatever weapon argument is fed into the WeaponAPI weapon parameter.

Code
ShipAPI ship;
ship=weaponAPI.getShip();

if (engine.isPaused() || weaponAPI.isDisabled() || !( ship.getWeaponGroupFor(weaponAPI).isAutofiring() ) )
{
    return;
}

With this boolean check in place, I now have a working AutoFire toggle for armor regeneration! Now to start balancing the hard flux costs for multiple copies of the module across different hull sizes (ugh)...
Logged

Harmful Mechanic

  • Admiral
  • *****
  • Posts: 1340
  • On break.
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #2936 on: August 31, 2016, 10:18:42 PM »

Is it possible to do animated commodity images?
Logged

TJJ

  • Admiral
  • *****
  • Posts: 1905
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #2937 on: September 01, 2016, 05:20:49 AM »

I can only assume that code-wise there's something wrong with my syntax, but I cannot identify what. Any ideas what it might be?

Line 13, you've got an extraneous opening brace.

I suggest you use a proper json editor; it'll make errors like this obvious.
(Eclipse json editor screenshot)


Also, unless you've made some significant changes to the venture.ship hull, you're using a lot of invalid weapon slot Ids.
« Last Edit: September 01, 2016, 05:22:54 AM by TJJ »
Logged

Obsidian Actual

  • Commander
  • ***
  • Posts: 105
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #2938 on: September 01, 2016, 03:19:50 PM »

Hello again,

A few weird issues have sprung up, and I was hoping if anyone could shed some light on them.



Firstly, that armor regeneration "weapon" script I was working on a few posts back? I've been making use of the void maintainStatusForPlayerShip(Object key, String spriteName, String title, String data, boolean isDebuff) method from engineAPI to display the current armor percentage, in a fashion similar to those buff/debuff indicators in the bottom left widget of the combat interface.

Code
private String AAG_SPRITE = "Sprite Path Goes Here";

...
...

if (player)
{
    if ( (int)currArmorPercentage < 100 )
    {
        engine.maintainStatusForPlayerShip(STATUSKEY_REPAIR_PERCENT, AAG_SPRITE, weaponAPI.getDisplayName(), "armor integrity: " + String.format("%.2f", currArmorPercentage) + "%", true);
    } else {
        engine.maintainStatusForPlayerShip(STATUSKEY_REPAIR_PERCENT, AAG_SPRITE, weaponAPI.getDisplayName(), "armor integrity: " + String.format("%.2f", currArmorPercentage) + "%", false);
    }
}

...
...

While the indicators are showing up fine in-game, the green mono-colored icon to the left sometimes doesn't show up at all, depending on what I put into private String AAG_SPRITE, which in turn, is passed onto the String spriteName parameter.

For instance, in my mod's folder, I have a graphics/icons/hullsys/advanced_phase_cloak.png (which is really just a copy/paste of the vanilla phase_cloak.png). When I feed that as the path string, it shows up fine (albeit with some weird random artifacts at times, probably an engine issue).

But for some reason, that appears to be the only icon that works properly. If I, say, copy the damper_field.png icon from vanilla and paste it into my mod folder as ablative_armor_generator.png, using graphics/icons/hullsys/ablative_armor_generator.png as the path string results in a blank icon instead.

Other than making file renames, I haven't touched the icons' pixels themselves with any image editors, and I've also made sure that there are no multiple copies in both the vanilla core folders and my own mod folder... yet there is no way for me to reliably predict whether an icon will work or not.

Might this have anything to do with the way the game engine looks up the icon path? Do I need to include the parent directory (i.e. the name of my mod) in the path name as well, to explicitly separate it from the vanilla path?



The second one is much more minor: a custom ship I am working on (in the same mod folder) has its own entry in a new ship_data.csv, where it is listed as Phase Frigate under the designation column. Since that's two words, however, when in-game and entering a custom variant name in the Refit screen, the game engine has a nasty habit of separating those two words and shoving the variant input field in the middle, like Phase [Enter Variant Name] Frigate.

Most ships in vanilla only use one word for their designation, and they simply end up like [Enter Variant Name] Frigate. I've even seen the Hound, which is designated as a Combat Freighter, show up in game as [Enter Variant Name] Combat Freighter.

Is the game engine hardcoded to make an exception for ships with the word "Phase" in their designations? Is there some way to work around it, or should I just use another word other than "Phase" instead?


Logged

gruberscomplete

  • Captain
  • ****
  • Posts: 253
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #2939 on: September 02, 2016, 10:43:29 AM »

Fleets in my mod RWS (deadly fighters) fly with transponders off.

Fleets do not have "captains".


- How do I make them turn on transponders and have captains?
Logged
Click here for FREE ships!               Plentysector               Robots With Souls
Pages: 1 ... 194 195 [196] 197 198 ... 711