Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Starsector 0.9.1a is out! (05/10/19); Updated the Forum Rules and Guidelines (02/29/20); Blog post: GIF Roundup (04/11/20)

Pages: 1 ... 431 432 [433] 434 435 ... 444

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

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 16619
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6480 on: May 30, 2020, 04:32:10 PM »

You can also do list.toArray(new String[0]) which returns a "String []"
Logged

Morrokain

  • Admiral
  • *****
  • Posts: 1357
  • Megalith Dreadnought - Archean Order
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6481 on: May 30, 2020, 04:54:19 PM »

You can also do list.toArray(new String[0]) which returns a "String []"

Can this same technique be used to set multiple highlight colors in the same paragraph using LabelAPI.setHighlightColors(Color... colors)? (Don't have time to test it at the moment)

So I could set a color option per highlight wrapper and then pass in the colors in the same order as the highlight list?

Like:

Code
Color[] colors = list.toArray(new Color[0]);
LabelAPI.setHighlightColors(colors);
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 16619
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6482 on: May 30, 2020, 05:09:13 PM »

Yep!
Logged

Morrokain

  • Admiral
  • *****
  • Posts: 1357
  • Megalith Dreadnought - Archean Order
    • View Profile
Logged

Üstad

  • Ensign
  • *
  • Posts: 37
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6484 on: May 31, 2020, 06:08:44 AM »

Spoiler
Looks like that mod also provides the source for reference. But when the game runs, it's using the compiled code from the jar. In that case, changing that code wouldn't do anything, you'd need to recompile it and replace the jar.
I don't want to derail the thread but how to do what you're saying in this post? I really don't know where to look, any help would be appreciated. Thanks for help  :)

You are editing a part of the provided source code that is not actually loaded. Starsector loads the contents of the provided .jar file, which is the compiled version of what you are playing around with.
To compile code, you need an IDE, usually IntelliJ or Netbeans are suggested.

If you have no idea what you are doing, consider following a part of the tutorial that requires code compilation from here:
https://starsector.fandom.com/wiki/Intro_to_Modding

which will give you a better overview of how making a Starsector mod works.
You could also come join the Discord, where a lot of very helpful people can answer your questions quicker than they will be answered here.
[close]
I decompiled it with intellij idea but the file says it's read only even though I checked it and made sure it's not a read only file. It's a .class file btw.
Logged

Professor Pinkie

  • Ensign
  • *
  • Posts: 23
  • Best cupcakes in a sector!
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6485 on: May 31, 2020, 09:23:01 AM »

I have created a ship, and everything works as intended. But still need some help with:

1. Description. It is looks like descriptions.csv in custom mod folder should not be edited with ordinary text editor, just like ship_data.csv. While ship_data.csv can be edited via SWE, it is looks like it can't work with descriptions. Is there any tools?

2. Tags. What shall I use to ensure:
-Non of a factions will not use this hull. Never.
-Non of markets will not sale this hull in a shop. Never.
-BP drops only as rare_bp, but with much smaller probability, like 1/20 of default BP of a same kind. Which rarity value shall I set for this?

3. Is there any possibility to make shiphull available for player-ordered building after BP is acquired, but not available for player faction's generated fleets not to use it?

Thank you!

EDIT: Typo.
« Last Edit: May 31, 2020, 09:25:08 AM by Professor Pinkie »
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 16619
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6486 on: May 31, 2020, 08:46:06 PM »

I decompiled it with intellij idea but the file says it's read only even though I checked it and made sure it's not a read only file. It's a .class file btw.

It sounds like you took a wrong turn somewhere. What you'd want to be doing is creating your own source file, compiling it, and also providing - in your mod - a file that points to your class instead of the vanilla one. E.G. if you were replacing an industry's code, you'd have your own version of it, and an entry in your mod's industries.csv, etc.

1. Description. It is looks like descriptions.csv in custom mod folder should not be edited with ordinary text editor, just like ship_data.csv. While ship_data.csv can be edited via SWE, it is looks like it can't work with descriptions. Is there any tools?

I don't know what external tools would work out of the box. I know excel can be configured to produce csv files the game can read, but I don't know the details. Personally I use google sheets and its "download as csv" option, so whatever format that ends up as, the game reads.

2. Tags. What shall I use to ensure:
-Non of a factions will not use this hull. Never.

As long as it's not in a blueprint package and none of the factions are configured (via their .faction file) to have it, they won't have it.

-Non of markets will not sale this hull in a shop. Never.
-BP drops only as rare_bp, but with much smaller probability, like 1/20 of default BP of a same kind. Which rarity value shall I set for this?

If you want 1/20, rarity would be 0.05.

3. Is there any possibility to make shiphull available for player-ordered building after BP is acquired, but not available for player faction's generated fleets not to use it?

I don't believe so.
Logged

Mongreal

  • Ensign
  • *
  • Posts: 46
    • View Profile
    • Email
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6487 on: June 01, 2020, 02:22:53 AM »

Hello,

I'm back on Starsector modding once again, and I was wondering how does pulse weapons works, and if there was a way to use the pulse charging effect on non pulse weapon, like a ballistic artillery. Is there an easy way around ?
Or would that involve scripting a custom behavior for the weapon as en everyframe effect (I guess checking for the charge level until it get back to 0 could work for the percentage of charge, but how can I make a weapon fire with a everyframe plugin ?)
If anyone is familiar with thoses things, feel free to pm me, thanks !
Logged

Professor Pinkie

  • Ensign
  • *
  • Posts: 23
  • Best cupcakes in a sector!
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6488 on: June 01, 2020, 02:58:31 AM »

google sheets

Can't believe answer was so easy. Probably that is why I didn't try it by myself.

Thank you!

Logged

Morrokain

  • Admiral
  • *****
  • Posts: 1357
  • Megalith Dreadnought - Archean Order
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6489 on: June 01, 2020, 01:59:20 PM »

1. Description. It is looks like descriptions.csv in custom mod folder should not be edited with ordinary text editor, just like ship_data.csv. While ship_data.csv can be edited via SWE, it is looks like it can't work with descriptions. Is there any tools?

I don't know what external tools would work out of the box. I know excel can be configured to produce csv files the game can read, but I don't know the details. Personally I use google sheets and its "download as csv" option, so whatever format that ends up as, the game reads.

You can use a text editor to edit descriptions iirc (I used notepad) or you can use Excel or OpenOffice Spreadsheet editor. For editors you just use commas as your deliminator. (Should be one of the first settings available when opening the file).

What you can't do (at least not without caution or errors will occur) is mix and match tools. So once you choose one you mostly have to stick with it because the formats between tools cause hidden escaped characters to be misread as actual characters (my theory) when switching between formats.

In general, you have to be careful using quotes and commas when editing descriptions, and always back up your file before you make any edits. Every time. Seriously. If you get into a situation where a hidden escape character is causing an issue you won't be able to fix it to my knowledge. The file will look completely normal in a text editor but Starsector won't be able to read it correctly. For instance, if you use quotes in notepad to separate your text cells and then add nested quotes within the quotes, they have to be escaped iirc. If you use quotes to wrap your text and then open it in an editor- the quotes might disappear and they might not. Depends upon the editor. Using notepad I think I used ' as quote wrappers and " as cell wrappers. New lines are captured in notepad as well as editors.

Notepad Example:

Code
archean_avalanche,WEAPON,"A powerful strike cannon that uses the ship's own power core to generate enough energy to fire a massive projectile. Completely decimates armor. Flux inefficiency and low ammo storage prevent this weapon from dominating the sector's ballistic demand.

The avalanche is an older design most notably used by the Luddic Church, independents and pirates as a way to combat heavily armored targets with enough point defense to defend against explosive missiles that would otherwise perform the same role. The weapon must draw a non-insignificant amount of power from the defensive shield systems to effectively maintain prolonged fire.

Even if the clip size was larger, most vessel's power cores would be severely stressed by more than a couple of these weapons installed.",Strike,,
« Last Edit: June 01, 2020, 02:01:34 PM by Morrokain »
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 16619
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6490 on: June 01, 2020, 02:56:05 PM »

Hello,

I'm back on Starsector modding once again, and I was wondering how does pulse weapons works, and if there was a way to use the pulse charging effect on non pulse weapon, like a ballistic artillery. Is there an easy way around ?
Or would that involve scripting a custom behavior for the weapon as en everyframe effect (I guess checking for the charge level until it get back to 0 could work for the percentage of charge, but how can I make a weapon fire with a everyframe plugin ?)
If anyone is familiar with thoses things, feel free to pm me, thanks !

Pulse weapons are extremely deprecated so I'd recommend not using them. Unless you just mean adding a chargeup time  to a weapon firing? Or do you mean the (very, very old) "hold button to charge, release to fire" behavior?
Logged

Professor Pinkie

  • Ensign
  • *
  • Posts: 23
  • Best cupcakes in a sector!
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6491 on: June 02, 2020, 08:22:16 AM »

One more question: is it possible to change a frontal shield direction? Particularly, can I made a rear shield instead of a front?

I know, I can just rotate a sprite and pilot ship backward. Also, I can add an invisible module with shield emitter, similar to station modules. But redirection of a frontal shield would give the best gameplay experience.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 16619
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6492 on: June 02, 2020, 11:03:56 AM »

It's not possible, no. Even if it were, the ship's AI wouldn't really be aware of it, so that would be a problem...
Logged

Professor Pinkie

  • Ensign
  • *
  • Posts: 23
  • Best cupcakes in a sector!
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6493 on: June 03, 2020, 08:58:30 AM »

It's a pity! That would be a really interesting concept.

Anyway, thanks for putting up with my stupid questions. let it be of no use to community, the process itself is very, very interesting to me.
Logged

shoi

  • Commander
  • ***
  • Posts: 115
    • View Profile
    • Email
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6494 on: June 04, 2020, 02:44:01 AM »

Is there a way to force a ship to render over another/ alter its render level?

Obviously this isn't possible normally, but I have a ship that's set to fighter collisionclass on creation.
Before, it would render above everything , so it looked like it was flying over other ships. I don't know what I did, but that doesn't seem to be the case anymore, and now it only renders over ships that are above its weight class (it's a frigate), and when it flies over other frigates, it goes below them

its really triggering my OCD, any help would be appreciated

EDIT: I made a new game and it works, ship flies over everything...didn't touch the script or anything..weeeird

« Last Edit: June 04, 2020, 02:49:15 AM by shoi »
Logged
Pages: 1 ... 431 432 [433] 434 435 ... 444