2025-07-18 02:06 CEST

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0002514Spring engineLuapublic2011-08-05 16:46
ReporterKloot 
Assigned Toabma 
PrioritynormalSeveritymajorReproducibilityalways
StatusresolvedResolutionunable to reproduce 
Product Version0.82.7+git 
Target Version83.0Fixed in Version 
Summary0002514: (master) GameOver() event doesn't reach Lua when the game end is controlled via lua
Descriptionat least the following callins are affected, possibly others:

EventHandler.*
    void GameStart();
    void GameOver(const std::vector<unsigned char>& winningAllyTeams);
    void GamePaused(int playerID, bool paused);

(EventHandler::listGameStart, ::listGameOver, ::listGamePaused are all empty, even though LuaHandle{Synced} should get them as an EventClient)
TagsNo tags attached.
Checked infolog.txt for Errors
Attached Files

-Relationships
+Relationships

-Notes

~0006854

jK (developer)

Last edited: 2011-07-02 14:53

Everything is fine.
The EventHandler/EventClient system is not static, it makes heavy usage of UpdateCallIn, and so dynamically only bind the events which are used by the lua widget/gadgets at that time. This is done because many events are known to eat your cpu time for breakfast.

Now I assume you tried to use those events in a widget/gadget and wondered why they don't work. That's cause the current (widget-/gadget-)handler don't use parse the engine supported events list (Script.GetCallInList), instead they use a static list. So to get a new event/callin working atn you need to modify multiple files in the lua enviroment (callin.lua + handler.lua).
All this gets rendered unnecessary when the new universal handler is finished (ETA for widget one ~1week, finishing last gadget/widget inconsistences takes longer).

~0006859

Kloot (developer)

Last edited: 2011-07-02 16:08

Yeah I know all that, and I have modified callins.lua + gadgets.lua to include all the Game* callins. I also have a test gadget using them, still the problem is that the CLuaHandle::Game* functions themselves are never called because the EventHandler::listGame* lists are empty (except listGameFrame).

To clarify: GameFrame works fine, GameStart, GameOver and GamePaused do not (the test gadget listens for all of these).

~0006862

jK (developer)

I tested it and it works fine here.

~0006980

zwzsg (reporter)

I am using Spring 0.82+.4.0 (0.82.3-2365-g82c3187)
I am using the default widget handler that ships with it.

I have a gadget that does: Spring.GameOver(WinningAllies)
The engine show the hardcoded gameover screen, so yes engine knows game is over.

I have a widget with:
function widget:GameOver()
  Spring.Echo("Got a Game Over Callin!")
  ....
end

This widget function is not called.

Looks like a bug to me.




I don't understand jK explanation. I know that that under 0.82.7.1, the widget:GameOver callin was called, and that in 0.83+, it's not. How is that a "user error"?

~0007216

abma (administrator)

Last edited: 2011-08-05 03:49

kloot/zwsg: can you give an example, how to reproduce it?
here it works fine too.... (at least gamestart):

zwsg: 0.82.3-2365-g82c3187 is quiet old... there are already about 800 new commits/changes in the development version of spring...


function widget:GameStart()
  Spring.Echo("Got a Game Start Callin!")
end

->

[f=0000000] Got a Game Start Callin!



edit: sorry late night confusion

~0007224

FLOZi (reporter)

I tested it using BrainDamages game_end.lua gadget and a widget:GameOver callin with a more recent build and it works fine for me.

~0007225

abma (administrator)

thanks FLOZi!

if it still doesn't work, please give a full example how to reproduce it!
+Notes

-Issue History
Date Modified Username Field Change
2011-07-02 14:02 Kloot New Issue
2011-07-02 14:02 Kloot Graphics Card => unknown
2011-07-02 14:53 jK Note Added: 0006854
2011-07-02 14:53 jK Note Edited: 0006854
2011-07-02 14:54 jK Status new => feedback
2011-07-02 16:02 Kloot Note Added: 0006859
2011-07-02 16:08 Kloot Note Edited: 0006859
2011-07-02 17:34 jK Note Added: 0006862
2011-07-09 18:10 zwzsg Note Added: 0006980
2011-08-04 19:03 abma Target Version => 0.83.0
2011-08-04 19:15 abma Note Added: 0007216
2011-08-05 02:59 abma Summary none of the Game* events reach Lua => (master) GameOver() event doesn't reach Lua
2011-08-05 03:00 abma Summary (master) GameOver() event doesn't reach Lua => (master) GameOver() event doesn't reach Lua when the game end is controlled via lua
2011-08-05 03:02 abma Status feedback => resolved
2011-08-05 03:02 abma Resolution open => unable to reproduce
2011-08-05 03:02 abma Assigned To => abma
2011-08-05 03:18 abma Status resolved => feedback
2011-08-05 03:18 abma Resolution unable to reproduce => reopened
2011-08-05 03:18 abma Assigned To abma =>
2011-08-05 03:21 abma Note Edited: 0007216
2011-08-05 03:21 abma Note Edited: 0007216
2011-08-05 03:22 abma Note Edited: 0007216
2011-08-05 03:23 abma Note Edited: 0007216
2011-08-05 03:49 abma Note Edited: 0007216
2011-08-05 16:30 FLOZi Note Added: 0007224
2011-08-05 16:46 abma Note Added: 0007225
2011-08-05 16:46 abma Status feedback => resolved
2011-08-05 16:46 abma Resolution reopened => unable to reproduce
2011-08-05 16:46 abma Assigned To => abma
+Issue History