Current Side
Moderator: Moderators
Current Side
Does anyone know of a spring lua variable that would allow me to execute a command if you are playing as a certain faction?
- CarRepairer
- Cursed Zero-K Developer
- Posts: 3359
- Joined: 07 Nov 2007, 21:48
Re: Current Side
Beware however, if you develop using an empty script with spring.exe, that value is nil (or empty string) so be sure that you account for that.
Re: Current Side
yeah true.. it is usually not a good idea to rely on that. as in spring, you can change faction during the game (capture or resurrect an enemy construction unit, loose your own construction units), you should rather rely on the current units in the team, if possible.
Last edited by hoijui on 13 Dec 2010, 16:59, edited 1 time in total.
Re: Current Side
omg i was wondering why it would not work.CarRepairer wrote:Beware however, if you develop using an empty script with spring.exe, that value is nil (or empty string) so be sure that you account for that.
wtfisthatshit.jpg
Re: Current Side
Code: Select all
local localplayerID = Spring.GetLocalTeamID()
local _,_,_,_,f = Spring.GetTeamInfo(localplayerID)
local _,faction = Spring.GetSideData (f)
Spring.Echo ("You are playing as faction:" .. faction)
Turns out it was all fine, Spring just fails to set faction when playing over spring.exe directly. So use a lobby.
To change the resource/faction names see
function widget:Initialize()
at the end of the file.
- Attachments
-
- tp_resdisplay_hack.lua
- works in xta
- (4.46 KiB) Downloaded 132 times
- Forboding Angel
- Evolution RTS Developer
- Posts: 14673
- Joined: 17 Nov 2005, 02:43
Re: Current Side
get moar wood! hur hur 

Re: Current Side
What do you mean with an empty script? The configuration file?CarRepairer wrote:Beware however, if you develop using an empty script with spring.exe, that value is nil (or empty string) so be sure that you account for that.
Re: Current Side
he means if you run spring.exe directly and not via a lobby.