GetTeamResources "received" value buggy?

GetTeamResources "received" value buggy?

Discuss Lua based Spring scripts (LuaUI widgets, mission scripts, gaia scripts, mod-rules scripts, scripted keybindings, etc...)

Moderator: Moderators

Post Reply
User avatar
TheFatController
Balanced Annihilation Developer
Posts: 1177
Joined: 10 Dec 2006, 18:46

GetTeamResources "received" value buggy?

Post by TheFatController »

After two buggy games (both on Tropical if that matters) where my metalmaker AI wasn't responding to received energy from allies I did a lot of poking at my code trying to figure out why and eventually gave up after finding nothing that would cause it to ignore all energy received. I then got sent a replay by another player where the same thing happens so being determined to fix it I started outputting every variable I was tracking to find out which was reporting the wrong value...

It turned out the value being returned by GetTeamResources for received energy was always 0 despite him receiving energy from his allies, here's the replay:

http://pw3n.net/070211-VallesMarineris_v4-0.74b3.sdf

The player you want to watch is Ohmegaherz (Black), his received energy is never anything but 0 despite his allies hitting their share limits many times and his drain exceeding his output while full energy...

(you can spy on his received energy with a simple lua script)
User avatar
TheFatController
Balanced Annihilation Developer
Posts: 1177
Joined: 10 Dec 2006, 18:46

Post by TheFatController »

Bump.
User avatar
TheFatController
Balanced Annihilation Developer
Posts: 1177
Joined: 10 Dec 2006, 18:46

Post by TheFatController »

Okay I have this bug identified now :)

Here's a widget that demonstrates the bug: http://pw3n.net/rec_spy.lua

It watches received energy and spams the value received if it's greater than zero, to highlight what's going wrong all you have to do is spectate any game or replay (I've tested four or five now) and watch the player on any team with the highest number by their name on the info list.

Their reported energy received is always 0 so the widget will be silent (as opposed to occasionally spammy with other players)


My guess is theres a loop or counter or something in the spring code thats too short and missing the last teammate.
Lippy
Posts: 327
Joined: 16 Jul 2006, 00:24

Post by Lippy »

Nice spot, I would recommend reporting this to mantis, where hopefully some dev will sort it, although test it with the latest SVN, as it may already be sorted with the better implementation of lua. (unfortunately that will be harder as you can't use replays for 74b3 :()
Post Reply

Return to “Lua Scripts”