-
Notifications
You must be signed in to change notification settings - Fork 737
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
Casing - Move model lookup to cartridge config #9893
Conversation
test code:
results with cup:
Can't find |
Why don't we use the |
The model paths are correct. Classes were not.
|
if (_cartridge == "") then { // return (note: can't use exitWith) | ||
"" | ||
} else { | ||
getText (configFile >> "CfgVehicles" >> _cartridge >> QGVAR(model)) |
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.
What about something like this?
getText (configFile >> "CfgVehicles" >> _cartridge >> QGVAR(model)) | |
private _cartridgeConfig = configFile >> "CfgVehicles" >> _cartridge; | |
private _model = getText (_cartridgeConfig >> QGVAR(model)); | |
if (_model == "model") then { | |
_model = getText (_cartridgeConfig >> "model"); | |
if ("a3\weapons_f\empty" in toLowerANSI _model) then { | |
_model = ""; | |
}; | |
}; | |
// Add file extension if missing (fileExists needs file extension) | |
if ((_model select [count _model - 4]) != ".p3d") then { | |
_model = _model + ".p3d"; | |
}; | |
["", _model] select (fileExists _model) |
The idea is to allow people to override the casings if necessary. model
usually contains valid entries (the empty entry is filtered out), so instead of needing to manually configure every entry, this would allow casing
to use already configured models.
It would avoid us (and 3rd party mods) needing to configure casings, unless specifically wanted to.
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 still need to define QGVAR(model) = "model"
, no?
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.
For FxCartridge
and FxCartridge_Small
only, as the rest (at least in Vanilla) inherit from those. If a mod doesn't inherit from those, then it won't work.
Tbh I'm not a fan of QGVAR(model) = "model"
, but I don't think we can check for QGVAR(model) = ""
.
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 not?
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.
In case people want to undefine it, I imagine they would overwrite it with ""
, intuitively.
We could force "empty"
to signify no casing and write documentation so that people have to adopt it, but it's not very intuitive.
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.
fef0704 is a variation on this,
if ace_casings_model is defined then use is, otherwise just use it's normal model
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 prefer that implementation.
Co-authored-by: johnb432 <[email protected]>
This reverts commit 7471fd4.
new test code:
note the new leading slashes, but the game doesn't seem to mind
|
Co-authored-by: Jouni Järvinen <[email protected]>
Includes changes from #9888 (but it can be merged fist)
ref #9716 (comment)