-
Notifications
You must be signed in to change notification settings - Fork 739
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
scripted approach to hand flares, fix #1079 #2343
Merged
Changes from 1 commit
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,7 @@ | |
class ACE_M84FlashbangEffect { | ||
// empty | ||
}; | ||
|
||
class ACE_HandFlareEffect { | ||
// empty | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
|
||
ADDON = false; | ||
|
||
PREP(flare); | ||
PREP(flashbangExplosionEH); | ||
PREP(flashbangThrownFuze); | ||
PREP(nextMode); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// by commy2 | ||
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. Wrong Docu |
||
#include "script_component.hpp" | ||
|
||
params ["_projectile", "_color", "_intensity", "_timeToLive"]; | ||
|
||
private "_light"; | ||
_light = "#lightpoint" createVehicleLocal position _projectile; | ||
|
||
_light setLightColor _color; | ||
_light setLightAmbient _color; | ||
_light setLightIntensity _intensity; | ||
_light setLightBrightness 0.8; | ||
|
||
_light setLightUseFlare true; | ||
_light setLightFlareSize 3.0; | ||
_light setLightFlareMaxDistance 1000; | ||
|
||
_light setLightDayLight true; | ||
|
||
_light lightAttachObject [_projectile, [0,0,0]]; | ||
//_light attachTo [_projectile, [0,0,0]]; | ||
|
||
[{deleteVehicle _this}, _light, _timeToLive, 1] call EFUNC(common,waitAndExecute); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,47 +21,64 @@ | |
*/ | ||
#include "script_component.hpp" | ||
|
||
private ["_mode", "_fuzeTime"]; | ||
params ["_unit", "_weapon", "", "", "", "", "_projectile"]; | ||
params ["_unit", "_weapon", "", "", "_ammo", "", "_projectile"]; | ||
|
||
if (_unit != ACE_player) exitWith {}; | ||
if (_weapon != "Throw") exitWith {}; | ||
|
||
// handle speial grenades | ||
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. special |
||
if (local _unit) then { | ||
if (getNumber (configFile >> "CfgAmmo" >> _ammo >> QGVAR(flashbang)) == 1) then { | ||
private "_fuzeTime"; | ||
_fuzeTime = getNumber (configFile >> "CfgAmmo" >> _ammo >> "explosionTime"); | ||
|
||
[FUNC(flashbangThrownFuze), [_projectile], _fuzeTime, 0] call EFUNC(common,waitAndExecute); | ||
}; | ||
|
||
if (getNumber (configFile >> "CfgAmmo" >> _ammo >> QGVAR(flare)) == 1) then { | ||
private ["_fuzeTime", "_timeToLive", "_color", "_intensity"]; | ||
|
||
_fuzeTime = getNumber (configFile >> "CfgAmmo" >> _ammo >> "explosionTime"); | ||
_timeToLive = getNumber (configFile >> "CfgAmmo" >> _ammo >> "timeToLive"); | ||
_color = getArray (configFile >> "CfgAmmo" >> _ammo >> QGVAR(color)); | ||
_intensity = _color select 3; | ||
_color resize 3; | ||
|
||
[FUNC(flare), [_projectile, _color, _intensity, _timeToLive], _fuzeTime, 0] call EFUNC(common,waitAndExecute); | ||
}; | ||
}; | ||
|
||
// handle throw modes | ||
if (_unit != ACE_player) exitWith {}; | ||
|
||
private "_mode"; | ||
_mode = missionNamespace getVariable [QGVAR(currentThrowMode), 0]; | ||
|
||
if (_mode != 0) then { | ||
private "_velocity"; | ||
|
||
_velocity = velocity _projectile; | ||
|
||
switch (_mode) do { | ||
//high throw | ||
case 1 : { | ||
case 1 : { | ||
_velocity = [ | ||
0.5 * (_velocity select 0), | ||
0.5 * (_velocity select 1), | ||
[0, 0, 0] distance (_velocity vectorMultiply 0.5) | ||
]; | ||
}; | ||
//precise throw | ||
case 2 : { | ||
case 2 : { | ||
_velocity = (_unit weaponDirection _weapon) vectorMultiply (vectorMagnitude _velocity); | ||
}; | ||
//roll grande | ||
case 3 : { | ||
case 3 : { | ||
//@todo | ||
}; | ||
//drop grenade | ||
case 4 : { | ||
case 4 : { | ||
_velocity = [0, 0, 0]; | ||
}; | ||
}; | ||
|
||
_projectile setVelocity _velocity; | ||
}; | ||
|
||
if (typeOf _projectile == "ACE_G_M84") then { | ||
_fuzeTime = getNumber (configFile >> "CfgAmmo" >> typeOf _projectile >> "fuseDistance"); | ||
// _fuzeTime = getNumber (configFile >> "CfgAmmo" >> typeOf _projectile >> "explosionTime"); //@toDo pretty sure this should be explosionTime not fuseDistance | ||
[FUNC(flashbangThrownFuze), [_projectile], _fuzeTime, 0] call EFUNC(common,waitAndExecute); | ||
}; |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
destroy this Backward Compatibility?
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.
It doesn't, the old ones are still there.
All these smokegrenadeXXX entries didn't do anything anyway. (simualtion = "shotIllumination")