Page MenuHomeFeedback Tracker

Feature Request: Allow scripts to reference memory points on proxied items (ex. lasers and scopes on rifles)
New, NormalPublic

Description

Feature Request: add a command or function which can interact with the memory points/selections of models that are attached to other models via proxies. The interactions possible could include passing to the game directly for utilization in some other feature, or for determining the exact world location and orientation of the items or selections in question.

Use cases for this feature could include the following:

  • allows for more eye placement options with various optics between weapons (T83080)
  • simplifies potential picture-in-picture (PIP) optics by allowing the camera position to be defined in the p3d as a memory point (mods like RHS currently locate the camera via a scripted offset from the player's hand, and this does not dynamically adjust to various weapons if using an unexpected optic/weapon combination)
  • expands possibilities for laser and illuminator mods (such as BettIR and Illuminate The Night) by allowing authors to create lasers or light sources via scripts at positions defined in the p3d which would then respond dynamically to unexpected laser/weapon combinations.
  • Allow mods such as ACE to implement their Interaction feature directly with units that are in a vehicle, or even potentially directly with weapons and attachments that are held by units (ex. there is a "Check weapon temperature" action, that could be located on the weapon itself, as opposed to the unit's body) (T81921)

This is not a particularly new issue. Before submitting this request, I was able to find 3 tickets which request a similar feature: T74385, T81921, T83080. All three are assigned, but quite old. I suspect that this feature may be quite complicated to create, and/or it might involve a change in how the engine itself handles proxies. I do not know. As well, while I've collected several potential uses for such a feature, they are all fairly niche, which may not make them worth the effort.

I understand that it's generally best to not submit new tickets on old issues, but I feel that, by collecting together the tickets, and by providing more than one possible use for this potential feature, it may encourage, at the very least, a reexamination of the subject.

Details

Severity
Feature
Resolution
Open
Reproducibility
N/A
Operating System
Windows 10 x64
Category
Scripting
Additional Information

While a specific command would be handy, this process could also potentially be approached with a syntax such as:

(primaryWeaponItems player) select 1) modelToWorld (((primaryWeaponItems player) select 1) selectionPosition "laser pos"); //returns world space coordinates for the memory point "laser pos" from the laser attached to the player's rifle.

I guess, from how the Biki presents these commands, this request could be seen as letting the game consider proxied models as objects, instead of an inaccessible part of an object.

Event Timeline

GhostJB created this task.Jun 18 2022, 3:19 AM
Leopard20 added a subscriber: Leopard20.EditedJun 18 2022, 11:44 PM

If this doesn't get implemented, you can already do this with some vector math.
You need to create a simple object from the model of the weapon and cache all selection positions then delete it. You can use a hashmap for fast cache lookup.

Next you need to find the transformation matrix from weapon proxy coordinates to model coordinates, which is possible using selectionPosition and selectionVectorDirAndUp. Once you have that you can transform the selection position in weapon coords to model coords. And from there you can easily do modelToWorldWorld to get the position in world coords.

I have posted a sample code on Arma Discord server here:
https://discord.com/channels/105462288051380224/105462984087728128/923244602847297616

It's for muzzle pos but can be easily modified for attachment positions as well

Ooo... wow. I bow to your ingenuity! It would certainly be simpler to have a command for this, but until then, I think I might be re-writing my mod (ITN) to use this process. I guess I really do need to learn how to do vector math! :D

Thank you!

This comment was removed by BIS_fnc_KK.
This comment was removed by Geez.
This comment was removed by Geez.
Geez added a subscriber: Geez.Jun 27 2022, 9:29 AM