add cartridge ejection effect on repeat#1158
Merged
Conversation
Contributor
Author
|
cartridgeEjectPosition or cartridgeEjectionPosition? |
Contributor
Author
|
Script to find _offset = [-0.02,0.01,0.02];
["cba_debug", "onEachFrame", {
params ["_unit", "_weapon", "_pos"];
private _aim = _unit modelToWorldVisualWorld (_unit selectionPosition "aimPoint");
private _cam = _unit modelToWorldVisualWorld (_unit selectionPosition "camera");
private _up = _aim vectorFromTo _cam;
private _wDir = _unit weaponDirection _weapon;
private _wLat = vectorNormalized (_wDir vectorCrossProduct _up);
private _wUp = _wLat vectorCrossProduct _wDir;
private _origin = _unit modelToWorldVisualWorld (_unit selectionPosition "proxy:\a3\characters_f\proxies\weapon.001") vectorAdd
(_wDir vectorMultiply _pos#0) vectorAdd
(_wLat vectorMultiply _pos#1) vectorAdd
(_wUp vectorMultiply _pos#2);
drawLine3D [ASLToAGL _origin, ASLToAGL (_origin vectorAdd _wDir), [1,0,0,1]];
drawLine3D [ASLToAGL _origin, ASLToAGL (_origin vectorAdd _wLat), [0,1,0,1]];
drawLine3D [ASLToAGL _origin, ASLToAGL (_origin vectorAdd _wUp), [0,0,1,1]];
}, [player, currentWeapon player, _offset]] call BIS_fnc_addStackedEventHandler;I recommend adding 0.1 (10cm) to the Y coordinate (right), because of rendering issues with creating objects with velocity (may be drawn slightly in negative velocity direction from their actual position, presumably due to timing differences in simulation and draw frames). |
jonpas
approved these changes
Jun 14, 2019
…nEventsCartridgeEject
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
When merged this pull request will:
cartridgein CfgAmmo of the fired projectile to the empty string.CBA_weaponEventssubclass of the weapon class are:cartridgeType- CfgVehicles class particle effect. Example FxCartridge_556 or FxCartridge_762. If this string is undefined (default) or "", this scripted effect will not be created.cartridgeEjectPosition- Position where the cartridge is created relative to model center of the weapon ([0,0,0]). x - forward (firing direction), y - right, z - upcartridgeEjectVelocity- Velocity of ejected cartridge in weapon model space. x - forward, y - right, z - up; vector length is speed in m/s.cartridgeEjectDelay- Delay in seconds that has to pass after repeating started for the cartridge to eject (time it takes to open the chamber in the repeat animation).Nomenclature: