2025-07-27 22:02 CEST

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0003376Spring engineLuapublic2013-01-05 14:14
Reportersilentwings 
Assigned ToKloot 
PrioritynormalSeverityminorReproducibilityalways
StatusresolvedResolutionno change required 
Product Version91.0 
Target VersionFixed in Version 
Summary0003376: Spring.GetAllFeatures works in unsynced lua but Spring.FeatureCreated doesn't
Description(But Spring.FeatureCreated can only tell you stuff you could have found out anyway from Spring.GetAllFeatures - and Spring.FeatureCreated is much less intensive in lots of situations)

I think the problem is that there is nothing to handle FeatureCreated in https://github.com/spring/spring/blob/develop/cont/LuaUI/widgets.lua.

For example the following code will run perfectly as a gadget (with 'widget'<->'gadget' switched), but won't have any effect as a widget:

function widget:FeatureCreated(featureID, allyTeam)
    Spring.Echo("FeatureCreated called")
end
TagsNo tags attached.
Checked infolog.txt for Errors
Attached Files

-Relationships
+Relationships

-Notes

~0009529

silentwings (reporter)

Same applied to FeatureDestroyed

~0009533

jK (developer)

there is a team & los check for all such callins (UnitCreated, ....)

~0009535

Jazcash (reporter)

I don't understand :< What's the call-in for a feature created or destroyed? Like Silent said, nothing in here about features at all: https://github.com/spring/spring/blob/develop/cont/LuaUI/widgets.lua

~0009536

zerver (reporter)

AFAIK there is no FeatureCreated for unsynced Lua. What maybe should exist is a FeatureEnteredLOS. Silentwings is correct that GetAllFeatures is not an optimal solution because it returns lots of data and can therefore be slow.

~0009538

Jazcash (reporter)

Features are always in LOS anyway though? Or is that just BA?

~0009561

silentwings (reporter)

Last edited: 2013-01-05 10:09

View 2 revisions

We tried adding FeatureCreated to the widget handler in BA and it seems to work fine, see: http://imolarpg.dyndns.org/trac/balatest/changeset/884.

So I guess these commands do exist in unsynced lua and were accidentally missed from the default widgets.lua.

edit: For some reason it re-opened the bug after I posted this comment, which was not my intention.

+Notes

-Issue History
Date Modified Username Field Change
2012-12-23 11:59 silentwings New Issue
2012-12-23 21:44 silentwings Note Added: 0009529
2012-12-25 13:04 jK Note Added: 0009533
2012-12-25 13:04 jK Status new => feedback
2012-12-27 04:34 Jazcash Note Added: 0009535
2012-12-27 16:45 zerver Note Added: 0009536
2012-12-27 18:23 Jazcash Note Added: 0009538
2013-01-05 10:08 silentwings Note Added: 0009561
2013-01-05 10:08 silentwings Status feedback => new
2013-01-05 10:09 silentwings Note Edited: 0009561 View Revisions
2013-01-05 14:14 Kloot Status new => resolved
2013-01-05 14:14 Kloot Resolution open => no change required
2013-01-05 14:14 Kloot Assigned To => Kloot
+Issue History