<!--quoteo(post=2026377:date=Nov 16 2012, 08:29 PM:name=TimMc)--><div class='quotetop'>QUOTE (TimMc @ Nov 16 2012, 08:29 PM) <a href="index.php?act=findpost&pid=2026377"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->Entity.lua is updated to accept tables aswell as its old string. <!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->function GetEntitiesForTeam(className, teamNumber)
assert(type(teamNumber) == "number")
local function teamFilterFunction(entity) return HasMixin(entity, "Team") and entity:GetTeamNumber() == teamNumber end
if type(className) == "string" return GetEntitiesWithFilter(Shared.GetEntitiesWithClassname(className), teamFilterFunction) [u][b]elseif[/b][/u] local entitySet = { } for i,v in ipairs(className) do for k,x in pairs(GetEntitiesWithFilter(Shared.GetEntitiesWithClassname(v), teamFilterFunction)) do table.insert(entitySet, x) end end return entitySet end
For starters, you do have an elseif without a condition. An elseif is exactly what it sounds like; a combination of an 'if' and an 'else' statement. If you with to simply have the second part fire if the first part doesn't, just make it an else.
<!--quoteo(post=2026695:date=Nov 17 2012, 02:11 AM:name=ChaosXBeing)--><div class='quotetop'>QUOTE (ChaosXBeing @ Nov 17 2012, 02:11 AM) <a href="index.php?act=findpost&pid=2026695"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->For starters, you do have an elseif without a condition. An elseif is exactly what it sounds like; a combination of an 'if' and an 'else' statement. If you with to simply have the second part fire if the first part doesn't, just make it an else.<!--QuoteEnd--></div><!--QuoteEEnd-->
Ah bugger that was obvious. :X
Edit: That didn't fix it. Still getting the error when these two files are included. Is there any way to scroll up in the game console? I see the end of an error (probably cascading down from this), but not where it begins.
It should be there, unless you're like me and the log doesn't generate.
As an aside, it's nearly impossible to see console messages during world loading right now, but hopefully after the next patch all of the new console-spamming world gen code will be removed, so it'll be a lot easier. (The loading messages were put there in 229 so that UWE could track down some of the loading problems people have been having.)
I'm going on vacation this week so the timing works out fairly well for me, but I imagine it'll make things difficult for you right now.
Comments
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->function GetEntitiesForTeam(className, teamNumber)
assert(type(teamNumber) == "number")
local function teamFilterFunction(entity)
return HasMixin(entity, "Team") and entity:GetTeamNumber() == teamNumber
end
if type(className) == "string"
return GetEntitiesWithFilter(Shared.GetEntitiesWithClassname(className), teamFilterFunction)
[u][b]elseif[/b][/u]
local entitySet = { }
for i,v in ipairs(className) do
for k,x in pairs(GetEntitiesWithFilter(Shared.GetEntitiesWithClassname(v), teamFilterFunction)) do table.insert(entitySet, x) end
end
return entitySet
end
end<!--c2--></div><!--ec2--><!--QuoteEnd--></div><!--QuoteEEnd-->
For starters, you do have an elseif without a condition. An elseif is exactly what it sounds like; a combination of an 'if' and an 'else' statement. If you with to simply have the second part fire if the first part doesn't, just make it an else.
Ah bugger that was obvious. :X
Edit: That didn't fix it. Still getting the error when these two files are included. Is there any way to scroll up in the game console? I see the end of an error (probably cascading down from this), but not where it begins.
missing "then"
RTFM, lazy ***!
missing "then"
RTFM, lazy ***!<!--QuoteEnd--></div><!--QuoteEEnd-->
Ah... yes.. honestly I hadn't look at it today. This is what I get for making threads at 2am before bed last night.
On topic of debugging though, how do I read the entire console logs for NS2? I cannot scroll up.
It should be there, unless you're like me and the log doesn't generate.
As an aside, it's nearly impossible to see console messages during world loading right now, but hopefully after the next patch all of the new console-spamming world gen code will be removed, so it'll be a lot easier. (The loading messages were put there in 229 so that UWE could track down some of the loading problems people have been having.)
I'm going on vacation this week so the timing works out fairly well for me, but I imagine it'll make things difficult for you right now.