View Issue Details

IDProjectCategoryView StatusLast Update
0003376Spring engineLuapublic2013-01-05 14:14
Reportersilentwings Assigned ToKloot  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionno change required 
Product Version91.0 
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

Activities

silentwings

2012-12-23 21:44

reporter   ~0009529

Same applied to FeatureDestroyed

jK

2012-12-25 13:04

developer   ~0009533

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

Jazcash

2012-12-27 04:33

reporter   ~0009535

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

zerver

2012-12-27 16:45

reporter   ~0009536

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.

Jazcash

2012-12-27 18:23

reporter   ~0009538

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

silentwings

2013-01-05 10:08

reporter   ~0009561

Last edited: 2013-01-05 10:09

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.

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
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