Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Starsector 0.97a is out! (02/02/24); New blog post: Simulator Enhancements (03/13/24)

Pages: 1 ... 53 54 [55] 56 57 ... 93

Author Topic: [0.96a] Console Commands v2023.05.05  (Read 1536154 times)

Username356

  • Ensign
  • *
  • Posts: 3
    • View Profile
Re: [0.9.1a] Console Commands v3.0 WIP 7.6 (released 2018-12-07)
« Reply #810 on: April 26, 2020, 10:45:23 AM »

Quote
English isnt my main languange

We are in a same situation.

So, is it help?

Yes. that is all i need, thank you for your help. that is all i need and i hope you had a good day over there.
Logged

Alluvian

  • Lieutenant
  • **
  • Posts: 53
    • View Profile
Re: [0.9.1a] Console Commands v3.0 WIP 7.6 (released 2018-12-07)
« Reply #811 on: April 28, 2020, 10:46:55 AM »

Is it possible to add a military submarket to an already generated market?

I've also wondered about this, and I think it might be possible with runcode, but I have no idea what kind of reference or how to write out the line to enact it.
Looking through Exerelin, there's a "submarkets.csv" which lists several different ones including exerelin_prismMarket, open_market, black_market, and generic_military which has the description:
"Trade with $theFaction military base.

Weapons and other military hardware can be bought and sold here even if they're illegal on the open market. A commission and better standing with $theFaction results in higher-grade hardware being available.

Will buy locally illegal goods as part of a no-questions-asked buyback program.

Selling enough of a commodity will temporarily resolve a shortage."

So that's definitely it. And, no, in case you're wondering "addcondition" and "addindustry" doesn't work. But you should be able to somehow add it. Someone that knows more about how runcode works could probably decipher it.

I'm also interested, too, because none of my own colonies have military markets and it would be nice to have them to stock up on weapons and marines/crew occasionally. I mean, it would make sense, especially if they already have a military base on them.

While a bit belated, here is how you can add a submarket (to an existing market) with runcode. First, you need the string (name) of the market. For this example, the market name is "garden_market".
Code
runcode for (int i = 0; i < 1; i++) {MarketAPI market = Global.getSector().getEconomy().getMarket("garden_market"); market.addSubmarket("generic_military");}

Iterating over a list of markets should also be possible.
Code
String listMarkets[] = new String[]{"garden_market", "ring_market"};
for (String marketStr : listMarkets) {...}
Logged

Stelarwand030

  • Lieutenant
  • **
  • Posts: 58
    • View Profile
Re: [0.9.1a] Console Commands v3.0 WIP 7.6 (released 2018-12-07)
« Reply #812 on: April 30, 2020, 01:38:27 AM »

@LazyWizard

I was just wondering but is there a command that just adds only ships of a mod instead of all of them at once? Something like allhulls (mod x) and only mod x ships are added to the storage.

I have over a dozen mods active and when I use the allhulls command the game slows way down then eventually crashes.
Logged

Üstad

  • Commander
  • ***
  • Posts: 131
    • View Profile
Re: [0.9.1a] Console Commands v3.0 WIP 7.6 (released 2018-12-07)
« Reply #813 on: May 03, 2020, 03:36:13 PM »

I figured out how to create a planet and make it orbit a star but for some reason I couldn't make it work to make "planet a" orbit "planet b" can anyone help me with that?
Logged

Nivri

  • Ensign
  • *
  • Posts: 27
    • View Profile
Question About a Command
« Reply #814 on: May 03, 2020, 10:33:22 PM »

Is there any command to remove the planet's "hate" to you? I kept on destroying pirate vessels that I can't trade with them anymore. It says "It would take months for the commosion ...." Maybe there is a command in the console command list?
Logged

Nivri

  • Ensign
  • *
  • Posts: 27
    • View Profile
Re: [0.9.1a] Console Commands v3.0 WIP 7.6 (released 2018-12-07)
« Reply #815 on: May 05, 2020, 07:31:20 AM »

Does anyone know how to remove an uninhabited planet from a certain system?
Logged

Mayu

  • Lieutenant
  • **
  • Posts: 54
    • View Profile
Re: [0.9.1a] Console Commands v3.0 WIP 7.6 (released 2018-12-07)
« Reply #816 on: May 12, 2020, 11:56:26 PM »

I figured out how to create a planet and make it orbit a star but for some reason I couldn't make it work to make "planet a" orbit "planet b" can anyone help me with that?

Shameless bumping. I, for one, would like to know as well. I'm currently in a crusade of creating an ideal system for my empire. Somehow, I can make a planet to spawn in a system. However I can't still figure it out on how to spawn a planet to orbit another planet as its moon. If anyone knows how or has an idea to do it, please kindly share, thank you beforehand!
Logged

Histidine

  • Admiral
  • *****
  • Posts: 4661
    • View Profile
    • GitHub profile
Re: Question About a Command
« Reply #817 on: May 13, 2020, 01:41:37 AM »

Is there any command to remove the planet's "hate" to you? I kept on destroying pirate vessels that I can't trade with them anymore. It says "It would take months for the commosion ...." Maybe there is a command in the console command list?
runcode Global.getSector().getCampaignUI().getCurrentInteractionDialog().getInteractionTarget().getMarket().getMemoryWithoutUpdate().unset("$playerHostileTimeout");
then undock and redock.

Does anyone know how to remove an uninhabited planet from a certain system?
This works on any planet or station you're docked with (including inhabited ones):
Code: java
runcode SectorEntityToken ent = Global.getSector().getCampaignUI().getCurrentInteractionDialog().getInteractionTarget();
if (ent.getMarket() != null) Global.getSector().getEconomy().removeMarket(ent.getMarket());
ent.getContainingLocation().removeEntity(ent);
I figured out how to create a planet and make it orbit a star but for some reason I couldn't make it work to make "planet a" orbit "planet b" can anyone help me with that?

Shameless bumping. I, for one, would like to know as well. I'm currently in a crusade of creating an ideal system for my empire. Somehow, I can make a planet to spawn in a system. However I can't still figure it out on how to spawn a planet to orbit another planet as its moon. If anyone knows how or has an idea to do it, please kindly share, thank you beforehand!
The second parameter in LocationAPI.addPlanet is the object the new planet orbits, so instead of specifying the system's star you can enter the planet to orbit.
(Use LocationAPI.getEntityById; you can view a planet's ID in devmode with the dump memory option)
Logged

Mayu

  • Lieutenant
  • **
  • Posts: 54
    • View Profile
Re: Question About a Command
« Reply #818 on: May 13, 2020, 04:12:58 AM »

I figured out how to create a planet and make it orbit a star but for some reason I couldn't make it work to make "planet a" orbit "planet b" can anyone help me with that?

Shameless bumping. I, for one, would like to know as well. I'm currently in a crusade of creating an ideal system for my empire. Somehow, I can make a planet to spawn in a system. However I can't still figure it out on how to spawn a planet to orbit another planet as its moon. If anyone knows how or has an idea to do it, please kindly share, thank you beforehand!
The second parameter in LocationAPI.addPlanet is the object the new planet orbits, so instead of specifying the system's star you can enter the planet to orbit.
(Use LocationAPI.getEntityById; you can view a planet's ID in devmode with the dump memory option)

Hello thanks for the reply, though forgive my coding illiteracy since I'm not sure how exactly I'm going to do that. This is the code I am using when creating a planet, I've seen this from the previous posts.

Code
RunCode Global.getSector().getStarSystem("System_Name").addPlanet("Added_Planet_Name", Global.getSector().getStarSystem("System_Name").getStar(), "Added_Planet_Name", "Planet_type", Planet_Angle, Planet_Size, Planet_orbit_radius, Planet_Orbit_length) 
« Last Edit: May 13, 2020, 11:52:04 PM by Agreion »
Logged

Üstad

  • Commander
  • ***
  • Posts: 131
    • View Profile
Re: Question About a Command
« Reply #819 on: May 15, 2020, 09:57:19 AM »


The second parameter in LocationAPI.addPlanet is the object the new planet orbits, so instead of specifying the system's star you can enter the planet to orbit.
(Use LocationAPI.getEntityById; you can view a planet's ID in devmode with the dump memory option)
Forgive me but I didn' get it, I typed the console llocationAPI.getEntityByID while in devmode but nothing happened. How can I check planet ID's exactly?
Logged

Mondaymonkey

  • Admiral
  • *****
  • Posts: 777
    • View Profile
Re: [0.9.1a] Console Commands v3.0 WIP 7.6 (released 2018-12-07)
« Reply #820 on: May 15, 2020, 10:53:17 AM »

Is there a way to add an asteroid/dust rings to an existed planet via CC?

You should know, I spent all my character points for stamina and agility, leaving no room for intelligence to learn a Java magic, or wisdom to ignore spell ranking, so can you please give me something I can copy-paste, inserting a custom values.

Thank you!
Logged
I dislike human beings... or I just do not know how to cook them well.

Algester

  • Ensign
  • *
  • Posts: 42
    • View Profile
Re: Question About a Command
« Reply #821 on: May 16, 2020, 03:51:04 AM »

I figured out how to create a planet and make it orbit a star but for some reason I couldn't make it work to make "planet a" orbit "planet b" can anyone help me with that?

Shameless bumping. I, for one, would like to know as well. I'm currently in a crusade of creating an ideal system for my empire. Somehow, I can make a planet to spawn in a system. However I can't still figure it out on how to spawn a planet to orbit another planet as its moon. If anyone knows how or has an idea to do it, please kindly share, thank you beforehand!
The second parameter in LocationAPI.addPlanet is the object the new planet orbits, so instead of specifying the system's star you can enter the planet to orbit.
(Use LocationAPI.getEntityById; you can view a planet's ID in devmode with the dump memory option)

Hello thanks for the reply, though forgive my coding illiteracy since I'm not sure how exactly I'm going to do that. This is the code I am using when creating a planet, I've seen this from the previous posts.

Code
RunCode Global.getSector().getStarSystem("System_Name").addPlanet("Added_Planet_Name", Global.getSector().getStarSystem("System_Name").getStar(), "Added_Planet_Name", "Planet_type", Planet_Angle, Planet_Size, Planet_orbit_radius, Planet_Orbit_length) 
that means
Code
RunCode Global.getSector().getStarSystem("System_name").addPlanet("Added_Planer_Name", Global.getSector().getEntityById("Planet_Name"), "Added_planet_name", "Planet_type", Planet_Angle, Planet_Size, Planet_orbit_radius, Planet_Orbit_length)

ok refresher
Summoning Asteroid Belts
Code
RunCode Global.getSector().getStarSystem("System_name").addAsteroidBelt(Global.getSector().getStarSystem("System_name"), numAsteroids, orbitRadius, width, minOrbitDays, maxOrbitDays)
Summoning Planets
Code
RunCode Global.getSector().getStarSystem("System_Name").addPlanet("Added_Planet_Name", Global.getSector().getStarSystem("System_Name").getStar(), "Added_Planet_Name", "Planet_type", Planet_Angle, Planet_Size, Planet_orbit_radius, Planet_Orbit_length) 
Summoning Moons
Code
RunCode Global.getSector().getStarSystem("System_name").addPlanet("Added_Planer_Name", Global.getSector().getEntityById("Planet_Name"), "Added_planet_name", "Planet_type", Planet_Angle, Planet_Size, Planet_orbit_radius, Planet_Orbit_length)
Summoning Asteroid Fields orbiting a Planet
Code
RunCode Global.getSector().getStarSystem("System_name").addAsteroidBelt(Global.getSector().getEntityById("Planet_ID"), numAsteroids, orbitRadius, width, minOrbitDays, maxOrbitDays)
Summoning Rings on a Planet
Code
RunCode Global.getSector().getStarSystem("System_name").addRingBand(Global.getSector().getEntityById("planet_ID"), "graphic type", "texture", textureWidth, BandIndex?, color modifier, BandWidthinEngine, MiddleRadius, OrbitDays)

I still need some help on deciphering the syntax needed for the Ring renderer as its a bit "complicated"
for the ringband this is what I understand
the game needs to know which texture to use and where it's found this can be seen in the settings.json of the main game
this is located in "misc", the textures listed are rings_dust0, rings_ice0, rings_special0, rings_asteroid0. then what does it mean by textureWidth, Bandindex.
as for color modifier it goes by the naming of Color.red, Color.blue, Color.white etc..., then I'm stumped with the BandWithinEngine and MiddleRadius

the only time you would need to use getEntityById is if you are modifying an already existing planet generated by the game else I think you can also use getEntityByName for console generated ones
« Last Edit: May 16, 2020, 05:51:09 AM by Algester »
Logged

Mondaymonkey

  • Admiral
  • *****
  • Posts: 777
    • View Profile
Re: [0.9.1a] Console Commands v3.0 WIP 7.6 (released 2018-12-07)
« Reply #822 on: May 16, 2020, 07:17:49 AM »

Thank you!
Logged
I dislike human beings... or I just do not know how to cook them well.

Mayu

  • Lieutenant
  • **
  • Posts: 54
    • View Profile
Re: Question About a Command
« Reply #823 on: May 16, 2020, 08:24:29 AM »

I figured out how to create a planet and make it orbit a star but for some reason I couldn't make it work to make "planet a" orbit "planet b" can anyone help me with that?

Shameless bumping. I, for one, would like to know as well. I'm currently in a crusade of creating an ideal system for my empire. Somehow, I can make a planet to spawn in a system. However I can't still figure it out on how to spawn a planet to orbit another planet as its moon. If anyone knows how or has an idea to do it, please kindly share, thank you beforehand!
The second parameter in LocationAPI.addPlanet is the object the new planet orbits, so instead of specifying the system's star you can enter the planet to orbit.
(Use LocationAPI.getEntityById; you can view a planet's ID in devmode with the dump memory option)

Hello thanks for the reply, though forgive my coding illiteracy since I'm not sure how exactly I'm going to do that. This is the code I am using when creating a planet, I've seen this from the previous posts.

Code
RunCode Global.getSector().getStarSystem("System_Name").addPlanet("Added_Planet_Name", Global.getSector().getStarSystem("System_Name").getStar(), "Added_Planet_Name", "Planet_type", Planet_Angle, Planet_Size, Planet_orbit_radius, Planet_Orbit_length) 
that means
Code
RunCode Global.getSector().getStarSystem("System_name").addPlanet("Added_Planer_Name", Global.getSector().getEntityById("Planet_Name"), "Added_planet_name", "Planet_type", Planet_Angle, Planet_Size, Planet_orbit_radius, Planet_Orbit_length)

ok refresher
Summoning Planets
Code
RunCode Global.getSector().getStarSystem("System_Name").addPlanet("Added_Planet_Name", Global.getSector().getStarSystem("System_Name").getStar(), "Added_Planet_Name", "Planet_type", Planet_Angle, Planet_Size, Planet_orbit_radius, Planet_Orbit_length) 
Summoning Moons
Code
RunCode Global.getSector().getStarSystem("System_name").addPlanet("Added_Planer_Name", Global.getSector().getEntityById("Planet_Name"), "Added_planet_name", "Planet_type", Planet_Angle, Planet_Size, Planet_orbit_radius, Planet_Orbit_length)


Okay, thanks for helping out. I've tried your code and it goes like this.

Code
RunCode Global.getSector().getStarSystem("Inda").addPlanet("Lunaria", Global.getSector().getEntityById("Komana"), "Lunaria", "barren", 75, 90, 800, 37)

It doesn't give me any errors however, the planet appears in the middle of the star/sun of the system lol!

Spoiler
[close]


Edit: Nevermind, please disregard my stupidity, I followed Histidine's previous post about the planet ID. It worked now. Thank you everyone for the help!
« Last Edit: May 16, 2020, 08:40:20 AM by Agreion »
Logged

rrz85012-ThrowAway

  • Ensign
  • *
  • Posts: 1
    • View Profile
Re: Question About a Command
« Reply #824 on: May 16, 2020, 04:46:43 PM »

So I am going to do a code dump here, I found some snippet in an other thread and started running with it (didn't write down the name so, sorry?)
the nice thing about the code is that is calculates the orbit radius for you, this is based on the Player Fleet current location.

Spawn a stable location on the current Player Fleet location, with an orbit related to the systems centre star.
This is not my code.
Spoiler
Code
runcode SectorEntityToken _fleet = Global.getSector().getPlayerFleet();  
    StarSystemAPI _sys = (StarSystemAPI)_fleet.getContainingLocation();
    SectorEntityToken _stable = _fleet.getContainingLocation().addCustomEntity(null, null, "stable_location", "neutral");
    float _orbitRadius = com.fs.starfarer.api.util.Misc.getDistance(_fleet, _sys.getCenter());
    float _orbitDays = _orbitRadius / (20f + new Random().nextFloat() * 5f);
    float _angle = com.fs.starfarer.api.util.Misc.getAngleInDegrees(_sys.getCenter().getLocation(), _fleet.getLocation());
    _stable.setCircularOrbit(_sys.getCenter(), _angle, _orbitRadius, _orbitDays);
The line can be tinkcet with to change the obit speed, increase the 5f to something like 100f for a speedy boy
Code
 float _orbitDays = _orbitRadius / (20f + new Random().nextFloat() * 5f);
[close]

Remove a planet or station
Spoiler
with this you can remove planets, stations and start from a star system.
Code
runcode String _id = "planet_id";
SectorEntityToken fleet = Global.getSector().getPlayerFleet();
StarSystemAPI sys = (StarSystemAPI)fleet.getContainingLocation();
sys.removeEntity(sys.getEntityById(_id));
sys.updateAllOrbits();

explanation of values
Spoiler
Code
String _id = "planet_id"; // = the id of the planet, star or station you want to be removed
[close]
to get a list of available id in a star system use the following commands
Code
list planets; // will list all stars and planets in the system
list stations; // will list all stations in the system
[close]

spawn a planet
Using the same trick to spawn a planet on Player Fleet with an orbit related to the system centre star.
Spoiler
Using this code as is will give all the planets the prefix _cmd in the id_name
Code
runcode String _name = "planet_name";
String _type = "terain_type";
float _planetRadius = 165;
SectorEntityToken _fleet = Global.getSector().getPlayerFleet();
    StarSystemAPI _sys = (StarSystemAPI)_fleet.getContainingLocation();
SectorEntityToken _star = _sys.getStar();
float _orbitRadius = com.fs.starfarer.api.util.Misc.getDistance(_fleet, _sys.getCenter());
    float _orbitDays = _orbitRadius / (20f + new Random().nextFloat() * 10f);
    float _angle = com.fs.starfarer.api.util.Misc.getAngleInDegrees(_sys.getCenter().getLocation(), _fleet.getLocation());
PlanetAPI world = _sys.addPlanet( "_cmd"+_name, _star, _name, _type,
_angle, _planetRadius, _orbitRadius, _orbitDays);
_sys.updateAllOrbits();

the following line is needed to update the secter UI planet list so it shows up nice and orderd
Code
_sys.updateAllOrbits();

again tinker with the following line the increase orbit speed, 10f to 100f for speedy boy
Code
float _orbitDays = _orbitRadius / (20f + new Random().nextFloat() * 10f);
explanation of values
Spoiler
Code
String _name = "planet_name"; // = name of planet without prefix
String _type = "terain_type"; // = planet type
float _planetRadius = 165; = // = planet size, bigger number bigger planet
[close]
[close]

Spawn a moon
Like spawning a planet, but now an planet needs to be set as the orbit focus
Spoiler
the off set isn't correct, however the radius seems to be right.
Code
runcode String _id = "planet_id";
String _moonName = "moon_name";
String _terrainType = "terrain_type";
float _moonRadius = 65;
SectorEntityToken _fleet = Global.getSector().getPlayerFleet();
    StarSystemAPI _sys = (StarSystemAPI)_fleet.getContainingLocation();
SectorEntityToken _star = _sys.getEntityById(_id);
float _orbitRadius = com.fs.starfarer.api.util.Misc.getDistance(_fleet, _star);
    float _orbitDays = _orbitRadius / (20f + new Random().nextFloat() * 10f);
    float _angle = com.fs.starfarer.api.util.Misc.getAngleInDegrees(_sys.getCenter().getLocation(), _fleet.getLocation());
PlanetAPI _world = _sys.addPlanet("_cmd"+_moonName, _star, _moonName, _terrainType,
_angle, _moonRadius, _orbitRadius, _orbitDays);
_sys.updateAllOrbits();
again tinker with the following line the increase orbit speed, 10f to 100f for speedy boy
Code
float _orbitDays = _orbitRadius / (20f + new Random().nextFloat() * 10f);
explanation of values
Spoiler
Code
String _id = "planet_id"; // = id of the planet is star system
String _moonName = "moon_name"; // = the name of the moon
String _terrainType = "terrain_type"; // terrain of the moon
float _moonRadius = 65; // = moon size, bigger number bigger moon
[close]
[close]

Spawn rings around a planet
Those rings CAN NOT be removed with the code above.
Because a ring doesn't get an id/name and there for can't be found.
Spoiler
Again I use the same trick to get the radius and the location.
This is also some low level system stuff, for textures are directly manipulated.
Warning using this might BRICK your save make a backup first.
if you want to know what is does read the explanation below
The offset of the circle seems of by a bit, so drop a save before you use this
Code
runcode String _planetId = "planet_id";
SectorEntityToken _fleet = Global.getSector().getPlayerFleet();
StarSystemAPI _sys = (StarSystemAPI)_fleet.getContainingLocation();
SectorEntityToken _planet = _sys.getEntityById(_planetId);
float _orbitRadius = com.fs.starfarer.api.util.Misc.getDistance(_fleet.getLocation(), _planet.getLocation());
float _orbitDays = _orbitRadius / (20f + new Random().nextFloat() * 10f);
_sys.addRingBand(_planet,
"misc",
"rings_special0",
512,
1,
Color.RED,
256,
_orbitRadius,
_orbitDays)

[close]



Summoning Rings on a Planet
Code
RunCode Global.getSector().getStarSystem("System_name").addRingBand(Global.getSector().getEntityById("planet_ID"), "graphic type", "texture", textureWidth, BandIndex?, color modifier, BandWidthinEngine, MiddleRadius, OrbitDays)

I still need some help on deciphering the syntax needed for the Ring renderer as its a bit "complicated"
for the ringband this is what I understand
the game needs to know which texture to use and where it's found this can be seen in the settings.json of the main game
this is located in "misc", the textures listed are rings_dust0, rings_ice0, rings_special0, rings_asteroid0. then what does it mean by textureWidth, Bandindex.
as for color modifier it goes by the naming of Color.red, Color.blue, Color.white etc..., then I'm stumped with the BandWithinEngine and MiddleRadius

the only time you would need to use getEntityById is if you are modifying an already existing planet generated by the game else I think you can also use getEntityByName for console generated ones

Quote
the only time you would need to use getEntityById is if you are modifying an already existing planet generated by the game else I think you can also use getEntityByName for console generated ones

https://fractalsoftworks.com/starfarer.api/index.html?overview-summary.html
in the API Documentation LocationAPI.getEntityByName(string) is flagged as Deprecated and getEntityById(string) should be used instead.
aka newer stuff might not work with .getEntityByName().
PS: StarSystemAPI get the .getEntityByName() form LocationAPI.

Explanation of spawn rings
Spoiler
Like I said before this is low level system stuff. What happens, is that we tell the game what texture to load and where game can find it.
That is what all textureWidth, Bandindex are for. The BandWithinEngine and MiddleRadius are the size of the ring, how it needs to be displayed in game aka the size and distance.

knowing what the 4 variables are used for the code below makes a little bit more sense, but lets break it down line by line.

The code break down
Spoiler
_planetId is a text value stored to be just later, fill this with the planet/star that you want the ring to orbit around
Code
runcode String _planetId = "planet_id";
_fleet stores the player fleet that we get through: Global.getSector().getPlayerFleet();
so it can be used later
Code
SectorEntityToken _fleet = Global.getSector().getPlayerFleet();

_sys stores the current star system the player fleet is in.
again to it can be used later
Code
StarSystemAPI _sys = (StarSystemAPI)_fleet.getContainingLocation();
from the current _sys(StarSystemAPI) get the entity with id _planetId
Code
SectorEntityToken _planet = _sys.getEntityById(_planetId);

math magic, takes the location of the player fleet and the planet location to do numbers
Code
float _orbitRadius = com.fs.starfarer.api.util.Misc.getDistance(_fleet.getLocation(), _planet.getLocation());
float _orbitDays = _orbitRadius / (20f + new Random().nextFloat() * 10f);

and the part that adds the ring to the planet
using _sys as it seems to be the highest location entity aviable.
and passes _planet as the orbit focus
Code
_sys.addRingBand(_planet,
The key uner which the texture location data can be found
Code
"misc",
the texture name to be used to display the ring in game
Code
"rings_special0",
the with of the texture image file
Code
512,
the index of the texture to be used,  a texture can have multiple images
start counting at 0. So you want the 3 thing in a texture it is the number you need is 2, because 0(1), 1(2), 2(3).
Code
1,
I do not know what the colour effects, maybe the mask/lighting?
Code
Color.RED,
The with if the ring in game
Code
256,
the radius form the centre of the planer tot the centre of the player fleet.
this means that the middle of the ring will spawn on the player fleet
Code
_orbitRadius,
that amount of day it compleaits one loop around the planet
Code
_orbitDays)
[close]

after the break down we know what the line does but is is not readable.
so let take a look at it again, and I'll omit the first part.
and fill it with the name so it becomes a bit clearer
Code
_sys.addRingBand(orbitFocus, // the planet the ring orbits around
    "misc", // the location where game can find the texture data, DO NOT CHANGE
    "texture_name", // the name of the .png file to be loaded as found in Starsector\starsector-core\graphics\planets
    bandWidthInTexture, // the total width of the image file as on disk
    bandIndex, // the index of the ring to display in game
    Color.RED, // the colour that does someting?
    bandWidthInEngine, // the size of the ring as displayed in game
    middleRadius, // the radius form the orbitFocus to the middle of the spawned ring.
    orbitDays) // the amount of days it takes to to complate one loop around the orbitFocus

[close]

note to self: Don't make post on the internet late at night, I will regret this in the morning.

EDIT:
Maybe make a new thread with a layout like this post. purely for dumping working code snippets, so people can find stuff.
and not ask questions there. It can then serve as a companion thread to this one and people can be directed there for working snippets.
But I will leave that to a more respected member of this community.
« Last Edit: May 16, 2020, 04:53:53 PM by rrz85012-ThrowAway »
Logged
Pages: 1 ... 53 54 [55] 56 57 ... 93