-
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
Move SelfActions from postInit to config #6791
Conversation
11cdc5b
to
545c16e
Compare
I object.
We save just some hundreds ms at mission start but I don't think it's really worth it. That's why I added both actions with postInit. Maybe |
Why does this action have to be flexible? Has nothing in there that one would want to change. |
Any code can be improved. And it's easier to improve it if testing is simple. |
Then improve it and put it into config when it's improved. |
addons/zeus/CfgVehicles.hpp
Outdated
class ACE_SelfActions { | ||
class GVAR(create) { | ||
displayName = CSTRING(CreateZeus); | ||
condition = QUOTE(\ |
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.
14:09:37 File z\ace\addons\zeus\CfgVehicles.hpp, line 325: '/CfgVehicles/CAManBase/ACE_SelfActions/ace_zeus_create.condition': Missing ';' at the end of line
14:09:37 ErrorMessage: File z\ace\addons\zeus\CfgVehicles.hpp, line 325: /CfgVehicles/CAManBase/ACE_SelfActions/ace_zeus_create/: Wrong # directive
14:09:37 Application terminated intentionally
ErrorMessage: File z\ace\addons\zeus\CfgVehicles.hpp, line 325: /CfgVehicles/CAManBase/ACE_SelfActions/ace_zeus_create/: Wrong # directive
I think complex code like this should just be in a function, I hate dealing with ARR_X and string escaping
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.
Is that mikeros tools? Might be a bug in his parser ^^
Yeah I'll move it.. Name?
zeus_fnc_actionCreateCondition ?
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's a condition, so zeus_fnc_canCreate
(something with canX
).
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 was crashing arma on game start
the way it's now handled in master is good enough imho (https://github.com/acemod/ACE3/blob/master/addons/zeus/XEH_postInit.sqf#L85-L121)
otherwise zeus_fnc_actionCreateCondition
/zeus_fnc_actionCreateStatement
isn't bad because they are sorted alphabetically
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.
The code in current master will still execute code when you spawn units in Zeus right? Even if just once per type. Whereas the config one wouldn't even do that?
Also it seems like with the script code we'll be adding it to tons of CAManBase based classes, even though we really only need CAManBase once.
I checked the config code using the make script, Don't remember whether mikero or armake.
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.
no code happens on object init
only fires once each time the player controls a new man/vehicle type
Co-Authored-By: dedmen <dedmen@users.noreply.github.com>
Co-Authored-By: dedmen <dedmen@users.noreply.github.com>
* Move zeus SelfActions to config * Port CBA PR #1048 * Move Land_Camping_Light_off_F TurnOn action to config * Move createModule function to script func * Update addons/zeus/functions/fnc_canCreateModule.sqf Co-Authored-By: dedmen <dedmen@users.noreply.github.com> * Apply suggestions from code review Co-Authored-By: dedmen <dedmen@users.noreply.github.com> * Teaching it a lesson about spacing * Update CBA: script_macros_common.hpp * Just change admin in cba macro
Also swapped around the condition on the create, it would do the expensive switch before doing the cheap isNil.