Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added simple arty calculator #8

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft

added simple arty calculator #8

wants to merge 5 commits into from

Conversation

NeutraleNull
Copy link
Contributor

Implemented my idea from #2
20220928020216_1

It works together with the artillery table, or more say more clearly, it does not work without one.
First you select your charge from the table, then head over to self interact -> easy arty -> start.
Just click on the map and a solution will be shown if available. Otherwise a error message will be shown.
You can switch the charge and your own position and the solution will be updated accordingly.

@NeutraleNull
Copy link
Contributor Author

Code can still need some improvements here and there (the estimation of the elevation between two settings is not that great).

@NeutraleNull NeutraleNull added the enhancement New feature or request label Sep 28, 2022
tag = "easyarty";
class functions {
file = "scripts\easyarty\functions";
class preInit{preInit = 1;};
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If preinit is not needed, do not include


private _az = (_vehicle getDir _targetPos) * DEGREE_TO_MIL_FACTOR;

_distanceToTarget = _vehicle distance artyTarget;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing private keywords for new variable declarations

@@ -0,0 +1,64 @@
if (isDedicated) exitWith {};
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use this instead, covers headless client as well then

if !(hasinterface) exitWith {};

@@ -0,0 +1,64 @@
if (isDedicated) exitWith {};
easyArtyRunning = false;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

heavily suggesting the use of proper prefixing
easyarty_running
easyarty_pfh
easyarty_displayEh

this means it becomes less problematic moving the script to other missions or even a mod some time in the future

easyArtyDisplayEh = -1;

private _spacerAction = [
"spacerEasyArty",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use prefixes for the action IDs

1,
["ACE_SelfActions"],
_spacerAction
] call ace_interact_menu_fnc_addActionToObject;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use ace_interact_menu_fnc_addActionToClass instead, else a respawn will break this.

params ["", "_pos"];
deleteMarker "target_loc";
_marker = createMarkerLocal ["target_loc", _pos];
_marker setMarkerType "HD_DOT";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this will make the marker global, i doubt you want this. Also use prefixing for the marker name.

private _mapClickEh = addMissionEventHandler ["MapSingleClick", {
params ["", "_pos"];
deleteMarker "target_loc";
_marker = createMarkerLocal ["target_loc", _pos];
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing private keyword


private _mapClickEh = addMissionEventHandler ["MapSingleClick", {
params ["", "_pos"];
deleteMarker "target_loc";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

global delete of a none global marker.

@NeutraleNull
Copy link
Contributor Author

Updated the code according to @diwako suggestions. Many thanks for the review :)
Also added back in the functionality to switch between low and high shell arc.

@NeutraleNull
Copy link
Contributor Author

Fixed shells landing short and included time on target to view.
Here a little video showing how it works, and how precise it can be:
https://youtu.be/mqoG4zK83Xw

@b-mayr-1984
Copy link
Member

Here a little video showing how it works, and how precise it can be: https://youtu.be/mqoG4zK83Xw

I tried it and immediately got confused. After I went in game I immediately tried the new self ACE menu point.
image
This message showed up which did not explain to me what the problem was or how I should even come up with a solution.
image
Only in connection with your YT video I managed to make progress by clicking in the range card (without knowing what I am doing).

I also noticed that the Easy Arty ACE menu items are visible if you have no range cards with you. To my understanding Easy Arty can not work without range cards and if so should not be made available in the first place.

"Easy Arty",
"",
{},
{true}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tobe added [player, "ACE_artilleryTable"] call BIS_fnc_hasItem instead of true

check if a player has an artillery table before adding the spacer action to his player
@NeutraleNull
Copy link
Contributor Author

@b-mayr-1984 wie ist der Stand der Dinge hier?

@b-mayr-1984
Copy link
Member

@b-mayr-1984 wie ist der Stand der Dinge hier?

Ich hab hier auf den Input gewartet den du mir noch geben wolltest.
https://discord.com/channels/@me/1000698946135543809/1028337333839351920

Hab dann einige Wochen später nochmal nachgefragt bei dir, aber leider keine Antwort erhalten.
https://discord.com/channels/@me/969958150377730119/1055892275424665600

Daher ist aus meiner Sicht gerade der Stand on hold.

Um das zu mergen bräuchte es mMn konsistentes Verhalten, denn sonst sehe ich Spielerfrust vorprogrammiert wenn es nur in manchen Fällen funktioniert.

Daher nochmal die Frage:
@NeutraleNull willst du hier noch was tun um das zu stabilisieren bzw. konsistent zu machen?
Wenn die Behebung sich zu schwierig gestalten würde, dann könnte man es für die Spieler im User Interface evtl. als dediziertes Experimental Feature deklarieren, welches known issues hat (macht RHS towing ja auch).

@NeutraleNull
Copy link
Contributor Author

Alles klar, ich würde es Stable für Arty nennen. Mörser funktionieren ja damit -noch- nicht. Schaue ich mir aber auf jeden Fall mal an.

@b-mayr-1984
Copy link
Member

Alles klar, ich würde es Stable für Arty nennen. Mörser funktionieren ja damit -noch- nicht. Schaue ich mir aber auf jeden Fall mal an.

Passt. Solange die Nutzerführung das mit fehlendem Mörser-Support widerspiegelt (z.B. durch entsprechendes benennen der ACE-Menüeinträge), soll mir (und hoffentlich den Spielern) das reichen.

Wenn du Mörser auch noch an's Laufen kriegen möchtest, sogar noch besser. 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants