-
Notifications
You must be signed in to change notification settings - Fork 740
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
Dogtags #3600
Closed
Closed
Dogtags #3600
Changes from 1 commit
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
ca3171a
Initial commit dogtags
SzwedzikPL 1cdecf7
double dogtag support, fix addDogtagItem event in mp, unconscious uni…
SzwedzikPL 174e69c
move dogtag macros to CfgWeapons
SzwedzikPL 9d4bd0f
Added custom dogtag model and images
BaerMitUmlaut 5dbe99b
Adjusted single and double dogtag renders
BaerMitUmlaut 8bcf24a
Merge pull request #1 from BaerMitUmlaut/dogtags
SzwedzikPL aa407a4
Merge branch 'acemod/master' into dogtags
SzwedzikPL 5313672
dogtag picture
SzwedzikPL acdfa52
Merge branch 'acemod/master' into dogtags
SzwedzikPL 0e247bd
CBA events
SzwedzikPL 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
class Extended_PreStart_EventHandlers { | ||
class ADDON { | ||
init = QUOTE(call COMPILE_FILE(XEH_preStart)); | ||
}; | ||
}; | ||
class Extended_PreInit_EventHandlers { | ||
class ADDON { | ||
init = QUOTE(call COMPILE_FILE(XEH_preInit)); | ||
}; | ||
}; | ||
class Extended_PostInit_EventHandlers { | ||
class ADDON { | ||
init = QUOTE(call COMPILE_FILE(XEH_postInit)); | ||
}; | ||
}; |
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,43 @@ | ||
class CfgVehicles { | ||
class Man; | ||
class CAManBase: Man { | ||
class ACE_Actions { | ||
class ACE_MainActions { | ||
class ACE_Dogtag { | ||
displayName = CSTRING(itemName); | ||
condition = ""; | ||
statement = ""; | ||
showDisabled = 0; | ||
priority = 3; | ||
icon = ""; //@todo | ||
class ACE_CheckDogtag { | ||
displayName = CSTRING(checkDogtag); | ||
condition = QUOTE([ARR_2(_player,_target)] call FUNC(canCheckDogtag)); | ||
statement = QUOTE([ARR_2(_player,_target)] call FUNC(checkDogtag)); | ||
showDisabled = 0; | ||
priority = 3; | ||
icon = ""; //@todo | ||
}; | ||
class ACE_TakeDogtag { | ||
displayName = CSTRING(takeDogtag); | ||
condition = QUOTE([ARR_2(_player,_target)] call FUNC(canTakeDogtag)); | ||
statement = QUOTE([ARR_2(_player,_target)] call FUNC(takeDogtag)); | ||
showDisabled = 0; | ||
priority = 3; | ||
icon = ""; //@todo | ||
}; | ||
}; | ||
}; | ||
}; | ||
class ACE_SelfActions { | ||
class ACE_Equipment { | ||
class ACE_CheckDogtags { | ||
displayName = CSTRING(checkItem); | ||
condition = "true"; | ||
statement = ""; | ||
insertChildren = QUOTE(_this call DFUNC(addDogtagActions)); | ||
}; | ||
}; | ||
}; | ||
}; | ||
}; |
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,16 @@ | ||
class CfgWeapons { | ||
class ACE_ItemCore; | ||
class InventoryItem_Base_F; | ||
|
||
class ACE_dogtag: ACE_ItemCore { | ||
author = ECSTRING(common,ACETeam); | ||
scope = 0; | ||
displayName = CSTRING(itemName); | ||
model = "\A3\weapons_F\ammo\mag_univ.p3d"; //@todo? | ||
//picture = QUOTE(PATHTOF(images\picture.paa)); @todo | ||
class ItemInfo: InventoryItem_Base_F { | ||
mass = 0; //too small to for 1 ? | ||
}; | ||
}; | ||
ACE_DOGTAGS(ACE_dogtag) | ||
}; |
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,50 @@ | ||
class RscPicture; | ||
class RscStructuredText; | ||
|
||
class RscTitles { | ||
class GVAR(tag) { | ||
idd = -1; | ||
onLoad = QUOTE(uiNamespace setVariable [ARR_2(QUOTE(QGVAR(tag)),_this select 0)]); | ||
onUnload = QUOTE(uiNamespace setVariable [ARR_2(QUOTE(QGVAR(tag)),nil)]); | ||
movingEnable = false; | ||
duration = 5; | ||
fadeIn = 0.2; | ||
fadeOut = 0.2; | ||
|
||
class controls { | ||
class background: RscPicture { | ||
idc = 1000; | ||
text = QUOTE(PATHTOF(data\dogtag.paa)); | ||
sizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; | ||
colorText[] = {1, 1, 1, 1}; | ||
colorBackground[] = {0, 0, 0, 0}; | ||
x = ((safezoneX + safezoneW) - (10 * (((safezoneW / safezoneH) min 1.2) / 40)) - 2.9 * (((safezoneW / safezoneH) min 1.2) / 40)); | ||
y = safeZoneY + 0.175 * safezoneH; | ||
w = (8 * (((safezoneW / safezoneH) min 1.2) / 40)); | ||
h = (4 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)); | ||
font = "EtelkaMonospacePro"; | ||
}; | ||
class nickname: RscStructuredText { | ||
idc = 1001; | ||
text = ""; | ||
sizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; | ||
colorText[] = {1, 1, 1, 1}; | ||
colorBackground[] = {0, 0, 0, 0}; | ||
x = ((safezoneX + safezoneW) - (8.4 * (((safezoneW / safezoneH) min 1.2) / 40)) - 2.9 * (((safezoneW / safezoneH) min 1.2) / 40)); | ||
y = safeZoneY + 0.2 * safezoneH; | ||
w = (5.9 * (((safezoneW / safezoneH) min 1.2) / 40)); | ||
h = (4 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)); | ||
font = "EtelkaMonospacePro"; | ||
class Attributes { | ||
font = "EtelkaMonospacePro"; | ||
color = "#FFFFFF"; | ||
align = "center"; | ||
valign = "middle"; | ||
shadow = 1; | ||
shadowColor = "#3f4345"; | ||
size = "0.85"; | ||
}; | ||
}; | ||
}; | ||
}; | ||
}; |
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,11 @@ | ||
ace_dogtags | ||
========== | ||
|
||
Adds options to check and take dog tag from dead units | ||
|
||
|
||
## Maintainers | ||
|
||
The people responsible for merging changes to this component or answering potential questions. | ||
|
||
- [SzwedzikPL](https://github.com/SzwedzikPL) |
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,10 @@ | ||
PREP(addDogtagActions); | ||
PREP(addDogtagItem); | ||
PREP(canCheckDogtag); | ||
PREP(canTakeDogtag); | ||
PREP(checkDogtag); | ||
PREP(checkDogtagItem); | ||
PREP(getDogtagItem); | ||
PREP(sendDogtagData); | ||
PREP(showDogtag); | ||
PREP(takeDogtag); |
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,6 @@ | ||
#include "script_component.hpp" | ||
|
||
[QGVAR(showDogtag), DFUNC(showDogtag)] call EFUNC(common,addEventHandler); | ||
[QGVAR(sendDogtagData), DFUNC(sendDogtagData)] call EFUNC(common,addEventHandler); | ||
[QGVAR(getDogtagItem), DFUNC(getDogtagItem)] call EFUNC(common,addEventHandler); | ||
[QGVAR(addDogtagItem), DFUNC(addDogtagItem)] call EFUNC(common,addEventHandler); |
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,7 @@ | ||
#include "script_component.hpp" | ||
|
||
ADDON = false; | ||
|
||
#include "XEH_PREP.hpp" | ||
|
||
ADDON = true; |
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,3 @@ | ||
#include "script_component.hpp" | ||
|
||
#include "XEH_PREP.hpp" |
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,18 @@ | ||
#include "script_component.hpp" | ||
|
||
class CfgPatches { | ||
class ADDON { | ||
units[] = {}; | ||
weapons[] = {}; | ||
requiredVersion = REQUIRED_VERSION; | ||
requiredAddons[] = {"ace_common"}; | ||
author[] = {"SzwedzikPL"}; | ||
authorUrl = "https://github.com/SzwedzikPL/"; | ||
VERSION_CONFIG; | ||
}; | ||
}; | ||
|
||
#include "CfgEventHandlers.hpp" | ||
#include "CfgWeapons.hpp" | ||
#include "CfgVehicles.hpp" | ||
#include "Dogtag.hpp" |
Binary file not shown.
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,40 @@ | ||
/* | ||
* Author: SzwedzikPl | ||
* Creates one action per dogtag. | ||
* | ||
* Arguments: | ||
* 0: Target <OBJECT> | ||
* 1: Player <OBJECT> | ||
* | ||
* Return Value: | ||
* Children actions <ARRAY> | ||
* | ||
* Public: No | ||
*/ | ||
#include "script_component.hpp" | ||
|
||
params ["_target", "_player"]; | ||
|
||
//Get all dogtags and their ids | ||
private _unitDogtags = []; | ||
private _unitDogtagIDs = []; | ||
{ | ||
private _id = getNumber (configFile >> "CfgWeapons" >> _x >> QGVAR(tagID)); | ||
if(_id > 0) then { | ||
_unitDogtags pushback _x; | ||
_unitDogtagIDs pushback _id; | ||
}; | ||
} forEach items _player; | ||
|
||
//Create action children for all dogtags | ||
private _actions = []; | ||
{ | ||
private _tagID = _unitDogtagIDs select _forEachIndex; | ||
private _displayName = format ["%1 #%2", getText (configFile >> "CfgWeapons" >> _x >> "displayName"), _tagID]; | ||
private _picture = getText (configFile >> "CfgWeapons" >> _x >> "picture"); | ||
|
||
private _action = [_x, _displayName, _picture, {_this call FUNC(checkDogtagItem)}, {true}, {}, _x] call EFUNC(interact_menu,createAction); | ||
_actions pushBack [_action, [], _player]; | ||
} forEach _unitDogtags; | ||
|
||
_actions |
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 @@ | ||
/* | ||
* Author: SzwedzikPl | ||
* Adds dogtag item to unit (triggered by server) | ||
* | ||
* Arguments: | ||
* 0: Item class <STRING> | ||
* 1: Nickname on dogtag <STRING> | ||
* | ||
* Return Value: | ||
* None | ||
* | ||
* Public: No | ||
*/ | ||
#include "script_component.hpp" | ||
|
||
params ["_item", "_nickname"]; | ||
|
||
if(_item == "") exitWith {}; | ||
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.
|
||
|
||
[ace_player, _item] call CBA_fnc_addItem; | ||
|
||
private _displayText = format [localize LSTRING(takeDogtagSuccess), _nickname]; | ||
[_displayText] call EFUNC(common,displayText); |
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,20 @@ | ||
/* | ||
* Author: SzwedzikPl | ||
* Checks if dogtag can be checked. | ||
* | ||
* Arguments: | ||
* 0: Player <OBJECT> | ||
* 1: Target <OBJECT> | ||
* | ||
* Return Value: | ||
* True if dogtag can be checked <BOOL> | ||
* | ||
* Public: No | ||
*/ | ||
#include "script_component.hpp" | ||
|
||
params ["_player", "_target"]; | ||
|
||
if(isNull _target) exitWith {false}; | ||
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. same |
||
|
||
!alive _target |
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,20 @@ | ||
/* | ||
* Author: SzwedzikPl | ||
* Checks if dogtag can be taken. | ||
* | ||
* Arguments: | ||
* 0: Player <OBJECT> | ||
* 1: Target <OBJECT> | ||
* | ||
* Return Value: | ||
* True if dogtag can be taken <BOOL> | ||
* | ||
* Public: No | ||
*/ | ||
#include "script_component.hpp" | ||
|
||
params ["_player", "_target"]; | ||
|
||
if(isNull _target) exitWith {false}; | ||
|
||
!alive _target |
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 @@ | ||
/* | ||
* Author: SzwedzikPl | ||
* Checks unit dogtag | ||
* | ||
* Arguments: | ||
* 0: Player <OBJECT> | ||
* 1: Target <OBJECT> | ||
* | ||
* Return Value: | ||
* None | ||
* | ||
* Public: No | ||
*/ | ||
#include "script_component.hpp" | ||
|
||
params ["_player", "_target"]; | ||
|
||
if(_target getVariable [QGVAR(dogtagTaken), false]) then { | ||
[localize LSTRING(noDogtag)] call EFUNC(common,displayText); | ||
} else { | ||
private _nickname = [_target, false, true] call EFUNC(common,getName); | ||
[QGVAR(showDogtag), [_nickname]] call EFUNC(common,localEvent); | ||
}; |
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,19 @@ | ||
/* | ||
* Author: SzwedzikPl | ||
* Check dogtag self menu action | ||
* | ||
* Arguments: | ||
* 0: Player <OBJECT> | ||
* 1: Target <OBJECT> | ||
* 2: Item class <STRING> | ||
* | ||
* Return Value: | ||
* Mone | ||
* | ||
* Public: No | ||
*/ | ||
#include "script_component.hpp" | ||
|
||
params ["_player", "_target", "_item"]; | ||
|
||
[QGVAR(sendDogtagData), [_player, _item]] call EFUNC(common,serverEvent); |
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,40 @@ | ||
/* | ||
* Author: SzwedzikPl | ||
* Server: creates new dogtag item and send it to client | ||
* | ||
* Arguments: | ||
* 0: Player <OBJECT> | ||
* 1: Target <OBJECT> | ||
* | ||
* Return Value: | ||
* None | ||
* | ||
* Public: No | ||
*/ | ||
#include "script_component.hpp" | ||
|
||
if(!isServer) exitWith {}; | ||
|
||
params ["_target", "_unit"]; | ||
TRACE_2("getDogtagItem",_target,_unit); | ||
|
||
private _allDogtags = missionNameSpace getVariable [QGVAR(allDogtags), []]; | ||
private _allDogtagNicknames = missionNameSpace getVariable [QGVAR(allDogtagNicknames), []]; | ||
|
||
private _nextID = count _allDogtags + 1; | ||
|
||
if(_nextID > 999) exitWith {}; | ||
|
||
private _nickname = [_unit, false, true] call EFUNC(common,getName); | ||
private _item = format ["ACE_dogtag_%1", _nextID]; | ||
_allDogtags pushBack _item; | ||
_allDogtagNicknames pushBack _nickname; | ||
|
||
missionNameSpace setVariable [QGVAR(allDogtags), _allDogtags]; | ||
missionNameSpace setVariable [QGVAR(allDogtagNicknames), _allDogtagNicknames]; | ||
|
||
if(isMultiplayer) then { | ||
[QGVAR(addDogtagItem), [_target], [_item]] call EFUNC(common,targetEvent); | ||
} else { | ||
[QGVAR(addDogtagItem), [_item, _nickname]] call EFUNC(common,localEvent); | ||
}; |
Oops, something went wrong.
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.
pushBack