-
Notifications
You must be signed in to change notification settings - Fork 1
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
base: main
Are you sure you want to change the base?
Conversation
Code can still need some improvements here and there (the estimation of the elevation between two settings is not that great). |
scripts/easyarty/funcs.hpp
Outdated
tag = "easyarty"; | ||
class functions { | ||
file = "scripts\easyarty\functions"; | ||
class preInit{preInit = 1;}; |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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 {}; |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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", |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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"; |
There was a problem hiding this comment.
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]; |
There was a problem hiding this comment.
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"; |
There was a problem hiding this comment.
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.
Updated the code according to @diwako suggestions. Many thanks for the review :) |
Fixed shells landing short and included time on target to view. |
I tried it and immediately got confused. After I went in game I immediately tried the new self ACE menu point. 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} |
There was a problem hiding this comment.
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
@b-mayr-1984 wie ist der Stand der Dinge hier? |
Ich hab hier auf den Input gewartet den du mir noch geben wolltest. Hab dann einige Wochen später nochmal nachgefragt bei dir, aber leider keine Antwort erhalten. 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: |
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. 🙂 |
Implemented my idea from #2
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.