-
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 #3962
Conversation
…ts support, little cleanup
Added custom dogtag model and images
- Leave up to CBA to decide if events should be local or remote - Imp
str(floor random 9) + str(floor random 9) + str(floor random 9) + "-" + | ||
str(floor random 9) + str(floor random 9) + "-" + | ||
str(floor random 9) + str(floor random 9) + str(floor random 9), | ||
selectRandom ["O POS", "O NEG", "A POS", "A NEG", "B POS", "B NEG", |
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.
tab :)
Im bringing up a silly idea again I had back in AGM. |
Incoming |
I don't think that's silly, I like it 👍 I'd probably do a |
@@ -19,13 +19,24 @@ private _dogTagData = _target getVariable QGVAR(dogtagData); | |||
if (!isNil "_dogTagData") exitWith {_dogTagData}; | |||
|
|||
// Create dog tag data once for the unit: nickname, code (eg. 135-13-900) and blood type | |||
private ["_bloodTypeIndex", "_code"]; | |||
//hint getplayeruid _target; | |||
if ((typename getplayeruid _target) == "SCALAR") then { |
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 never be true, also not using isEqualType
😝
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.
Why wouldn't it work?
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 don't get the point of this.
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.
getPlayerUID
always returns a string
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.
getPlayerUID
is the correct case. As far as I can tell it will always report a string, so it will never be typeOf
SCALAR
NVM I'm stupid |
Store object instead of bool to indicate when dogtags have been taken When object respawns, the the old object reference won't apply (defacto reset)
getPlayerUID doen't work for this, because it returns "" for dead players. I'll switch to something inspired on @commy2 's code |
_code = (str getplayeruid _target) select [0, 3] + "-" + | ||
(str getplayeruid _target) select [3, 2] + "-" + | ||
(str getplayeruid _target) select [5, 3]; | ||
if !(getplayeruid _target in ["", "_SP_AI_", "_SP_PLAYER_"]) then { |
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.
Minor, but it would probably make sense to store the value of getPlayerUID
in a variable instead of using the command multiple times (also the lack of camel case triggers me 🐫)
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.
Otherwise 👍
Fix issue with dogtag respawn/setVariable
…to dogtags # Conflicts: # addons/dogtags/functions/fnc_getDogtagData.sqf
Actually, I just merged @commy2 's PR. The service number is not persistent anymore, but that can be improved in the future. |
Service number could be made persistent using:
Then just split as necessary. I'm not familiar with the format of service numbers, so not sure if the Only semi-persistent for names shorter than 8 characters long (suppose you could loop around or something if you wanted true persistence for those also). |
@SilentSpike, they totally go from 0 to 8 |
Ok guys, do you think this should be in 3.6.0? 👍 👎 |
Functional (presumably) version of above snippet:
|
Blood type? I'm not so sure about that. |
I guess you may argue that we shouldn't give players different blood types if we don't simulate blood compatibility in medical. But you might as well say we do, only that blood bags contain O Negative blood, which is close to universally compatible. Anyway, I just wanted dogtags to look as genuine as possible, and they usually do feature blood types on them. I could randomize religion instead, but that sounds even more controversial. |
I like blood type, religion is kinda meh unless we put "Jedi" on all of them (I'd argue that's a good idea actually!). |
OC I was joking about religion, mostly because I don't want to have to deal with tickets complaining about Al'Qaedan Jews and Chinese Quakers. And oc Klingon Jedis would create complains too. |
About And for anything else could always fallback to |
is it possible where you can look up the dog tags when they are in body bags? |
I support @kripto202 's idea, should be straightfoward implementation with |
This is true, we could use an XEH PostInit or something, however the way it's done now means that code doesn't run unless it needs to. You could go a whole mission without anybody checking dogtags. |
Similar to how we're handling blood types, uses the unit's name to generate a valid three/two/four format SSN. For names less than 9 characters long this will currently generate a unique SSN only up to the length of the name and append valid digits as necessary.
Names shorter than the required 9 characters are now reused until we have 9 characters - making for fully unique generation. To keep things distributed as pleasantly as possible they're itterated over with a step of two - alternating between odd and even indexes every full loop. Similarly, the slice of string used for names longer than 9 characters is now offset based on the length of the name.
Generate SSN of unit from their name
Add dogtag actions to body bags
When merged this pull request will:
dogtag
branch in our repoI think this is ready for 3.6.0. Improvements can be pushed for later, given they wouldn't interfere (there's no public API yet).
Proposed by @jonpas :
I'm been thinking about the proposal, and although it's easy to implement. However, I think it's not needed for first release.