So if you guys remember a couple weeks ago, I needed help getting the AI's set up to defend a target, it worked great, in my TEST MAP, but whenever I add the AI to my actual map it crashes when I load up the map. I know its something to do with the AI because when I deleted all the AI it loaded fine, but when I added even 1 AI it crashes my map on load. Is there some limit I am possibly hitting. I do know about the 24 AI limit but I always thought that was how many are allowed on the map at 1 time, not how many spawners you have in radiant, plus that shouldn't even matter because counting the zombies I only have 13 AI.
So I am confused on what could be the problem. I even tested in my test map by adding like 30 or so AI to see if it crashes, which it didn't.
Don't think there is a limit on how many AI spawners in your map. I have atleast 40 spawners in my soviet mod and it doesn't bother Radiant or World at War a bit.
Regarding the SetAILimit() thing, it doesn't seem to matter unless you run the map with developer and developer_script, in which case the game will kick you out of the game if the limit is reached.
Don't think there is a limit on how many AI spawners in your map. I have atleast 40 spawners in my soviet mod and it doesn't bother Radiant or World at War a bit.
Regarding the SetAILimit() thing, it doesn't seem to matter unless you run the map with developer and developer_script, in which case the game will kick you out of the game if the limit is reached.
Can you share the script your using?
Here is the part that deals with the AI. I know its not the prettiest script out there.
first off, what is the stalingradspawn function? second, can we see the error if there is one or the console if it crashes. if its just lagging, put a wait between the spawns
first off, what is the stalingradspawn function? second, can we see the error if there is one or the console if it crashes. if its just lagging, put a wait between the spawns
Code Snippet
Plaintext
Force spawns an actor from an actor spawner, reguardless of whether the spawn point is in sight or if the spawn will cause a telefrag
Taken from the wiki.
There is no error, world at war just stops responding after the bar gets full. Developer 1 and logfile shows me nothing.
First thing is that the stalingradspawn() function only accepts a string(which is the targetname of the ai it spawns). Either remove or change it. Only thing i can think that would cause a freeze/crash.
Also, your randomInt() can return 2, which wouldn't meet the if conditions for the current bombsite locations. Change it to randomInt(1)
Last Edit: September 14, 2015, 10:32:59 pm by daedra descent
Incorrect KVPs then? Maybe there is a typo somewhere in KVPs, which causes the crash
I wouldn't think that would cause a crash since running code on undefined AI/players is pretty common in other maps and they don't seem to crash(unless if gets out of hand like not deleting eyes or something).
Regardless, i'd recommend always doing an if(isdefined()) check on things you can't always guarantee exist, such as variables declared somewhere else in another script and/or function or getting entities in radiant. By doing this you stop the scripts from running code on things that don't exist, potentially preventing problems from happening.
Fixed it. Apparently I cant use the mp40 AI actor, have to use a regular zombie actor and just change the script to give them a gun when they spawn. Kind of wanted a actual soldier but oh well.