commanderawesome wrote:I'm trying to get it to check if each class exists. It still crashed even before I added those.
That's the wrong way to go about it, then, because (for example)
all_inf_rifleman will never exist (unless you make it a variable. Edit: Nedarb, you're making the same mistake.
"All_inf_rifleman" as a reference is a string, not a variable.). You're trying to check to see (assuming you're working with SetupTeams) what class is assigned to the
soldier table, and to do that you'd want to do something like:
Code: Select all
if soldier[1] == "all_inf_rifleman" then
SetClassProperty("all_inf_rifleman", "GeometryName", "all_inf_snowtrooper")
end
I don't know offhand if that's local to the SetupTeams .lua, but you should be able to check and verify that.
And if everything in the code you showed us worked (or had already stopped working before you added it), why are you showing us this? You need to be able to show where something crashed - it's hard to make a judgment when you post something you've already modified post-crash. In other words, work back until you have something that works, and then add things until it doesn't. We can help you understand better what the problem is then.