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)

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.

Messages - Anexgohan

Pages: [1] 2 3 4
1
Modding / Re: VSCode setup for Starsector modding (2024)
« on: Today at 02:01:27 AM »
reserved.

2
Modding / VSCode setup for Starsector modding (2024)
« on: Today at 02:01:02 AM »
This guide will help you set up Visual Studio Code for Starsector modding.
It will cover setting up the IDE, installing the required extensions, and configuring the build tasks.

Steps:

(A).
Setting up Java 1.7 (you can skip this step if you already have Java 1.7 installed) =>
Note: you can use any java version from 1.7, 1.8, till java 17, but 1.7 is recommended for Starsector modding.

1. Install Java 1.7 from [Java 1.7]

Link Provided by the [Starsector Wiki]


2. Extract the downloaded JDK7.zip to a folder.
        For example the default java directory,
       
Code
C:\Program Files\Java\JDK7
.

(B).
Installing Visual Studio Code =>

1. Install Visual Studio Code from [VSCODE]


2. Open Visual Studio Code. Go to the Extensions tab on the left sidebar and install the following extensions:
    - Extension Pack for Java by Microsoft (Java Extension Pack) - This extension pack includes the following extensions:
        * Language Support for Java(TM) by Red Hat
        * Debugger for Java
        * Test Runner for Java
        * Maven for Java
        * Project Manager for Java
        * Visual Studio IntelliCode (optional/not required/safe to uninstall)


3. Press `Ctrl + Shift + P` to open the command palette and type `Java: Create Java Project`.
        Select `Create Java Project` from the list.


4. Select `No build tools` and press Enter.

5. Select the mods folder inside the Starscetor installation folder as the project folder.
        The path should look like this:
       
Code
Starsector\mods

6. Enter the project name. The project name should be the name of the mod you are creating.
        For example, if you are creating a mod called `MyMod`,  enter `MyMod` as the project name.
        The folder structure should end up looking like this:
       
Code
Starsector\mods\MyMod
7. This will create the following files and folders inside the `MyMod` folder. This will start you up with a basic mod structure.
        - .vscode
            - settings.json
        - lib
        - src
        - README.md
Note:
settings.json - This contains the configuration related to VSCode within the project
src - You will be writing your code in this folder, this is where the mod's source code goes,
        anyone with this folder and the files contained inside it should be able to compile the mod


8. Open the `MyMod` folder in Visual Studio Code. File -> Open Folder -> Select the `MyMod` folder. This should load the project in VSCode.

9. In VSCode click on 'settings.json' in the .vscode folder.
        Delete everything inside settings.json, Copy and Paste the following configuration to the settings.json file:
Code
{
    "java.project.sourcePaths": ["src"],
    "java.project.outputPath": "out\\vscode\\bin",
    "java.project.referencedLibraries": [
        "lib/**/*.jar",
        "d:\\Starsector\\starsector-core\\starfarer.api.jar",
        "d:\\Starsector\\starsector-core\\lwjgl.jar",
        "d:\\Starsector\\starsector-core\\lwjgl_util.jar",
        "d:\\Starsector\\starsector-core\\xstream-1.4.10.jar",
        "d:\\Starsector\\mods\\LazyLib\\jars\\LazyLib.jar",
        "d:\\Starsector\\mods\\MagicLib\\jars\\MagicLib.jar",
        "d:\\Starsector\\mods\\zz GraphicsLib\\jars\\Graphics.jar"
    ],
    "java.configuration.runtimes": [
        {
            "name":"JavaSE-1.7",
            "path":"C:\\Program Files\\Java\\JDK7",
            "default": true
        }
    ]
}
Note: this assumes that you have installed Starsector in the `D:\Starsector` directory.
        If you have installed Starsector in a different directory,
        you will need to update the paths in the `java.project.referencedLibraries` section.


You can add more libraries by also clicking on the `Add` button next to "Refrenced Libraries" tab


10. Save the settings.json file and restart VSCode and load the 'MyMod' project again.

(C).
work on the mod =>


1. Start coding your mod in the `src` folder. Once you click any .java file in the `src` folder,
        A new drop-down will appear at the left panel of the VSCode window called
        ```Java Projects```.
        Click on the `MyMod` project to see the project structure.
      

2. Change the output folder of the compiled .jar file
        - Goto File -> Preferences -> Settings
        - Search for `Export Jar: Target Path`
        Change:
       
Code
${workspaceFolder}/${workspaceFolderBasename}.jar
        to
       
Code
${workspaceFolder}/jars/${workspaceFolderBasename}.jar
        in either 'User' or 'Workspace' settings
        you can also change the '${workspaceFolderBasename}' to anything you want. e.g.
       
Code
${workspaceFolder}/jars/mymod.jar
      
      
To Build the MyMod.jar file =>
3. click the `Run Build Task` button '->' at the bottom of the window, next to `Java Projects`

Congratulations you have successfully set up Visual Studio Code for Starsector modding.

3
- v0.2.9e Release
- 0.97a.RC11 compatible

- Anything below game version 0.97a will not work.

Warning: Must delete OLD mod folder completely
Always delete old mod files before Updating


Commits:
  • Balance Changes
  • Overhaul to sound effects and fixes reverb and echo
  • fixes for projectiles, turrets and missiles

Made by Anex.

check out the source code repo at :
https://github.com/Anexgohan/AnexWeapons

 ---------------------------------------------------------------------------------
# Contributors:
* Anexgohan - Mod Author.
* BCBC - Thanks to BCBC on Starsector discord, all weapons now have awesome lore related flavor text, feast your eyes at some professional writing.
 ---------------------------------------------------------------------------------
**Full Changelog**: https://github.com/Anexgohan/AnexWeapons/compare/v0.2.9d...v0.2.9e

Download Link:
Latest from Github


4
Welcome back!

Say, did you ever get around to converting all of your sounds to mono?

Very cool weapon pack, altough, one thing that bothers me after couple of days of testing it is one, I feel like the weapons are too common for how good they are and two, the sounds seem to have no volume fall-off - which is really unpleasant if you've got let's say, a couple of ships with Pinakas anywhere on the battlefield and the entire soundscape becomes Pinakas.

I have updated the sound files, please take a look at release v0.2.9e.

5
- 0.97a.RC11 compatible
- Crash Fixes
- Anything below game version 0.97a will not work, download an older version of the mod in that case.

Warning: Must delete OLD mod folder completely
Always delete old mod files before Updating


Commits:
* Fixed (bug fix)
* Fixed (crash fix)

Made by Anex.

check out the source code repo at :
https://github.com/Anexgohan/AnexWeapons

 ---------------------------------------------------------------------------------
# Contributors:
* Anexgohan - Mod Author.
* BCBC - Thanks to BCBC on Starsector discord, all weapons now have awesome lore related flavor text, feast your eyes at some professional writing.
 ---------------------------------------------------------------------------------

**Full Changelog**: https://github.com/Anexgohan/AnexWeapons/compare/v0.2.9c...v0.2.9d

6
I updated and added some Expanded Lore for the readers:
hope you like it.
due to IRL stuff i'm not able to play SS but I plan to fix the issues some people are having with this mod soon.

7
v0.2.7 - - Bug Fix Update relesed

  • Nothing new added.
  • Sound Updates and added new sounds for both fire and hit sounds.
  • bug fixes.
  • Fixed AI not using turrets
  • Back end and GitHub update not relevant for end-user just improves my workflow

8
Hey played with the new version, the pinaka is definitely a lot more balanced now, I gave the Lakshya a try and something I noticed is that the AI doesn't seem to fire them at all, and setting them on autofire with manual control would just waste them on ships instead of fighters.
Thanks for testing this and bringing this to my attention, I'll look into it and fix.
Appreciate your work, gave the achuk and sudarshan a try as well. The achuk's s-turn seems fine and most of the missiles can hit the target, maybe 1 or 2 will fly off to the side. But the sudarshan has a problem of flying circles around the target indefinitely, not sure if this is something to do with the s-turn function. Also achuks work fine when left to AI control, but in simulation I couldn't get the AI to fire the sudarshans unless I link it with say a salamander forcing them to fire together.

Yes its a very wierd issue indeed, im trying to wrap my head around it. Will post a fix.

9
Hey played with the new version, the pinaka is definitely a lot more balanced now, I gave the Lakshya a try and something I noticed is that the AI doesn't seem to fire them at all, and setting them on autofire with manual control would just waste them on ships instead of fighters.
Thanks for testing this and bringing this to my attention, I'll look into it and fix.

10
Modding / Re: [0.95.1a] Anex Weapons v0.2.4 - Hell of a Rail Gun Update
« on: February 27, 2022, 01:21:35 AM »
v0.2.4 - Hell of a Rail Gun Update relesed

  • Parashu Twin Mag Rail - Advanced EM Rail propelled solid tungsten carbide shell. Upto 3 times the raw kinetic impact are inherently more accurate than any ballistic weapon.
  • Sound Updates and added new sounds for both fire and hit sounds.
  • bug fixes.
  • Balance pass to previous weapons
  • Pinaka PD got damage and flak damage reduced, no more "father of all PD ever"
  • Dhwij turret damage and flux cost were reduced by a lot.
Parashu Twin Mag Rail

11
Modding / Re: [0.95.1a] Anex Weapons v0.1.2 - Now with Turrets aswell
« on: February 27, 2022, 01:18:43 AM »
Just started a run with this mod, bought some pinaka pd smart, this pd weapon puts a lot of anti-ship weapons to shame, 1337 burst dps(energy) at a 0.2 ratio is crazy, not to mention the excellent accuracy and turn rate, this thing's kinda like a vulcan cannon with 350 more range, much better accuracy, and even more of a threat to fighters/ships. The ammo reload right now is not holding it back much.

Yes, this will be fixed in v0.2.4

12
reserved for future use.

13
Modding / [0.97a] Anex Weapons v0.2.9f - Moar Dakka (released 2024-03-26)
« on: February 15, 2022, 05:56:50 AM »
The Mod is in Alpha Development state,
All releases are tested and working in Starsector v0.97a.RC11


Requirement:
Need balance testers for weapons
Need help writing interesting details for those weapons

What the mod is about:
I felt the need to add Weapons to the game specially Missiles for now and needed to learn how to make mods so here we are.
I have a background in graphics and 3d and being a fan of SS since its start so this is my contribution to the game I love so much other than throwing money at Alex.

What's the vision/lore :
Arjuna Industries started as a subsidiary of the Tri-Tachyon supplying them with low-end materials in the beginning to recent high-tech parts manufacturing, mostly stealth tech, missile weapons design and manufacturing, as the company grew so did its ambitions, strategically acquiring and merging with other smaller manufacturers Arjuna Industries supplied the bulk of Tri-Tachyon weapon components.
The Tri-Tachyon took notice of this situation and they were not comfortable with such a monopoly over weapons manufacture not under their majority control, the uneasy Tri-Tachyon tried to diversify and move past this long and fruitful alliance.

Things did not turn out well for Arjuna Industries as one sanction after another and mostly one client and that too turn hostile, Arjuna Industries nearly lost most of its advantages over its competing rival companies. The final push came when Tri-Tachyon tried to initiate a hostile takeover of Arjuna Industries via its rival company.
Tri-Tachyon would have succeeded if it were not for the large scale disruptions caused by the gate collapse and the following Second AI War against Hegemony, the Tri-Tachyon stranglehold on Arjuna Industries weakened over the years.

Arjuna Industries came into possession of knowledge of a vast and resource-rich region on the outer edges of travelled space with several hyperspace lanes leading up to it, untouched by the domain and its Remnants and far from the influence of the Core Worlds during the scavenging of a defunct observatory at the edge of the sector. All mention of this scavenge was purged and every person involved was either hunted down or promoted within Arjuna Industries.

Arjuna Industries knew what had to be done and in a desperate attempt for survival and over several years began in silence shifting its HQ to a secret location and after that shut all its manufacturing across the known space in an instant, for a long while no one knew where Arjuna Industries disappeared, abandoning all its commitments and service contracts. All its weapons and equipment fell into disarray and state of disrepair, the reputation loss caused Arjuna Industries manufactured equipment to become a joke amongst spacefarers only seemed fit for the lowest of the lowest, the unluckiest of the unlucky.

But recently across the black boards, some independent agents can be seen selling brand new Arjuna Industries marked weapons and on open markets, although finding very few willing to purchase due to its tarnished reputation and general disbelief that it is a genuine new Arjuna Industries product, those who have tried these weapons speak extremely highly of these weapons.

Arjuna Industries trade fleets compose of AI-controlled ships with a single captain and two to three crew who never get off from their ships even for negations, they make trade deals to sell weapons and high tech gear in exchange for common supplies and hardware, money or profits is of no interest to them. The Hegemony recently stopped their AI fleet and challenged them to stand down, in the resulting fight when Arjuna Industries AI fleet lost and was disabled, the entire convoy blew themselves up then be boarded, is this loyalty of their crew or AI influence no one knows. For now, they come from shadows trade their high tech gear for cheap goods and return to vast depths of empty space those who tried following them seem to be taken for a ride system hopping one jump lane to other eventually running out of supplies and backing off in disappointment. No one knows why they come and where they go, everyone who trades with them gets rich.

Only time will tell if Arjuna Industries has made a comeback or some pretender has claimed its name instead.
For now, purchase these weapons keeping in mind the risks involved. And do not try to look for them they do not want to be found.


Expanded Lore, the detailed story and mystery (Huge wall of text, Detailed Lore and History):
Spoiler
Expanded Lore :

Arjuna Industries, began as a humble subsidiary of the powerful Tri-Tachyon, Arjuna Industries began its journey by providing the conglomerate with basic materials. Gradually, they expanded their capabilities, delving into the realm of high-tech parts manufacturing, specializing in stealth technology and missile weaponry. As the company flourished, it sought strategic alliances, absorbing smaller manufacturers, Arjuna Industries became the primary supplier of weapon components for the Tri-Tachyon, Arjuna Industries wielded considerable influence within the faction.
As Arjuna Industries continued to thrive and expand, its relationship with the Tri-Tachyon grew increasingly complex. What had once been a mutually beneficial arrangement turned into a delicate dance of power dynamics and shifting alliances.

Their mastery of high-tech manufacturing, particularly in stealth technology and missile weaponry, elevated them to a position of paramount importance. The Tri-Tachyon relied heavily on Arjuna Industries' advanced weapons to maintain their edge in the ever-escalating conflicts of the sector.
However, this symbiotic relationship started raising eyebrows within the higher echelons of the Tri-Tachyon. Concerns over a potential monopoly in the weapons market, a market that the Tri-Tachyon felt should be under their direct control, began to simmer. As Arjuna Industries continued to absorb smaller manufacturers and solidify its grip on weapon production, the discomfort within the Tri-Tachyon grew.

Fearing the consequences of such dependency, the Tri-Tachyon's leaders embarked on a mission to diversify their sources of weaponry. They understood that relinquishing control over such a critical aspect of their military might could leave them vulnerable to unforeseen circumstances or manipulation. Thus, they sought to find alternative suppliers and bolster their own in-house manufacturing capabilities.
The Tri-Tachyon's quest for diversification led to various internal projects and partnerships with smaller factions and independent arms manufacturers. However, this transition proved to be far from smooth. Arjuna Industries' technological expertise and production efficiency had set a high standard in the weapons market, making it challenging for competitors to match their output.
Faced with this formidable challenge, the Tri-Tachyon's efforts to reduce reliance on Arjuna Industries were met with mixed results. While some minor success was achieved in diversifying weapon supplies, the faction still found itself drawn back to Arjuna Industries for their cutting-edge technology and unmatched quality.

Tensions between the two factions escalated, and behind closed doors, intense negotiations and backroom deals took place. Arjuna Industries was well aware of the Tri-Tachyon's ambitions and, in response, sought to consolidate its position further. They poured resources into research and development, ensuring they stayed ahead of the competition and maintained their reputation as the premier weapons manufacturer in the sector.
The struggle for dominance over the weapons market intensified, and it became a game of wits and subterfuge between the two factions. Both sought to outmanoeuvre the other, employing spies and corporate saboteurs to steal technology and disrupt operations.
The once seemingly unshakable alliance between Arjuna Industries and the Tri-Tachyon was now fraught with tension and uncertainty. Their journey from humble beginnings to dominant forces in the weapons industry had placed them on a collision course, each determined to assert their control over the sector's arms trade.
As the Tri-Tachyon continued to seek ways to break free from the shackles of their reliance on Arjuna Industries, the fate of these two factions remained intertwined. The balance of power in the sector hung in the balance, and only time would reveal which faction would emerge victorious in this struggle for control and dominance over the lucrative and deadly arms market.


The downfall of Arjuna Industries was marked by a relentless series of setbacks and challenges. The Tri-Tachyon's discomfort with their monopoly on weapon components led to a series of sanctions, aimed at breaking the company's hold over the lucrative market. Additionally, one of Arjuna Industries' significant clients, a powerful faction, suddenly turned hostile, severing valuable business ties and further destabilizing the faction's position.
As the Tri-Tachyon sought to diversify and reduce its reliance on Arjuna Industries, they hatched a plan for a hostile takeover through one of their rival corporations. The scheme would have succeeded if not for the chain of events that would soon engulf the sector in chaos.

The first blow came in the form of the gate collapse, a cataclysmic event that disrupted the stability of the sector's hyperspace lanes. The once reliable networks of travel and communication were thrown into disarray, and factions struggled to adapt to the sudden isolation caused by the loss of numerous key routes.
Amidst the chaos of the gate collapse, the Second AI War against the Hegemony erupted. This conflict drew the attention and resources of the factions, diverting their focus away from Arjuna Industries and its potential takeover. The Tri-Tachyon's stranglehold on the faction weakened as they were forced to prioritize their efforts in the larger conflict, leaving Arjuna Industries with a brief respite.

During this period, Arjuna Industries had an opportunity to reevaluate and reposition itself. The leadership of the faction realized that their survival hinged on finding a new path forward, and they knew they had to be bold to reclaim their lost advantages.
It was during this turbulent time that Arjuna Industries stumbled upon the hidden knowledge of the resource-rich region on the outer edges of known space. The revelation sparked hope and determination within the faction's ranks. They saw this newfound territory as their chance for redemption, a place where they could rebuild and thrive away from the shadows of the Core Worlds and the influence of their adversaries.

With the knowledge of this unexplored region, Arjuna Industries began its transformation. Secretly, they shifted their headquarters to a hidden location far from prying eyes and started concealing their activities. In a calculated move, they abandoned their manufacturing facilities across the sector to eliminate any traces of their operations.
The disappearance of Arjuna Industries puzzled their rivals and former allies alike. The faction's sudden withdrawal from the known space caused confusion and speculation. Some believed they had disbanded or been absorbed by their competitors, while others thought they had been defeated and wiped out entirely.
In reality, Arjuna Industries was silently plotting its return. For years, they focused their efforts on preparing for a new chapter, away from the watchful gaze of their adversaries. Their engineers and scientists developed advanced technologies and perfected their manufacturing processes. The tarnished reputation of their previous products would serve as a smokescreen, ensuring their true capabilities remained underestimated.
And so, in the shadows, Arjuna Industries endured and waited. Their knowledge of the uncharted region held the key to their resurgence, and they were patient in their pursuit of redemption. The time would come when they would reemerge from the darkness, armed with new technologies and a determination to reclaim their place in the cosmos.
The legend of Arjuna Industries lived on, whispered among those who dared to delve into the depths of space. Some believed they were a mere shadow of their former selves, while others thought the faction's revival was imminent. Yet, the truth remained hidden, buried in the secrets of the unexplored region they now called their own. Only time would reveal the extent of their transformation and whether Arjuna Industries would rise again as a force to be reckoned with or disappear forever into the annals of history.


The discovery of the vast and resource-rich region on the outer edges of known space was a turning point in the history of Arjuna Industries. It all began with a routine scouting mission to salvage valuable technology and data from a defunct observatory at the edge of the sector. Little did the Arjuna Industries operatives know that they were about to stumble upon a secret that would change the fate of the faction forever.
As they scoured the derelict facility, they came across encrypted data logs and ancient star charts. It soon became apparent that this observatory had been more than just an innocent research outpost. It held hidden knowledge of a region untouched by the Domain and its Remnants, far beyond the influence of the Core Worlds. The star charts revealed the existence of several uncharted hyperspace lanes leading to this distant and unexplored realm.
Recognizing the significance of this discovery, Arjuna Industries kept the findings tightly guarded, revealing the secret only to a select few high-ranking officials within the faction. The leadership understood the immense potential that lay within this untouched territory. It offered an opportunity to establish a new stronghold, free from the watchful eyes of their adversaries and competitors.

To ensure utmost secrecy, all records and evidence of the discovery were purged from the faction's official archives. The operatives involved were sworn to absolute silence, their memories altered or erased, and the few who knew the truth were bound by strict oaths of loyalty. Only a handful of trusted individuals, including the highest-ranking officials and the faction's elusive leader, knew about the hidden knowledge.
In the years that followed, Arjuna Industries devoted significant resources to investigating the uncharted region. Advanced exploration teams were dispatched, equipped with the latest cutting-edge technologies, to chart the hyperspace lanes and survey the abundant resources rumoured to exist there. These expeditions faced numerous challenges, including navigating treacherous gravitational anomalies and hostile environmental conditions.

As Arjuna Industries delved deeper into the uncharted realm, they encountered remnants of ancient technology beyond comprehension. The knowledge and resources that lay hidden in this region were beyond their wildest dreams, promising unmatched technological advancements and unparalleled wealth.
However, the quest for knowledge and power came at a cost. Some of the expeditions faced fierce resistance from the enigmatic entities that already inhabited the region. The remnants of ancient guardians, long forgotten by the rest of the sector, fiercely defended their territories. These confrontations led to the loss of several exploration teams and valuable assets, but Arjuna Industries persevered, seeing the potential rewards as worth the risks.

As the faction continued to explore and exploit the vast region, Arjuna Industries' true purpose became clear. Their ambition extended beyond mere survival; they sought to establish a hidden empire, a bastion of power and technology in the uncharted frontier, far from the prying eyes of their rivals.
The personnel involved in the initial discovery were either eliminated or discreetly promoted within the ranks of Arjuna Industries, ensuring that only the most loyal and capable individuals held positions of influence. The highest echelons of the faction became a closely-knit group of individuals bound by a common secret and a shared vision.
The vast knowledge and resources of this uncharted region became the foundation for Arjuna Industries' resurgence. As they perfected their technologies and built a thriving covert civilization, rumours of their newfound strength and ambitions began to spread throughout the sector.

Yet, despite the whispers and speculations, the truth remained hidden in the depths of the unexplored realm. Arjuna Industries continued to operate in the shadows, its true power concealed from the prying eyes of their enemies. Only time would reveal the full extent of their newfound wealth and technology and whether they would emerge from the shadows as benevolent pioneers or as an enigmatic force of unprecedented influence and control.

As Arjuna Industries delved deeper into the uncharted realm, their focus shifted away from the sector's known conflicts and power struggles. They became engrossed in unlocking the secrets of the new territory, harnessing its untapped resources, and developing cutting-edge technologies. However, this diversion of resources and attention would soon prove to be their greatest vulnerability.
As the faction poured its efforts into the unexplored frontier, the relentless and superior Tri-Tachyon continued to thrive and expand. The faction's leadership saw Arjuna Industries' withdrawal from the sector's affairs as an opportunity to assert their dominance over the arms market and expand their influence. Seizing the chance to diminish the power of their once-relied-upon supplier, the Tri-Tachyon launched a series of calculated offensives.

Defeat after defeat followed for Arjuna Industries. The faction found itself outmanoeuvred, outgunned, and overwhelmed by the Tri-Tachyon's relentless onslaught. The loss of critical resources and infrastructure within the sector, combined with the rapid erosion of their manufacturing capabilities, led to a steady decline in their overall strength.

Time, indeed, was not on Arjuna Industries' side. As the faction struggled to rebuild and adapt to the challenges of the uncharted territory, their rivals grew stronger with each passing day. The Tri-Tachyon's grip over the weapons market tightened, and other factions exploited Arjuna Industries' vulnerability to strengthen their own positions.
Within Arjuna Industries, internal divisions emerged. Some argued for a return to the sector's known space to face their adversaries head-on, while others believed that their salvation lay in fully committing to their expansion into the uncharted realm. This internal strife further weakened the faction, leaving them fractured and struggling to find a unified path forward.

As their losses mounted, the once-proud faction found itself on the brink of collapse. The mirage of riches and power in the unexplored frontier began to fade as the harsh realities of their situation became apparent. The vastness of the uncharted territory meant that it would take years, if not decades, to fully exploit its potential, and time was a luxury Arjuna Industries no longer had.

Desperation set in as the faction's leaders grappled with difficult decisions. Should they cut their losses and return to the sector's known space, hoping to salvage what remained of their once-mighty industrial complex? Or should they double down on their expansion plans, risking it all in the hope that the uncharted territory would ultimately yield the rewards they sought?

Amidst this turmoil, a shadowy figure emerged within Arjuna Industries – a charismatic and enigmatic leader who had long been a proponent of the uncharted frontier strategy. This enigmatic figure rallied the faction's loyalists, urging them to stay the course and have faith in the potential of the unexplored realm. Their words resonated with those who still believed in the dream of a hidden empire, free from the shackles of the sector's known powers.

The fate of Arjuna Industries now hung in the balance, and the sands of time were running out. The faction faced a critical juncture – one that would determine whether they would rise from the ashes of defeat or be forever consigned to the annals of history as a cautionary tale of ambition and hubris. The choices they made in the face of adversity would shape their destiny, and the sector held its breath, awaiting the outcome of this epic struggle for survival and redemption.

Arjuna Industries' desperate attempt for survival was a calculated and daring move. Recognizing the potential of the uncharted region they had discovered, the faction knew that their future hinged on their ability to establish a hidden stronghold far from the prying eyes of their enemies. With unwavering determination, they began executing a meticulously planned disappearing act that would baffle and bewilder the entire sector.
Silently and without warning, Arjuna Industries initiated a massive undertaking to shift their headquarters to a secret location within the uncharted territory. Advanced stealth technology, developed in secret during their years of preparation, allowed them to evade detection from even the most sophisticated surveillance networks. The process was conducted with utmost precision, orchestrated by a team of skilled operatives who operated under absolute secrecy.
As Arjuna Industries' HQ vanished from its known location, it left the sector in a state of confusion and disbelief. All at once, the faction severed ties with its alliances, abandoned service contracts, and halted manufacturing across known space. Their sudden disappearance left a trail of questions, but no answers were forthcoming. For a long while, the fate of Arjuna Industries remained a mystery to the rest of the sector.
The once-thriving manufacturing facilities of Arjuna Industries now stood dormant, their machinery idle, and their workforce disbanded or reassigned. The cutting-edge weapons and equipment that once commanded awe and fear among spacefarers fell into a state of disarray and disrepair. Left untended and without the resources to maintain them, their technological marvels slowly deteriorated into mere remnants of their former glory.

The sudden vanishing act had a profound impact on Arjuna Industries' reputation. Once hailed as a symbol of innovation and power, their name now became synonymous with failure and abandonment. Spacefarers ridiculed their once-prized equipment, regarding it as nothing more than a relic of a bygone era. It seemed destined for the scrap heaps and salvage yards, only suitable for the most desperate or ill-fated of pilots.
However, little did the sector know that this tarnishing of Arjuna Industries' reputation was part of a grander scheme. The faction allowed the perception of decay and incompetence to fester while secretly honing their technological prowess in their newfound realm. They knew that underestimating their capabilities would be their greatest advantage, as it allowed them to operate freely, unnoticed and unchallenged.
Within the depths of the uncharted territory, Arjuna Industries underwent a metamorphosis. Far from the Core Worlds and the prying eyes of their adversaries, they rebuilt their manufacturing capabilities and refined their technological innovations. The knowledge of the region's resources allowed them to harness previously untapped potential and develop new technologies that surpassed even their former glory.

As the centuries passed, rumours began to circulate of mysterious weapons and advanced technology emerging from the unexplored frontier. Whispers of Arjuna Industries' resurgence reached the ears of select individuals, those who dared to venture close to the region's borders. Yet, the enigma surrounding their whereabouts remained, as the faction continued to operate from the shadows, hidden from the sector's watchful gaze.
Despite their tarnished reputation and enigmatic disappearance, the reappearance of brand new Arjuna Industries marked weapons on black markets has sparked both curiosity and skepticism among spacefarers. Independent agents have been seen peddling these advanced weapons on open markets, yet potential buyers are wary due to the faction's past downfall and doubts about the authenticity of the products.
However, those daring enough to acquire these weapons have been pleasantly surprised. Whispered tales circulate among pilots and mercenaries who have wielded Arjuna Industries' latest creations. They speak in hushed tones of the awe-inspiring power and unparalleled precision of these weapons. It seems that Arjuna Industries' resurgence might not be just a rumor, and their technological prowess may have indeed surpassed their previous achievements.

As the mystery of Arjuna Industries' newfound technology continues to captivate the sector, another enigma shadows their operations – their AI-controlled trade fleets. These enigmatic convoys, piloted by an artificial intelligence overseen by a single captain and two to three crew members who never disembark, have become the stuff of legends.
These fleets show little interest in conventional currency or profits. Instead, they seek common supplies and hardware in exchange for their high-tech gear. Their motivations remain shrouded in secrecy, leaving those who trade with them puzzled by their peculiar transactions. Some speculate that Arjuna Industries is driven by an altruistic purpose, seeking to acquire resources for an unknown cause. Others wonder if the AI's programming holds the key to their mysterious trade practices.

The Hegemony, ever vigilant in the face of enigmatic forces, recently dared to challenge Arjuna Industries' AI-controlled fleet. The confrontation escalated into a heated battle that ended in a surprising display of loyalty or determination. When the AI fleet faced defeat and disablement, rather than surrendering, they initiated a self-destruct sequence, sacrificing themselves rather than submitting to capture. The motives behind this seemingly selfless act remain a subject of intense debate among spacefaring circles.
Those who have tried to follow the Arjuna Industries trade fleets have found themselves led on a wild chase, traversing obscure hyperspace lanes, jumping from one system to another. Eventually, they are left stranded and disillusioned, as if the faction wants to remain elusive and untraceable. The enigma surrounding their origin, purpose, and destination deepens, as no one can definitively answer why they come or where they go.
Yet, despite the secrecy and the risks involved, there is one undeniable fact – those who trade with Arjuna Industries become rich beyond imagination. The advanced weaponry and high-tech gear they offer prove to be incredibly valuable assets in the ever-escalating conflicts of the sector. Many have seen their fortunes transformed, their once-insignificant fleets suddenly becoming formidable forces in their own right.
For now, the sector remains intrigued by the return of Arjuna Industries, but also wary of the unknowns that surround them. The risks involved in dealing with this enigmatic faction are undeniable, but so are the rewards. The future holds the answer to the ultimate question: has Arjuna Industries indeed made a triumphant comeback, reclaiming its name and reputation, or is there something more profound at play, with a pretender using their identity to wield influence from the shadows? Until the veil of mystery is lifted, only time will reveal the truth, and for those who dare to deal with Arjuna Industries, they must tread carefully and be prepared for the unexpected.

For now, purchase these weapons keeping in mind the risks involved. And do not try to look for them they do not want to be found.
[close]


More missiles why:
Starsector has some very decent weapons but I feel missiles are not given the justice they need, look at the current world around you it is held peacefully with the fear of missiles, not tanks, not infantry and not guns. So it's strange to me that missiles in SS are not the same mayhem causing fear-inducing war machines that they really are in a future where armoured ships are flying and not just cylindrical tin cans.

Balance:
Balance is an ongoing process I the mod maker will always be biased to my creations, so I need your help in bringing sanity to my insanity, test it for me and report back either here or discord, if on discord please tag @Anexgohan

The Weapons of Arjuna Industries:

Missiles :
Spoiler
Achuk Missile -
Slow Firing and tracking Barrage that pack a punch both on hull and shields.
Racking and loading missiles with animation.
Sudarshan Missile - Slow Firing and tracking Barrage that eats shields and EMP's the target on hitting Hull does no damage.
Vajra Missile - good tracking fast Barrage that disables target engines does no damage.
Bhairav Torpedoe Launcher - Long-range slow torpedo with barrel animation. Armoured front for PD protection and extra penetration.
Lakshay Anti-Fighter Missile - Medium range low-speed tracking swarm missile built for anti-fighter operations.
Trishul Torpedo to the arsenal - Hybrid torpedo with limited targeting but huge punch and has a chance to bypass shields.
Achuk, Sudarshan & Vajra - Together they make a deadly package, can bring to kneel even the heaviest of targets.
[close]

Turrets:
Spoiler
Pinaka PD smart -
Flak turret with dual barrels and unprecedented rate of fire.
High DPS homing flak shells that mimic actual CIWS in sound and feel.
Dhwij Dual Cannon - Slow Firing Main turret with extremely light target lock.
No burst but decent per shot damage.
Parashu Twin Mag Rail - Advanced EM Rail propelled solid tungsten carbide shell.
Upto 3 times the raw kinetic impact are inherently more accurate than any ballistic weapon.

[close]

Spoiler
More to follow
[close]

Thankyou Note:
  • First off this very forum
  • Everyone over at Starsector Discord who helped specially AxleMC131, wisp, Histidine, Tartiflette for helping me out with most stuff.
  • Special thankyou to Nia Tahl, SirHartley, Wisp, Tartiflette, Harmful Mechanic, ruddygreat and "PureTilt, Freelance Vtuber Waifu" for tolerating my noobie ass and pestering them with thousand questions.
  • Various modders whose script I salvaged with permissions, credits are commented in the respective files.
  • If I forgot to mention or credit anyone please let me know and I'm grateful towards you aswell.

Note: I have balanced these as best as I feel to fit the base game, you are more than welcome to give feedback on everything. I also keep the right to change or overhaul these as I wish to fit my vision. I will try my best to keep game-breaking changes between starsector updates.

Changelogs:
Spoiler
v0.2.9f Release [0.97a] Anex Weapons v0.2.9f - Moar Dakka (released 2024-03-26)
- 0.97a.RC11 compatible
- Anything below game version 0.97a will not work.

Warning: Must delete OLD mod folder completely

Commits:
  • Balance Changes
  • Overhaul to sound effects and fixes reverb and echo
  • fixes for projectiles, turrets and missiles

v0.2.9d Release [0.97a] Anex Weapons v0.2.9d - I'm Back (released 2024-03-20)
- 0.97a.RC11 compatible
- Crash Fixes
- Anything below game version 0.97a will not work, download an older version of the mod in that case.

Warning: Must delete OLD mod folder completely

Commits:
* Fixed (bug fix)
* Fixed (crash fix)

**Full Changelog**: https://github.com/Anexgohan/AnexWeapons/compare/v0.2.9c...v0.2.9d

v0.2.3 Pre-release - The BCBC adventures
Thanks to BCBC on discord @bcbc , all weapons now have awsome lore related flavour text, feast your eyes at some professional writing
Dwij Turret added - Slow Firing Main turret.
Pinaka PD smart - Flak turret with dual barrels and unprecedented rate of fire. High DPS homing flak shells that mimic actual CIWS in sound and feel.
Sound Updates and added new sounds for both fire and hit sounds
bug fixes, so many bug fixes
now includes a bit of heightmap trickery I learned in photoshop to make sprites appear 3d, first pass will polish more


v0.2.0 Pre-release - Not save Compatible with v01.2a and below, apologies but it was necessary.

Added new sprites for all weapons
Added Trishul Torpedo to the arsenal - Hybrid torpedo with limited targeting but huge punch and has a chance to bypass shields
Fixed scaling issues on every weapon
Standardised the resolution and size of sprites, both for better visuals and functionality.
Added more lore to the faction to read on the forums, hope you like it.
Added new sounds and effects to some missiles

v0.1.2a Pre-release
Fixed crashes caused by a formatting error

v0.1.2
Lakshay Anti-Fighter Missile added, Medium range low-speed tracking swarm missile built for anti-fighter operations
Fixed scaling issues
Added a few new sounds
Increased variety of launch and hit sounds and randomization
reduced screen effects for low-end machines

v0.1.1a Pre-release
Bhairav Missile added
Long rang slow torpedo with barrel animation
did some balancing on other missiles reduced DPS and fire rate

v0.1.1
Fixed launch bug

v0.1.0
First Release
3 Missiles added
Achuk, Vajra & Sudarshan
[close]


Thanks for checking out my work here, the intent here is to learn by doing, I have permissions/understandings with the related modders which i have learned from, also, if you go to the java files they are credited there as well.

14
Modding / Re: [WIP] Public Companies - work in progress
« on: February 06, 2022, 12:35:55 AM »
How does one go about listing his company on your publicly traded stock exchange?  ;D

15
Modding / Re: The Radioactive Code Dump
« on: February 06, 2022, 12:33:56 AM »
Yet another missile AI, this time with all the knobs and switches you need to customize it anyway you want. No Java skill needed, but it require to be compiled.
Customizable features:
  • ECCM dependent target leading.
  • Different target selection priorities.
  • Option to reengage a new target when the current one got killed.
  • Controllable vanilla-like waving.
  • Oversteering behavior that tries to orient the velocity toward the leading point instead of just pointing the missile at it.
Tested on a hundred missiles at once with no noticeable performance impact.

Spoiler
Code: Java
//By Tartiflette, highly customizable Missile AI.
package data.scripts.ai;

import com.fs.starfarer.api.Global;
import com.fs.starfarer.api.combat.CombatEngineAPI;
import com.fs.starfarer.api.combat.CombatEntityAPI;
import com.fs.starfarer.api.combat.GuidedMissileAI;
import com.fs.starfarer.api.combat.MissileAIPlugin;
import com.fs.starfarer.api.combat.MissileAPI;
import com.fs.starfarer.api.combat.ShipAPI;
import com.fs.starfarer.api.combat.ShipCommand;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.lazywizard.lazylib.CollectionUtils;
import org.lazywizard.lazylib.MathUtils;
import org.lazywizard.lazylib.VectorUtils;
import org.lazywizard.lazylib.combat.AIUtils;
import org.lazywizard.lazylib.combat.CombatUtils;
import org.lwjgl.util.vector.Vector2f;

public class CustomMissileAI implements MissileAIPlugin, GuidedMissileAI {
         
   
    //////////////////////
    //     SETTINGS     //
    //////////////////////
   
    //Angle with the target beyond which the missile turn around without accelerating. Avoid endless circling.
    //  Set to a negative value to disable
    private final float OVERSHOT_ANGLE=60;
   
    //Time to complete a wave in seconds.
    private final float WAVE_TIME=2;
   
    //Angle of the waving in degree (divided by 3 with ECCM). Set to a negative value to avoid all waving.
    private final float WAVE_AMPLITUDE=15;
   
    //Damping of the turn speed when closing on the desired aim. The smaller the snappier.
    private final float DAMPING=0.1f;
   
    //Does the missile try to correct it's velocity vector as fast as possible or just point to the desired direction and drift a bit?
    //  Can create strange results with large waving
    //  Require a projectile with a decent turn rate and around twice that in turn acceleration compared to their top speed
    //  Useful for slow torpedoes with low forward acceleration, or ultra precise anti-fighter missiles.     
    private final boolean OVERSTEER=false;  //REQUIRE NO OVERSHOOT ANGLE!
   
    //Does the missile switch its target if it has been destroyed?
    private final boolean TARGET_SWITCH=true;
   
    //Does the missile find a random target or aways tries to hit the ship's one?     
    //   0: No random target seeking,
    //       If the launching ship has a valid target, the missile will pursue that one.
    //       If there is no target selected, it will check for an unselected cursor target.
    //       If there is none, it will pursue its closest valid threat.   
    //   1: Local random target,
    //       If the ship has a target selected, the missile will pick a random valid threat around that one.
    //       If the ship has none, the missile will pursue a random valid threat around the cursor, or itself in AI control.   
    //   2: Full random,
    //       The missile will always seek a random valid threat around itself.
    private final Integer RANDOM_TARGET=0;
   
    //Both targeting behavior can be false for a missile that always get the ship's target or the closest one
    //Prioritize hitting fighters and drones (if false, the missile will still be able to target fighters but not drones)
    private final boolean ANTI_FIGHTER=false;    //INCOMPATIBLE WITH ASSAULT
   
    //Target the biggest threats first
    private final boolean ASSAULT=true;  //INCOMPATIBLE WITH ANTI-FIGHTER
   
    //range in which the missile seek a target in game units.
    private final float MAX_SEARCH_RANGE = 1500;
   
    //range under which the missile start to get progressively more precise in game units.
    private float PRECISION_RANGE=500;
   
    //Is the missile lead the target or tailchase it?
    private final boolean LEADING=true;
   
    //Leading loss without ECCM hullmod. The higher, the less accurate the leading calculation will be.
    //   1: perfect leading with and without ECCM
    //   2: half precision without ECCM
    //   3: a third as precise without ECCM. Default
    //   4, 5, 6 etc : 1/4th, 1/5th, 1/6th etc precision.
    private float ECCM=3;   //A VALUE BELOW 1 WILL PREVENT THE MISSILE FROM EVER HITTING ITS TARGET!
   
   
    //////////////////////
    //    VARIABLES     //
    //////////////////////
   
    //max speed of the missile after modifiers.
    private final float MAX_SPEED;
    //Max range of the missile after modifiers.
    private final float MAX_RANGE;
    //Random starting offset for the waving.
    private final float OFFSET;
    private CombatEngineAPI engine;
    private final MissileAPI MISSILE;
    private CombatEntityAPI target;
    private Vector2f lead = new Vector2f();
    private boolean launch=true;
    private float timer=0, check=0f;

    //////////////////////
    //  DATA COLLECTING //
    //////////////////////
   
    public CustomMissileAI(MissileAPI missile, ShipAPI launchingShip) {
        this.MISSILE = missile;
        MAX_SPEED = missile.getMaxSpeed();
        MAX_RANGE = missile.getWeapon().getRange();
        if (missile.getSource().getVariant().getHullMods().contains("eccm")){
            ECCM=1;
        }       
        //calculate the precision range factor
        PRECISION_RANGE=(float)Math.pow((2*PRECISION_RANGE),2);
        OFFSET=(float)(Math.random()*Math.PI*2);
    }
   
    //////////////////////
    //   MAIN AI LOOP   //
    //////////////////////
   
    @Override
    public void advance(float amount) {
       
        if (engine != Global.getCombatEngine()) {
            this.engine = Global.getCombatEngine();
        }
       
        //skip the AI if the game is paused, the missile is engineless or fading
        if (Global.getCombatEngine().isPaused() || MISSILE.isFading() || MISSILE.isFizzling()) {return;}
       
        //assigning a target if there is none or it got destroyed
        if (target == null
                || target.getOwner()==MISSILE.getOwner()
                || (TARGET_SWITCH && (target instanceof ShipAPI && ((ShipAPI) target).isHulk())
                                  || !engine.isEntityInPlay(target)
                   )
                ){
            setTarget(assignTarget(MISSILE));
            //forced acceleration by default
            MISSILE.giveCommand(ShipCommand.ACCELERATE);
            return;
        }
       
        timer+=amount;
        //finding lead point to aim to       
        if(launch || timer>=check){
            launch=false;
            timer -=check;
            //set the next check time
            check = Math.min(
                    0.25f,
                    Math.max(
                            0.03f,
                            MathUtils.getDistanceSquared(MISSILE, target)/PRECISION_RANGE)
            );
            if(LEADING){
                //best intercepting point
                lead = AIUtils.getBestInterceptPoint(
                        MISSILE.getLocation(),
                        MAX_SPEED*ECCM, //if eccm is intalled the point is accurate, otherwise it's placed closer to the target (almost tailchasing)
                        target.getLocation(),
                        target.getVelocity()
                );               
                //null pointer protection
                if (lead == null) {
                    lead = target.getLocation();
                }
            } else {
                lead = target.getLocation();
            }
        }
       
        //best velocity vector angle for interception
        float correctAngle = VectorUtils.getAngle(
                        MISSILE.getLocation(),
                        lead
                );
       
        if (OVERSTEER){
            //velocity angle correction
            float offCourseAngle = MathUtils.getShortestRotation(
                    VectorUtils.getFacing(MISSILE.getVelocity()),
                    correctAngle
                    );

            float correction = MathUtils.getShortestRotation(               
                    correctAngle,
                    VectorUtils.getFacing(MISSILE.getVelocity())+180
                    )
                    * 0.5f * //oversteer
                    (float)((Math.sin(Math.PI/90*(Math.min(Math.abs(offCourseAngle),45))))); //damping when the correction isn't important

            //modified optimal facing to correct the velocity vector angle as soon as possible
            correctAngle = correctAngle+correction;
        }
       
        if(WAVE_AMPLITUDE>0){           
            //waving
            float multiplier=1;
            if(ECCM<=1){
                multiplier=0.3f;
            }
            correctAngle+=multiplier*WAVE_AMPLITUDE*check*Math.cos(OFFSET+MISSILE.getElapsed()*(2*Math.PI/WAVE_TIME));
        }
       
        //target angle for interception       
        float aimAngle = MathUtils.getShortestRotation( MISSILE.getFacing(), correctAngle);
       
        if(OVERSHOT_ANGLE<=0 || Math.abs(aimAngle)<OVERSHOT_ANGLE){
            MISSILE.giveCommand(ShipCommand.ACCELERATE); 
        }
       
        if (aimAngle < 0) {
            MISSILE.giveCommand(ShipCommand.TURN_RIGHT);
        } else {
            MISSILE.giveCommand(ShipCommand.TURN_LEFT);
        } 
       
        // Damp angular velocity if the missile aim is getting close to the targeted angle
        if (Math.abs(aimAngle) < Math.abs(MISSILE.getAngularVelocity()) * DAMPING) {
            MISSILE.setAngularVelocity(aimAngle / DAMPING);
        }
    }
   
    //////////////////////
    //    TARGETING     //
    //////////////////////
   
    public CombatEntityAPI assignTarget(MissileAPI missile){
       
        ShipAPI theTarget=null;       
        ShipAPI source = missile.getSource();       
        ShipAPI currentTarget;
       
        //check for a target from its source
        if(source != null
                && source.getShipTarget() != null
                && source.getShipTarget() instanceof ShipAPI
                && source.getShipTarget().getOwner() != missile.getOwner()
                ){
            currentTarget=source.getShipTarget();
        } else {
            currentTarget=null;
        }
       
        //random target selection
        if (RANDOM_TARGET>0){ 
            //random mode 1: the missile will look for a target around itsef
            Vector2f location = missile.getLocation();   
            //random mode 2: if its source has a target selected, it will look for random one around that point
            if( RANDOM_TARGET<2){                                     
                if(currentTarget != null
                        && currentTarget.isAlive()
                        && MathUtils.isWithinRange(missile, currentTarget, MAX_RANGE)
                        ){
                    location = currentTarget.getLocation();
                } else if (source != null
                        && source.getMouseTarget()!=null){
                    location=source.getMouseTarget();
                }
            }
            //fetch the right kind of target
            if(ANTI_FIGHTER){
                theTarget = getRandomFighterTarget(location);
            } else if(ASSAULT){
                theTarget = getRandomLargeTarget(location);
            } else {
                theTarget = getAnyTarget(location);
            }   
        //non random targeting   
        } else {
            if(source!=null){
                //ship target first
                if(currentTarget!=null
                        && currentTarget.isAlive()
                        && currentTarget.getOwner()!=missile.getOwner()
                        && !(ANTI_FIGHTER && !(currentTarget.isDrone() && currentTarget.isFighter()))
                        && !(ASSAULT && (currentTarget.isDrone() || currentTarget.isFighter()))
                        ){
                    theTarget=currentTarget;               
                } else {
                    //or cursor target if there isn't one
                    List<ShipAPI> mouseTargets = CombatUtils.getShipsWithinRange(source.getMouseTarget(), 100f);
                    if (!mouseTargets.isEmpty()) {
                        Collections.sort(mouseTargets, new CollectionUtils.SortEntitiesByDistance(source.getMouseTarget()));
                        for (ShipAPI tmp : mouseTargets) {
                            if (tmp.isAlive()
                                    && tmp.getOwner() != missile.getOwner()
                                    && !(ANTI_FIGHTER && !(tmp.isDrone() && tmp.isFighter()))
                                    && !(ASSAULT && (tmp.isDrone() || tmp.isFighter() || tmp.isFrigate()))
                                    ) {
                                theTarget=tmp;
                                break;
                            }
                        }
                    }               
                }
            }
            //still no valid target? lets try the closest one
            //most of the time a ship will have a target so that doesn't need to be perfect.
            if(theTarget==null){
                List<ShipAPI> closeTargets = AIUtils.getNearbyEnemies(missile, MAX_SEARCH_RANGE);
                if (!closeTargets.isEmpty()) {
                    Collections.sort(closeTargets, new CollectionUtils.SortEntitiesByDistance(missile.getLocation()));
                    if (ASSAULT){   //assault missiles will somewhat prioritize toward bigger threats even if there is a closer small one, and avoid fighters and drones.
                        for (ShipAPI tmp : closeTargets) {
                            if (tmp.isAlive()
                                    && tmp.getOwner() != missile.getOwner()
                                    ) {
                                if (tmp.isCapital() || tmp.isCruiser()){
                                    theTarget=tmp;
                                    break;
                                } else if (tmp.isDestroyer() && Math.random()>0.5){
                                    theTarget=tmp;
                                    break;
                                } else if (tmp.isDestroyer() && Math.random()>0.75){
                                    theTarget=tmp;
                                    break;
                                } else if (!tmp.isDrone() && !tmp.isFighter() && Math.random()>0.95){
                                    theTarget=tmp;
                                    break;
                                }
                            }
                        }
                    }else if(ANTI_FIGHTER){    //anti-fighter missile will target the closest drone or fighter
                        for (ShipAPI tmp : closeTargets) {
                            if (tmp.isAlive()
                                    && tmp.getOwner() != missile.getOwner()
                                    && (tmp.isDrone() || tmp.isFighter())
                                    ) {
                                theTarget=tmp;
                                break;
                            }
                        }
                    }else{  //non assault, non anti-fighter missile target the closest non-drone ship
                        for (ShipAPI tmp : closeTargets) {
                            if (tmp.isAlive()
                                    && tmp.getOwner() != missile.getOwner()
                                    && !tmp.isDrone()
                                    ) { 
                                theTarget=tmp;
                                break;
                            }
                        }
                    }
                }
            }
        }       
        return theTarget;
    }
   
    //Random picker for fighters and drones
    public ShipAPI getRandomFighterTarget(Vector2f location){
        ShipAPI select=null;
        Map<Integer, ShipAPI> PRIORITYLIST = new HashMap<>();
        Map<Integer, ShipAPI> OTHERSLIST = new HashMap<>();
        int i=1, u=1;
        List<ShipAPI> potentialTargets = CombatUtils.getShipsWithinRange(location, MAX_RANGE);
        if (!potentialTargets.isEmpty()) {
            for (ShipAPI tmp : potentialTargets) {
                if (tmp.isAlive()
                        && tmp.getOwner() != MISSILE.getOwner()
                        ) {
                    if (tmp.isFighter() || tmp.isDrone()){
                        PRIORITYLIST.put(i, tmp);
                        i++;
                    } else {                           
                        OTHERSLIST.put(u, tmp);
                        u++;
                    }
                }
            }
            if (!PRIORITYLIST.isEmpty()){
                int chooser=Math.round((float)Math.random()*(i-1)+0.5f);
                select=PRIORITYLIST.get(chooser);
            } else if (!OTHERSLIST.isEmpty()){                   
                int chooser=Math.round((float)Math.random()*(u-1)+0.5f);
                select=OTHERSLIST.get(chooser);
            }
        }
        return select;
    }
   
    //Random target selection strongly weighted toward bigger threats in range
    public ShipAPI getRandomLargeTarget(Vector2f location){
        ShipAPI select=null;
        Map<Integer, ShipAPI> PRIORITY1 = new HashMap<>();
        Map<Integer, ShipAPI> PRIORITY2 = new HashMap<>();
        Map<Integer, ShipAPI> PRIORITY3 = new HashMap<>();
        Map<Integer, ShipAPI> PRIORITY4 = new HashMap<>();
        Map<Integer, ShipAPI> OTHERSLIST = new HashMap<>();
        int i=1, u=1, v=1, x=1, y=1;
        List<ShipAPI> potentialTargets = CombatUtils.getShipsWithinRange(location, MAX_RANGE);
        if (!potentialTargets.isEmpty()) {
            for (ShipAPI tmp : potentialTargets) {
                if (tmp.isAlive()
                        && tmp.getOwner() != MISSILE.getOwner()
                        && !tmp.isDrone()
                        ) {
                    if (tmp.isCapital()){
                        PRIORITY1.put(i, tmp);
                        i++;
                        PRIORITY2.put(u, tmp);
                        u++;
                        PRIORITY3.put(x, tmp);
                        x++;
                        PRIORITY4.put(v, tmp);
                        v++;
                        OTHERSLIST.put(y, tmp);
                        y++;
                    } else if (tmp.isCruiser()){
                        PRIORITY2.put(u, tmp);
                        u++;
                        PRIORITY3.put(x, tmp);
                        x++;
                        PRIORITY4.put(v, tmp);
                        v++;
                        OTHERSLIST.put(y, tmp);
                        y++;
                    } else if (tmp.isDestroyer()){
                        PRIORITY3.put(x, tmp);
                        x++;
                        PRIORITY4.put(v, tmp);
                        v++;
                        OTHERSLIST.put(y, tmp);
                        y++;
                    } else if (tmp.isFrigate()){
                        PRIORITY4.put(v, tmp);
                        v++;
                        OTHERSLIST.put(y, tmp);
                        y++;
                    } else {
                        OTHERSLIST.put(y, tmp);
                        y++;
                    }
                }
            }
            if (!PRIORITY1.isEmpty() && Math.random()>0.8f){
                int chooser=Math.round((float)Math.random()*(i-1)+0.5f);
                select=PRIORITY1.get(chooser);
            } else if (!PRIORITY2.isEmpty() && Math.random()>0.8f){
                int chooser=Math.round((float)Math.random()*(u-1)+0.5f);
                select=PRIORITY2.get(chooser);
            } else if (!PRIORITY3.isEmpty() && Math.random()>0.8f){
                int chooser=Math.round((float)Math.random()*(x-1)+0.5f);
                select=PRIORITY3.get(chooser);
            } else if (!PRIORITY4.isEmpty() && Math.random()>0.8f){
                int chooser=Math.round((float)Math.random()*(v-1)+0.5f);
                select=PRIORITY4.get(chooser);
            } else if (!OTHERSLIST.isEmpty()){                   
                int chooser=Math.round((float)Math.random()*(y-1)+0.5f);
                select=OTHERSLIST.get(chooser);
            }
        }
        return select;
    }

    //Pure random target picker
    public ShipAPI getAnyTarget(Vector2f location){
        ShipAPI select=null;
        Map<Integer, ShipAPI> TARGETLIST = new HashMap<>();
        int i=1;
        List<ShipAPI> potentialTargets = CombatUtils.getShipsWithinRange(location, MAX_RANGE);
        if (!potentialTargets.isEmpty()) {
            for (ShipAPI tmp : potentialTargets) {
                if (tmp.isAlive()
                        && tmp.getOwner() != MISSILE.getOwner()
                        && !tmp.isDrone()
                        ){
                    TARGETLIST.put(i, tmp);
                    i++;                       
                }
            }
            if (!TARGETLIST.isEmpty()){
                int chooser=Math.round((float)Math.random()*(i-1)+0.5f);
                select=TARGETLIST.get(chooser);
            }
        }
        return select;
    }
   
    @Override
    public CombatEntityAPI getTarget() {
        return target;
    }

    @Override
    public void setTarget(CombatEntityAPI target) {
        this.target = target;
    }
   
    public void init(CombatEngineAPI engine) {}
}
[close]

Hey, everyone,
I was looking at your forum post here

I'm making some missiles for the game and would love to implement this for my missiles, sadly I have zero coding background could you give me any pointers if it's possible for someone like me to implement this as you said "no java skills needed"
thankyou for reading

Pages: [1] 2 3 4