ZEN icon indicating copy to clipboard operation
ZEN copied to clipboard

Projectiles

Open ampersand38 opened this issue 5 years ago • 21 comments

When merged this pull request will:

  • Add modules to have AI throw grenades, fire GL, and fire launcher, on high or low ballistic trajectory
  • https://youtu.be/XNVXETJFnHQ
  • https://www.youtube.com/watch?v=zLU1RAM9rao

ampersand38 avatar May 07 '20 22:05 ampersand38

Is it possible to predict the arc? I am not a fan of the module for switching between high / flat. It would be nice to have an approximate arc, and use a keybind to switch modes while placing the target.

BrettMayson avatar May 07 '20 22:05 BrettMayson

How does one select a grenade that's not part of that selection? Eg. some mod adds a dart (just a random thing I came up with right now), with this implementation of multiple modules, can one do that?

That arc doesn't really seem to be an arc, it's just a straight line? I don't really see the reason for that as a module, could be a CBA Setting for those scenarios where Zeus needs to be limited or someone can't handle line drawing performance. No need to clutter the modules.

jonpas avatar May 07 '20 22:05 jonpas

How does one select a grenade that's not part of that selection?

A module for just throwing that gets all the throwables would be better, could be done with BIS_fnc_isThrowable

BrettMayson avatar May 07 '20 22:05 BrettMayson

Is it possible to predict the arc? I am not a fan of the module for switching between high / flat. It would be nice to have an approximate arc, and use a keybind to switch modes while placing the target.

It's using the initSpeed and calculating the launch angle such that the ballistic arc hits the targetPos. There's always 2 possible arcs.

ampersand38 avatar May 07 '20 23:05 ampersand38

That arc doesn't really seem to be an arc, it's just a straight line? I don't really see the reason for that as a module, could be a CBA Setting for those scenarios where Zeus needs to be limited or someone can't handle line drawing performance. No need to clutter the modules.

High Arc would be needed for hitting a roof top, or over a wall, for example.

ampersand38 avatar May 07 '20 23:05 ampersand38

How does one select a grenade that's not part of that selection?

A module for just throwing that gets all the throwables would be better, could be done with BIS_fnc_isThrowable

That would be a useful feature. I've worked on the standard stuff because it's faster to not have to choose a throwable.

ampersand38 avatar May 08 '20 00:05 ampersand38

What about using ZENs context menu? Select AI, right click at location to throw. Clicking "Throw" would throw something based on some priority (or just first available), sub-menu for manual selection.

Same for "Launch", launcher or GL.

jonpas avatar May 08 '20 00:05 jonpas

What about using ZENs context menu? Select AI, right click at location to throw. Clicking "Throw" would throw something based on some priority (or just first available), sub-menu for manual selection.

Same for "Launch", launcher or GL.

~~Is it currently possible to open context menu with AI selected? The default right click of course sets a waypoint.~~ Oh I see, using _hoveredEntity.

Are grenade commands used frequently enough to deserve a spot on every unit's context menu?

ampersand38 avatar May 08 '20 02:05 ampersand38

Are grenade commands used frequently enough to deserve a spot on every unit's context menu?

imho, no

bux avatar May 08 '20 04:05 bux

Latest Throw Select module lists unit's available throwables in context menu between dropping the module and selecting target position.

~~I haven't worked out how to remove the actions if menu is closed without choosing one of the~~ throwables. https://youtu.be/HItqwS8pbkk ~~Is there an event for closing the menu?~~

Same for "Launch", launcher or GL.

These have additional complication of loading the chosen round, if we're not just shooting whatever is loaded.

If there's no demand for being able to throw frag/stone/smoke regardless of actual availability, I can cut down the modules to:

ThrowSelect GL Launcher Trajectory

ampersand38 avatar May 08 '20 04:05 ampersand38

Are grenade commands used frequently enough to deserve a spot on every unit's context menu?

Possible way to fix this could be the following idea, that is - of course - not in scope of this PR. Use keyboard modifiers to open different context menus:

  • Hold down Alt and right click to get the offensive targeted context menu actions like throwing grenades or a quick access to a "search and destroy" waypoint
  • Hold down Shift while right clicking to get the more defensive targeted context menu actions. ....
  • etc ...

I don't know if that's possible at all, maybe that's an idea @mharis001 could use.

Such modifiers to open different context menus are already used in different graphic software. So it's not something completely uncommon 😄

bux avatar May 08 '20 04:05 bux

I would let you know a similar feature is in development too: #132

CreepPork avatar May 08 '20 16:05 CreepPork

spawn and waitUntil have been CBA-ized. Throw selected grenade is working properly. Fire Launcher is more reliable. https://www.youtube.com/watch?v=zLU1RAM9rao

ampersand38 avatar May 08 '20 18:05 ampersand38

I dislike the addition of this many modules. I think it can be limited to Fire Launcher, Fire GL, and Throw Grenade. Modules that require ALiVE should be removed. Also, the various actions do not work if the unit is in combat.

The current implementation into the context menu is pretty rough. If we want to keep that, it would be better to have only grenade actions shown. That requires a small change to context_menu which would allow entirely different action trees to be used when opening the menu - something I was planning on doing eventually for #132 .

For what @bux suggested, cba_events_shift and cba_events_alt can be used for the action conditions to achieve that.

mharis001 avatar May 12 '20 04:05 mharis001

I've removed and renamed the extraneous modules. I've noticed that throw commands sent while units are in certain actions (reloading, sprinting, or suppressing) will be delayed or ignored, but most are executed. https://youtu.be/xOgiUzg8214

ampersand38 avatar May 12 '20 15:05 ampersand38

Added icons https://steamuserimages-a.akamaihd.net/ugc/1026203216031872831/AF6C7BF14D3E4929B38548A265ED14D64A02DA35/

ampersand38 avatar May 14 '20 17:05 ampersand38

I really like these features. I considered getting launchers working for AI as impossible for some while. It works as good as it can considering how hard it is getting alerted ArmA AI to do what you want them to do. However, I have a few comments:

  • Did you try getting missile launchers working? There apparently is a setMissileTarget command. I have never used it so far tbh.
  • It seems that I somehow managed to break the modules when I used them a lot. Unfortunately, I haven't figured it out how to reproduce it. When it is broken, the module is always executed for the same unit, no matter on which unit I place the module.
  • Throw select: It would be better to get rid of all the other context menu entries that are unrelated to the module.

Kexanone avatar May 23 '20 02:05 Kexanone

I'm curious about your formula for calculating the initial angle. Do you have a reference or derivation for it?

Kexanone avatar May 24 '20 13:05 Kexanone

I'm curious about your formula for calculating the initial angle. Do you have a reference or derivation for it?

I got it from this video https://www.youtube.com/watch?v=bqYtNrhdDAY

ampersand38 avatar May 26 '20 17:05 ampersand38

Now working with soft launch weapons (RPG, NLAW, Titan, Vorona) https://youtu.be/gSjC2l98-Ps

ampersand38 avatar Jun 26 '20 17:06 ampersand38

For the grenades a graphical drawing like ACE's advanced throwing would be excellent for this.

CreepPork avatar Mar 04 '21 08:03 CreepPork