Page 1 of 1

Game.gameID not working

Posted: 12 Mar 2010, 08:31
by knorke
Maybe it works in multiplayer but i need it for replays and singleplayer and it doesnt seem to work there.

Code: Select all

function widget:Initialize()
Spring.Echo ("game id:" .. tostring(Game.gameID) )
end
shouldnt this display something like
game id: 994b01c0833aee69ad13f3
it only shows
game id:

Without the tostring it doesnt work either.
Lua noob mistake?
Game.version works.

Re: Game.gameID not working

Posted: 12 Mar 2010, 18:34
by SirMaverick

Re: Game.gameID not working

Posted: 12 Mar 2010, 23:25
by knorke
Image
oh no :(
what other way would there be to identify a game/replay?
mapname and modname can be the same as well as players.

Re: Game.gameID not working

Posted: 12 Mar 2010, 23:43
by SirMaverick
Parse chat or infolog? GameID is printed there.

Re: Game.gameID not working

Posted: 05 Jul 2011, 18:27
by CarRepairer
Bump!!!

Re: Game.gameID not working

Posted: 07 May 2012, 15:59
by PepeAmpere
Game.gameID still not working, its empty string AFTER start of the game... in frame 10 or later, too.

Re: Game.gameID not working

Posted: 09 May 2012, 18:28
by knorke
https://github.com/spring/spring/commit ... c0d17d874e
---
what i used in the end to get gameid from chat:

Code: Select all

function widget:AddConsoleLine(msg, priority)
if (string.find (msg, "GameID:") ~= nil) then
	game_id = string.sub (msg, 9) -- "GameID: xxxxxxx"
(if you do not want to wait)