-
Notifications
You must be signed in to change notification settings - Fork 84
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
Better Explosive Attachment #1515
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,6 +26,7 @@ _this spawn { | |
_config = _this select 2; | ||
_timer = _this select 3; | ||
AGM_Explosives_placer = _unit; | ||
|
||
// Commented out due to the fact there is a distinction between who can deactivate mines and who can plant them in standard configs. | ||
// Would require custom config entries (AGM_ExplosiveSpecialist/AGM_Specialist) which excludes custom mods. | ||
//if ((AGM_Explosives_RequireSpecialist > 0) && {!([_unit] call AGM_Core_fnc_isEOD)}) exitWith {}; | ||
|
@@ -35,13 +36,14 @@ _this spawn { | |
|
||
AGM_Explosives_Setup = getText(ConfigFile >> "CfgMagazines" >> _class >> "AGM_SetupObject") createVehicleLocal [0,0,-10000]; | ||
|
||
AGM_Explosives_Setup enableSimulationGlobal false; | ||
//AGM_Explosives_Setup enableSimulationGlobal false; | ||
AGM_Explosives_Setup setVariable ["AGM_Class", _class]; | ||
AGM_Explosives_Setup setVariable ["AGM_Trigger", _config]; | ||
//AGM_Explosives_Setup setVariable ["AGM_Offset", GetArray(ConfigFile >> "CfgVehicles" >> typeof AGM_Explosives_Setup >> "AGM_Offset")]; | ||
if (!isNil "_timer") then { | ||
AGM_Explosives_Setup setVariable ["AGM_Timer", _timer]; | ||
}; | ||
AGM_Explosives_Setup setVariable ["AGM_Enable_Place", 0]; | ||
|
||
_unit forceWalk true; | ||
AGM_Explosives_TweakedAngle = 180; | ||
|
@@ -59,7 +61,25 @@ _this spawn { | |
AGM_Explosives_Setup setDir (AGM_Explosives_TweakedAngle + getDir _player); | ||
}; | ||
}] call BIS_fnc_addStackedEventHandler; | ||
AGM_Explosives_Setup addEventHandler ["EpeContactStart", { | ||
private ["_enabled","_disable"]; | ||
AGM_Explosives_Setup = _this select 0; | ||
_enabled = AGM_Explosives_Setup getVariable ["AGM_Enable_Place", 0]; | ||
if (_enabled == 1) then{ | ||
call AGM_Explosives_fnc_Place_Approve; | ||
}; | ||
_disable=0; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is the purpose of this? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The return value? or the assignment? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. both There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Essentially it just disables collisions There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The entire _enabled/_disabled code should be removed. It should simply place upon having contact. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The reason for this is to stop vehicles from freaking out if the physics-less explosive is inside the collision box and then placed/moved. Vehicles from being pushed, and any other issues that can be caused by arma physics |
||
_disable | ||
}]; | ||
[localize "STR_AGM_Explosives_PlaceAction", localize "STR_AGM_Explosives_CancelAction",localize "STR_AGM_Explosives_ScrollAction"] call AGM_Interaction_fnc_showMouseHint; | ||
_unit setVariable ["AGM_Explosive_Place", [_unit, "DefaultAction", {AGM_Explosives_pfeh_running AND !isNull (AGM_Explosives_setup)}, {call AGM_Explosives_fnc_Place_Approve;}] call AGM_Core_fnc_AddActionEventHandler]; | ||
_unit setVariable ["AGM_Explosive_Place", [_unit, "DefaultAction", {AGM_Explosives_pfeh_running AND !isNull (AGM_Explosives_setup)}, { | ||
_unit = call AGM_Core_fnc_player; | ||
AGM_Explosives_Setup setVariable ["AGM_Enable_Place", 1]; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove this extra variable. It won't be needed. You can simply set |
||
AGM_Explosives_Setup enableSimulationGlobal true; | ||
[_unit, "DefaultAction", _unit getVariable ["AGM_Explosive_Place", -1]] call AGM_Core_fnc_removeActionEventHandler; | ||
call AGM_Interaction_fnc_hideMouseHint; | ||
[localize "STR_AGM_Explosives_PlantAction", localize "STR_AGM_Explosives_CancelAction",localize "STR_AGM_Explosives_ScrollAction"] call AGM_Interaction_fnc_showMouseHint; | ||
_unit setVariable ["AGM_Explosive_Place", [_unit, "DefaultAction", {AGM_Explosives_pfeh_running AND !isNull (AGM_Explosives_setup)}, {AGM_Explosives_Setup enableSimulationGlobal false; call AGM_Explosives_fnc_Place_Approve;}] call AGM_Core_fnc_AddActionEventHandler]; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could probably replaced with AGM_Explosives_Setup setVariable ["AGM_Enable_Place", 0]; There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just simply remove it, no need for anything else. |
||
}] call AGM_Core_fnc_AddActionEventHandler]; | ||
_unit setVariable ["AGM_Explosive_Cancel", [_unit, "MenuBack", {AGM_Explosives_pfeh_running AND !isNull (AGM_Explosives_setup)}, {call AGM_Explosives_fnc_Place_Cancel;}] call AGM_Core_fnc_AddActionEventHandler]; | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -55,7 +55,19 @@ | |
<German>Platzieren</German> | ||
<Spanish>Colocar</Spanish> | ||
<Polish>Umieść</Polish> | ||
<French>Placer</French> | ||
<French>Mettre</French> | ||
<Czech>Položit</Czech> | ||
<Italian>Piazza</Italian> | ||
<Hungarian>Elhelyezés</Hungarian> | ||
<Portuguese>Colocar</Portuguese> | ||
<Russian>Положить</Russian> | ||
</Key> | ||
<Key ID="STR_AGM_Explosives_PlantAction"> | ||
<English>Plant</English> | ||
<German>Platzieren</German> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove all non-English translations otherwise they won't be fixed. |
||
<Spanish>Colocar</Spanish> | ||
<Polish>Umieść</Polish> | ||
<French>Poser</French> | ||
<Czech>Položit</Czech> | ||
<Italian>Piazza</Italian> | ||
<Hungarian>Elhelyezés</Hungarian> | ||
|
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.
Would this not need to be uncommented?
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.
enableSimulationGlobal false disables EpeContactStart
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.
EpeContactStart
only needs to be activated when the left clicking for the first time.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.
I'd rather have this set to false here because anything could happen in a MP environment and I'd rather avoid weird issues related to collisions.