AEF Sniper Help with Targeting Please.
Posts: 52
Now recently I've been going over my mod and I'd like to make the sniper ignore all vehicles, and only target Infantry.
I've looked over the weapon, but don't see where I could add target type, same with the projectile.
I've tried to add the "usf_vehicle_hold_fire_mp" but that does the reverse of what I want to do.
Now I think I could make it "unit_type = infantry" BUT I don't really want it as an ability you toggle, I just want the sniper to target infantry by default (no ability, as in not taking up a UI Position)
Any help please.
In short: I'd like my Sniper to Target Infantry only all the time.
Posts: 632 | Subs: 1
Did you manage to get a tracer effect and loud firing sound similar to the other sniper rifles?
Posts: 52
Did you manage to get a tracer effect and loud firing sound similar to the other sniper rifles?
Just checked and yep it has the tracer and sniper "pop" sound.
Interesting how it all came about, if I remember right...
I just copied the soviet sniper squad over to the aef, slapped him in a building and done.
But... my buddies like hey you know that's a russian sniper. yea so what.
Well he wanted it to be us, so I just changed the icon and the character image to us Pathfinder.
He didn't like that, cause the model was still russian in game model. oye..
So I pointed the squad file to use the pathfinder model, but then the gun wouldn't show up.
It'd still shot but no actual gun. So I copied the soviet sniper weapon and pointed its model to the pathfinder carbine. Worked from there and my buddy was happy
I added the code:
<template_reference name="squadexts" value="sbpextensions\squad_action_apply_ext">
<list name="squad_entity_actions">
</list>
<list name="actions">
<template_reference name="action" value="action\override_weapon_target_prereq_action">
<list name="requirement_table">
</list>
<instance_reference name="weapon_to_override" value="" />
<uniqueid name="id" value="1073745832" />
<bool name="auto_attack_only" value="False" />
<bool name="persist_on_weapon_change" value="False" />
</template_reference>
</list>
</template_reference>
Not sure how it works, is there something I'm missing?
Posts: 632 | Subs: 1
I've been experimenting with an AEF Sniper using the Lieutenant model with a scoped Garand, but it didn't have any sound or tracers. Gonna have to take a look at that again!
Posts: 2742
Posts: 2636 | Subs: 17
You can also play with target prioritization by making the sniper heavily disfavor targetingany unit it can't penetrate. This will still have it target vehicles is there is no other targets. Alternately you could edit the hold fire toggle to also limit the target pool. For instance, you could make hold fire remain hold fire, but have the off toggle setting act like the 'target vehicles only' toggle for tanks but set for only infantry.
If you are referring to setting the over-penetration-penalty to False or something, I think this may have a knock-on effect on what happens when you right-click a garrisoned house. The sniper might actually elect to shoot at the house rather than the people inside the house.
The flag was literally the one thing that was causing the UKF sniper to have exactly that behaviour. It doesn't make sense at all, but toggling that flag was all it took to fix it.
Posts: 2742
Personally I think the second suggestion with a modified hold fire/tanks only setting would work better.
Posts: 2636 | Subs: 17
i.e., your sniper will be targeting just about anything (even infantry casualties). Giving a direct-face command (such as the ability bound to A for HMGs, etc) will restore the override_weapon-target_prereq actions.
It doesn't make any logical sense, and I've no idea how to fix this, but that's how it is.
Posts: 632 | Subs: 1
Note that override_weapon_target_prereq_action gets messed up every time the affected unit gets garrisoned.
i.e., your sniper will be targeting just about anything (even infantry casualties). Giving a direct-face command (such as the ability bound to A for HMGs, etc) will restore the override_weapon-target_prereq actions.
It doesn't make any logical sense, and I've no idea how to fix this, but that's how it is.
That's lame - another bug that needs fixing.
As a workaround, you could put the override_weapon_target_prereq_action into an interval_action to execute it every few seconds. That might help, but it's probably not very efficient. Better than nothing, though!
Posts: 52
I took the Target Tanks ability code for "action_list" and changed "unit type = infantry"
Then took that and put it in the sniper squad file:
<template_reference name="squadexts" value="sbpextensions\squad_action_apply_ext">
<list name="squad_entity_actions">
</list>
<list name="actions">
<template_reference name="action" value="action\override_weapon_target_prereq_action">
<list name="requirement_table">
<template_reference name="required" value="requirements\required_unit_type">
<enum name="reason" value="usage" />
<locstring name="ui_name" value="0" />
<enum name="unit_type" value="infantry" />
<template_reference name="qualify_option" value="options\none">
</template_reference>
<bool name="search_load_out" value="False" />
<bool name="owned_by_player_only" value="True" />
</template_reference>
</list>
<instance_reference name="weapon_to_override" value="" />
<uniqueid name="id" value="1073745832" />
<bool name="auto_attack_only" value="False" />
<bool name="persist_on_weapon_change" value="False" />
</template_reference>
</list>
</template_reference>
Works like a charm, thank ya guys.
Posts: 2742
Posts: 2
Thanks!
Posts: 8
Is there still this bug with units that go into garrison state?
If so maybe i can help.
I made a toggle ability with this override action which is also available in buildings.
(Might work with an always_on ablity too)
Posts: 52
Hi GizmoX64. Is there any chance you can share the details of your mod? I'm looking to do something similar and having your work to start with would be helpful
Thanks!
I've made a ton of changes, it's currently only for friends.
I can upload just my sniper file as raw files, that you can incorporate into your mod by changing the MOD ID string.
Posts: 2
I've made a ton of changes, it's currently only for friends.
I can upload just my sniper file as raw files, that you can incorporate into your mod by changing the MOD ID string.
Thanks. I finally got my own pathfinder mode working but I'd like to see what differences you have as well Any chance you can post it on github somewhere?
Posts: 52
Thanks. I finally got my own pathfinder mode working but I'd like to see what differences you have as well Any chance you can post it on github somewhere?
Here's a snapshot of the entire mod, no source, just a playable mod where you can see what you like and incorporate your take on it into your mod.
It's all AEF changes cause I only play US forces, and they are pretty OP, so play the AI on Hard or Expert modes. Or easy to see what I changed. I used to keep a change log of everything but it just got to big and I spent more time updating the change log then I did modding.
Overall, the US can build about everything, and I've grabbed other faction units and made them Allied Unit Here, or Captured Unit Here. Take anything you like.
Sent you link.
If you like the Pathfinder Sniper Squad (2nd building, 1st icon) you'll love the Special Forces Squad I made (Forward HQ Allied Tent [buildable by Assault Engineers], 2nd row, 4th icon)
Have fun
Posts: 632 | Subs: 1
hey there
Is there still this bug with units that go into garrison state?
If so maybe i can help.
I made a toggle ability with this override action which is also available in buildings.
(Might work with an always_on ablity too)
I think it does still exist, so I'd be very interested in how you did that!
Posts: 2636 | Subs: 17
hey there
Is there still this bug with units that go into garrison state?
If so maybe i can help.
I made a toggle ability with this override action which is also available in buildings.
(Might work with an always_on ablity too)
Give!
We could also use your toggle ability to fix the raketenwerfer bug.
Posts: 8
just make a toggle ability
add the action\override_weapon_target_prereq_action
with your prefered target
and change "enable_in_building" to "True"
you might also want to change "enable_in_vehicle" to "True"
the ability will stay put when the unit enter a building or a vehicle and you can turn it off and on from inside
PS:
gonna test it
ok tested it. as Passiv its not working. but maybe im doing something wrong
Posts: 2636 | Subs: 17
In fact, they start auto-attacking casualties, etc.
The only way I've managed to get those squads to respect prioritization in the building is if I'm using force facing (A + click command for MGs).
Livestreams
208 | |||||
45 | |||||
16 |
Ladders Top 10
-
#Steam AliasWL%Streak
- 1.831222.789+37
- 2.611220.735+5
- 3.35057.860+15
- 4.1110614.644+11
- 5.276108.719+27
- 6.306114.729+2
- 7.918405.694+2
- 8.262137.657+3
- 9.722440.621+4
- 10.1041674.607-2
Replay highlight
- cblanco ★
- 보드카 중대
- VonManteuffel
- Heartless Jäger
Board Info
7 posts in the last week
34 posts in the last month
Welcome our newest member, Harda621
Most online: 2043 users on 29 Oct 2023, 01:04 AM