Avorion

Avorion

25 ratings
Serina: Targeting AI for Torpedos
   
Award
Favorite
Favorited
Unfavorite
Mods: Mod
File Size
Posted
Updated
397.038 KB
5 Mar, 2024 @ 3:33am
15 Mar, 2024 @ 2:46am
3 Change Notes ( view )

Subscribe to download
Serina: Targeting AI for Torpedos

Description
Update 3/15/24: I believe I fixed my issue with me. The logic should be fixed now so your target of choice gets all the torpedoes like they're supposed to.


Inspired by 'Torpedo auto-target with spread' by Nirin

The script has been rewritten from the ground up to improve clarity and reduce overhead

Gone are the days of worrying about where your torpedoes are going. Serina takes care of all of that for you!

The Logic:
When torpedoes are fired, if you have an enemy selected all torpedoes will be sent there.
In other instances (i.e. targeting self, nothing), your torpedoes will disperse *'randomly'* (Fisher-Yates Shuffle) to available targets

If you have yourself targeted in a literally blank sector and you (perhaps unwisely) fire the torpedoes... may God have mercy on your soul.


Just kidding! That's resolved too, they shoot off like you had nothing selected, they do look a bit janky(i.e. they seem like they're about to circle back, then they zip off away again), depending on your torp range this may happen a few times: but they shouldn't return to sender!

Added Bonus: Torpedoes are silent - because well, there's only so long you can stand that warning siren before you snap. Basically, I've added the functionality of Silent Torpedo to my mod. I don't think they will conflict as they both set the same value to 0; if you happen to have upgraded Silent Torpedo for yourself to use.

This is my first mod, feedback and suggestions always welcome!
Popular Discussions View All (3)
9
18 Mar, 2024 @ 2:45pm
Problem with targeting remaining random
Censay
4
7 Mar, 2024 @ 1:12pm
Potential issues
Meesmaalt
0
15 Mar, 2024 @ 5:51am
Possible Upgrade for Serina
Reuivn
18 Comments
Reuivn  [author] 7 Jan @ 7:42am 
@ignat001

No, it's my mod and I hate the torpedo sound. I wanted them silent so i added the functionality to my mod. If you, or anyone else, want the sound returned: just delete the file as I outlined previously.


As for retargeting of torpedoes, that might be possible. I never looked into it because that wasn't really a concern I had.

In theory, they should exist as entities and the destroyed targets could be removed from the target list. But the target list would need to be repopulated (easy enough to recall the function) so that it registers the destroyed enemies.

However, I am not sure you can force the torpedo to retarget as I don't know what functions are afforded it after launch.
Ignat001 6 Jan @ 9:37pm 
Also it would be amazing if torpedoes would acquire new target if current one got destroyed
Ignat001 6 Jan @ 9:12pm 
Decouple "silent torpedoes" part from this mod, please. If anyone wanted to silence them, he would just install another mod.
Evam 10 Jun, 2024 @ 9:20pm 
Alrighty, thanks for letting me know! And thanks for the mod again too
Reuivn  [author] 10 Jun, 2024 @ 6:46am 
@Evam
Just remove the "volumes" configuration from the mod/data/sfx folder.

It won't break the mod at all, but will return the sound
Evam 10 Jun, 2024 @ 6:38am 
Wonderful mod, but is there a chance you're able to make a version that doesn't silence the torpedo sound? I happen to have a liking towards it ^^"
Reuivn  [author] 14 Mar, 2024 @ 12:16pm 
@(FbG) Karma

You're so welcome! I wanted them to be fun, and when I killed myself or have 10 tubes but can only target 1 target (and therefore need to weapon group hotkey cycle) it becomes not fun... So I sought to fix it.
(Grieving) ᶜ8ᴱ 🎱 ๖ۜKar 14 Mar, 2024 @ 7:34am 
Can I please kiss you?! Torpedoes have been the BANE of my existence for the sound and how annoying they could be to use as well as how dangerous they are if you happen to misclick (which I do constantly because of muscle problems) so you are an absolute life saver!!!
Censay 14 Mar, 2024 @ 6:14am 
I added a discussion to declutter the comments :)
Thanks for your effort and hopefully I can help
Reuivn  [author] 13 Mar, 2024 @ 8:07am 
@Censay
On Windows:
You will find you Client log here:
%appdata%\Avorion\
something like: clientlog 2024-03-13 10-37-05

You will find your Server log here:
%appdata%\Avorion\galaxies\*galaxyname*
something like: serverlog 2024-03-13 10-37-05

on Linux:
~/.avorion


I won't need the whole file just the lines about SerinaAI

Resubscribing might help. You could also try creating a new creative mode galaxy with just my mod enabled to see if it works then. That will help narrow down where the issue lies.

For my testing I created a new game, created a ship tested the torpedoes. Created an alliance ship and tested the torpedoes again.

Finally, if you add dev mode to your ship you can see what scripts you have on your ship (make sure SerinaAI is there) and you can also spawn enemies, torpedoes, etc so you can test it out.
in game chat enter:
/run Entity():addScript("lib/entitydbg.lua")