SpliFF wrote:Then you probably have a issue with your FBI, it should look like this if you're using Lua (and you should be):
Code: Select all
customParams = {
ProvideTech = "tech1",
ProvideTechRange = "500",
},
aaahhh ya that was something I was deffenetly missing
thanks I did not realize my fbi needed the customparams feild
unfortunetly it looks like things are still not working quite right
Code: Select all
function widget:CommandNotify(cmdID)
echo( "got here" )
local unitID = Spring.GetSelectedUnits()[1]
if(not unitID) then
echo( "oops" )
return
end
local defID = Spring.GetUnitDefID(unitID)
local Nature = UnitDefs[ defID ]["customParams"]["merciless"]
echo( Nature )
if( 1 == Nature ) then
echo( "if worked" )
Spring.PlaySoundFile("sounds/Regis_ultamate_fight_full.wav")
end
echo( Nature )
end
basically everything works except
Code: Select all
if( 1 == Nature ) then
echo( "if worked" )
Spring.PlaySoundFile("sounds/Regis_ultamate_fight_full.wav")
end
probleam: I get the echo( Nature )'s that stratle it to show up in the consle though ... wich means it is not seeing 1 == Nature as true...
question: does it think I mean the string "Nature" ? or am I assuming that it would just call the operation from that if statment?
also when I take Spring.PlaySoundFile("sounds/Regis_ultamate_fight_full.wav") and place it outisde of the if statment it works right as expected... so its DEFETLY how I wrote the if that is wrong...
any info on my blunder would be great :)
thanks for being patient with my ignorence