-
Notifications
You must be signed in to change notification settings - Fork 236
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
Update UEF SACU Enhancement Script #6515
Conversation
units/UEL0301/UEL0301_script.lua
Outdated
end | ||
end, | ||
|
||
---@param self UEL0301 | ||
---@param intel IntelType | ||
OnIntelEnabled = function(self, intel) | ||
CommandUnit.OnIntelEnabled(self, intel) | ||
if self.RadarJammerEnh and self:IsIntelEnabled('Jammer') then | ||
if self.ProcessEnhancementRadarJammer and self:IsIntelEnabled('Jammer') 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 is an unintentional change - it would always be true. See also the RadarJammerEnh
field that is set to true
/false
depending on whether the enhancement exists.
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.
After looking at this can't this just be a part of the 2 Functions for the enhancements now?
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.
So something like
---@param self UEL0301
---@param bp UnitBlueprintEnhancement
ProcessEnhancementRadarJammer = function(self, bp)
self:SetIntelRadius('Jammer', bp.NewJammerRadius or 26)
self:EnableUnitIntel('Enhancement', 'Jammer')
self:AddToggleCap('RULEUTC_JammingToggle')
self:SetEnergyMaintenanceConsumptionOverride(bp.MaintenanceConsumptionPerSecondEnergy or 0)
self:SetMaintenanceConsumptionActive()
if self.IntelEffects then
self.IntelEffectsBag = {}
self:CreateTerrainTypeEffects(self.IntelEffects, 'FXIdle', self.Layer, nil, self.IntelEffectsBag)
end
end,
```
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.
but then do you even need the self.RadarJammerEnh = true
if the part its setting ti for can now be apart of the same function as it wasn't before ?
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.
You can't inline OnIntelEnabled
because that function is called when the jamming toggle is pressed (or whenever else the jammer is enabled), while the enhancement function is called only once when the enhancement is built. Same for OnIntelDisabled
.
If you did inline it, then the jammer's FX and and energy consumption would remain permanently on until the enhancement is removed.
- Added word to dictionary
Following on the changes of #6498
Checklist