Tac missile defense help.
-
Header: I'm trying to fix some of the Nomads code, and I'm confused on how Tac defense works.
I've noticed that with the Zapper, Buzzkill and Ythisatha, if the enemy missiles fly in at the same pattern every time, they are shot down at the same time in the same order. So if the missile order coming in is 1,3,2,5,4, then they are shot down in that same order every time. If this makes sense.
So, with the Nomads, I've noticed that the defense systems seem to shoot the enemy missiles down fast, but after 3-4 tac defenses, some of the defenses will stop tracking properly and let a missile go. So if there's 5 enemy missiles, and 5 defenses, ofen what happens is that 4 defenses fire off and the 5th just kinda sits there and doesn't do anything.
Is there any kind of commandcaps, category, some kind of logic that needs to be hooked to make the defenses work with eachother better?
-
Might have something to do with one of these changes?
https://github.com/FAForever/fa/pull/5528
https://github.com/FAForever/fa/pull/5518More specifically that these changes may not have been extended to Nomads.
-
I think this tells me exactly what I need to do. The issue being, the weapon fire and disable times are done in the .lua of the projectiles.lua and not the .bp of the unit. I think I can fix this by putting a line like unit:SetWeaponEnabled(false), though I'm unsure if that's correct.
-
Try using
DisableWhileReloading = true
in the weapon blueprint, this is what we do with FAF gun TMD. The issue you describe seems to be that 4 TMD fire, the 5th missile gets locked on to by a reloading TMD out of the first 4, and missiles can only have a number of shooters equal to their HP, so that lockon makes the 5th TMD ignore the missile as its shooter cap is filled. -
I appreciate the response. The way the Nomads TMD works is absolutely bonkers, so much happens in the script alone, utilizing a beam to do the work. I tried disabling the weapon in the script, because the recycle time in the blueprint is 10/1, and if it is adjusted then the lock-on time would increase. I have since abandoned the original code/method in favor of a traditional projectile, using the UEF Tac defense for now. I want to change the projectile graphic, but I'm not sure how to make a new projectile and have it work correctly, or make a new one that piggybacks off of an existing projectiles logic with minor edits. Big dreams, small brain.
IF I have anyones attention, I don't know how projectiles work. It looks like projectile/weapon info exists in 3-4 places. Anyone have a guide that explains this? Any time I think I understand, comes to find, I don't. ChatGPT superbrain can only help so much, even then it gives ideas more than it actually makes solutions.
-
@TankenAbard I can empathize with it. ^^
-
I think you should try to fix the TMD weapon script to be able to have the weapon to be disabled while reloading. I was assuming Nomads was using a normal weapon but it actually has its own code. The fix might just be to disable the weapon while it is idle here:
https://github.com/FAForever/nomads/blob/129f009fcd39a2bab068983e2f1ee20dd3bb1570/lua/nomadsweapons.lua#L258 by addingself:SetEnabled(false)
andself:SetEnabled(true)
around it.I'd wish to fix it to make it use the blueprint RackSalvo fields, but apparently the salvo size they want and the actual rack count are different so the default projectile weapon doesn't support it.
I don't know how projectiles work
Here is an example the Cybran ACU's gun (this class style design is used for everything in the game btw).
- Weapon looks into its blueprint for a projectile blueprint (Engine behavior)
- it creates the projectile when it fires. After this function the weapon usually doesn't do anything with the projectile.
- the projectile properties are determined by the blueprint (physics stuff, sounds, special categories, HP) and the script file (damage effects and visual effects)
- The script uses a class hierarchy which:
- 1 at the very top connects the projectile created by the engine to the class hierarchy, and allows for very specific changes if you want to change a projectile only for a single unit (since projectile bps are typically not shared, but duplicated for different units).
- 1 at the top determines the effect blueprints used for various effects. Fyi effect templates are just tables of effect blueprint filenames stored in
EffectTemplates.lua
. - 2 in the middle is the effect scripting that uses those assigned effects
- 3 and at the bottom is the projectile collision behavior and logic.
You can duplicating the blueprint and script for the UEF TMD, assigning the weapon the new projectile, and then in the script editing the correct effect field to use a new effect blueprint table.
-
I still haven't managed to make a new projectile, even based on an old one, yet. Anyone have a guide on this, written or video? This should be easy, but something isn't clicking in my brain, I'm waiting for that "ah-ha!" moment.
Relate but unrelated, because of recent changes. A tac missiles hitbox, where is that decided? I'm looking at Blueprints and scripts, but I'm not entirely sure. Is this a model thing? I know that's its own can of worms, importing and exporting to SupCom.
-
@TankenAbard
Hi, I just wanted to check your question and didn't know that the mesh forms a circle around the rocket.
-
Wow, is that the hitbox, the new one as of late? it's huge! Way bigger than I thought it would be. I still do wonder where this size is decided or modified. Very interesting.
-
@TankenAbard Each patch note has a pull request number that links to the PR that implemented the change (#6738), and you can click on "Files Changed" on the PR's webpage to see the exact changes to the files.
-
@Nomander https://github.com/FAForever/fa/pull/6738/commits/f06a490d72ca0f75921b79ca44d4f80b16f16e79 Thank you for your message, I wasn't fully aware of that before.