UGX-Mods Login

or login with an authentication provider below
Sign In with Google
Sign In with Twitter
Sign In with Discord
Sign In with Steam
Sign In with Facebook
Sign In with Twitch

Map crashes when adding AI

HOT
broken avatar :(
Created 11 years ago
by Dust
0 Members and 1 Guest are viewing this topic.
5,820 views
broken avatar :(
×
broken avatar :(
The King of Zombies
Location: usLouisiana
Date Registered: 24 June 2013
Last active: 6 years ago
Posts
2,148
Respect
Forum Rank
King of the Zombies
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
Signature
Donate to me if you enjoy my work. https://www.paypal.me/thezombiekilla6
×
Dust's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Dust's Contact & Social Linksdust103194MrZ0mbiesFanaticMrZ0mbiesFanatic
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.
broken avatar :(
×
broken avatar :(
☭ Soviet Commander ☭
Location: us
Date Registered: 13 August 2012
Last active: 10 years ago
Posts
2,789
Respect
Forum Rank
King of the Zombies
Primary Group
Community Daedra
My Groups
More
My Contact & Social Links
More
Signature
Let's keep this thread on topic from here on in. -DBZ

+1 to off-topic reply -DBZ

lmao. Too funny.

Goliath Script Placer: http://ugx-mods.com/forum/index.php/topic,11234.msg125257/topicseen.html#new

"...Christ, people. Learn C, instead of just stringing random characters
together until it compiles (with warnings)..."

-Linus Torvalds
×
daedra descent's Groups
Community Daedra
Community Daedra
daedra descent's Contact & Social LinksBlueSoviet
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?
broken avatar :(
×
broken avatar :(
The King of Zombies
Location: usLouisiana
Date Registered: 24 June 2013
Last active: 6 years ago
Posts
2,148
Respect
Forum Rank
King of the Zombies
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
×
Dust's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Dust's Contact & Social Linksdust103194MrZ0mbiesFanaticMrZ0mbiesFanatic
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.

Code Snippet
Plaintext
detect_bombsite()
{
level waittill("inside_opened");
level.defuse_round = level.round_number + 5;
iprintlnbold("Next Defuse Round will be on Round " +level.defuse_round);
while(1)
        {
level waittill("between_round_start");
if(level.round_number == level.defuse_round)
    {
  random_bombsite = RandomInt( 2 );
     
if(random_bombsite == 0)
             { 
             //iprintlnbold("Bombsite equals " +random_bombsite);
             wait 2;
             //iprintlnbold("Planting bomb at A");
             thread plant_bomb_a();
bombsite_a_spawners = getentarray( "bombsite_a_spawner", "targetname" );
for(i=0;i<bombsite_a_spawners;i++)
{
             bombsite_a_spawners[i] stalingradspawn( true );
bombsite_a_spawners[i].dropweapon = false;
}
}

if(random_bombsite == 1)
         {
             //iprintlnbold("Bombsite equals " +random_bombsite);
             wait 2;
             //iprintlnbold("Planting bomb at B");
             thread plant_bomb_b();
bombsite_b_spawners = getentarray( "bombsite_b_spawner", "targetname" );
for(i=0;i<bombsite_b_spawners;i++)
{
             bombsite_b_spawners[i] stalingradspawn( true );
bombsite_b_spawners[i].dropweapon = false;
}
}
        }
    random_round = randomintrange(3,5);
    level.defuse_round = level.round_number + random_round;
    iprintlnbold("Next Defuse Round will be on Round " +level.defuse_round);
}
}

I believe its just Radiant causing the problem because when I dont have the AI in Radiant, it loads up fine, but once I add even 1 AI it crashes.
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 27 January 2015
Last active: 10 years ago
Posts
337
Respect
Forum Rank
Perk Hacker
Primary Group
Member
Signature
×
liamsa669's Groups
liamsa669's Contact & Social Links
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
broken avatar :(
×
broken avatar :(
The King of Zombies
Location: usLouisiana
Date Registered: 24 June 2013
Last active: 6 years ago
Posts
2,148
Respect
Forum Rank
King of the Zombies
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
×
Dust's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Dust's Contact & Social Linksdust103194MrZ0mbiesFanaticMrZ0mbiesFanatic
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.
broken avatar :(
×
broken avatar :(
☭ Soviet Commander ☭
Location: us
Date Registered: 13 August 2012
Last active: 10 years ago
Posts
2,789
Respect
Forum Rank
King of the Zombies
Primary Group
Community Daedra
My Groups
More
My Contact & Social Links
More
×
daedra descent's Groups
Community Daedra
Community Daedra
daedra descent's Contact & Social LinksBlueSoviet
I know its not the prettiest script out there.

Indenting your code using tab at the beginning and in while, for, if, etc will help with that.

Code Snippet
Plaintext
detect_bombsite()
{
level waittill("inside_opened");
level.defuse_round = level.round_number + 5;
iprintlnbold("Next Defuse Round will be on Round " +level.defuse_round);
while(1)
        {
level waittill("between_round_start");
if(level.round_number == level.defuse_round)
    {
  random_bombsite = RandomInt( 2 );
     
if(random_bombsite == 0)
              { 
              //iprintlnbold("Bombsite equals " +random_bombsite);
              wait 2;
            //iprintlnbold("Planting bomb at A");
              thread plant_bomb_a();
bombsite_a_spawners = getentarray( "bombsite_a_spawner", "targetname" );
for(i=0;i<bombsite_a_spawners;i++)
{
            bombsite_a_spawners[i] stalingradspawn( true );
bombsite_a_spawners[i].dropweapon = false;
}
}

if(random_bombsite == 1)
          {
              //iprintlnbold("Bombsite equals " +random_bombsite);
            wait 2;
              //iprintlnbold("Planting bomb at B");
              thread plant_bomb_b();
bombsite_b_spawners = getentarray( "bombsite_b_spawner", "targetname" );
for(i=0;i<bombsite_b_spawners;i++)
{
            bombsite_b_spawners[i] stalingradspawn( true );
bombsite_b_spawners[i].dropweapon = false;
}
}
        }
    random_round = randomintrange(3,5);
    level.defuse_round = level.round_number + random_round;
    iprintlnbold("Next Defuse Round will be on Round " +level.defuse_round);
}
}

(just to show what it looks like indented)

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
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 27 January 2015
Last active: 10 years ago
Posts
337
Respect
Forum Rank
Perk Hacker
Primary Group
Member
×
liamsa669's Groups
liamsa669's Contact & Social Links
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.
use the spawn_zombie function. an example of this can be found in _zombiemode
Code Snippet
Plaintext
ai = spawn_zombie( spawn_point ); 
if( IsDefined( ai ) )
{
level.zombie_total--;
ai thread round_spawn_failsafe();
count++;
}
where spawn_point is the entity of the spawner

do not forget to apply the necessary variables and or functions to your spawned ai or else it will be able to shoot and kill
Last Edit: September 14, 2015, 10:34:51 pm by liamsa669
broken avatar :(
×
broken avatar :(
The King of Zombies
Location: usLouisiana
Date Registered: 24 June 2013
Last active: 6 years ago
Posts
2,148
Respect
Forum Rank
King of the Zombies
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
×
Dust's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Dust's Contact & Social Linksdust103194MrZ0mbiesFanaticMrZ0mbiesFanatic
Still crashes. Tried it Liams way and even tried commenting out the spawners in the script, still crashes.
broken avatar :(
×
broken avatar :(
Location: fi
Date Registered: 25 June 2013
Last active: 2 years ago
Posts
3,997
Respect
Forum Rank
Eviscerator
Primary Group
UGX V.I.P.
My Groups
More
My Contact & Social Links
More
×
HitmanVere's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
UGX V.I.P.
UGX V.I.P.
Mapper Has released one or more maps to the UGX-Mods community.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
Incorrect KVPs then? Maybe there is a typo somewhere in KVPs, which causes the crash
broken avatar :(
×
broken avatar :(
The King of Zombies
Location: usLouisiana
Date Registered: 24 June 2013
Last active: 6 years ago
Posts
2,148
Respect
Forum Rank
King of the Zombies
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
×
Dust's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Dust's Contact & Social Linksdust103194MrZ0mbiesFanaticMrZ0mbiesFanatic
Incorrect KVPs then? Maybe there is a typo somewhere in KVPs, which causes the crash

Well you were right about a typo. In the script I had bombsite_a_spawner and in radiant I had bombsite_a_spawner(s), but it still crashes.
broken avatar :(
×
broken avatar :(
☭ Soviet Commander ☭
Location: us
Date Registered: 13 August 2012
Last active: 10 years ago
Posts
2,789
Respect
Forum Rank
King of the Zombies
Primary Group
Community Daedra
My Groups
More
My Contact & Social Links
More
×
daedra descent's Groups
Community Daedra
Community Daedra
daedra descent's Contact & Social LinksBlueSoviet
Still crashes. Tried it Liams way and even tried commenting out the spawners in the script, still crashes.

Must be a different part of the script then. Perhaps an infinite while loop somewhere?

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.
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 27 January 2015
Last active: 10 years ago
Posts
337
Respect
Forum Rank
Perk Hacker
Primary Group
Member
×
liamsa669's Groups
liamsa669's Contact & Social Links
it would help if you gave us more information about the crash, for instance the console or something
broken avatar :(
×
broken avatar :(
The King of Zombies
Location: usLouisiana
Date Registered: 24 June 2013
Last active: 6 years ago
Posts
2,148
Respect
Forum Rank
King of the Zombies
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
×
Dust's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Dust's Contact & Social Linksdust103194MrZ0mbiesFanaticMrZ0mbiesFanatic
The only while loop I have is the one from the detect_bombsite() function I sent earlier.

it would help if you gave us more information about the crash, for instance the console or something


Like I said, world at war just stops responding with unhandled exception caught, developer 1 or logfile turns up nothing.
Last Edit: September 14, 2015, 11:06:34 pm by thezombiekilla6
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 27 January 2015
Last active: 10 years ago
Posts
337
Respect
Forum Rank
Perk Hacker
Primary Group
Member
×
liamsa669's Groups
liamsa669's Contact & Social Links
The only while loop I have is the one from the detect_bombsite() function I sent earlier.
 

Like I said, world at war just stops responding with unhandled exception caught, developer 1 or logfile turns up nothing.
sounds like an infinate loop, have u tried putting a wait 1 inbetween the spawns?
broken avatar :(
×
broken avatar :(
The King of Zombies
Location: usLouisiana
Date Registered: 24 June 2013
Last active: 6 years ago
Posts
2,148
Respect
Forum Rank
King of the Zombies
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
×
Dust's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Dust's Contact & Social Linksdust103194MrZ0mbiesFanaticMrZ0mbiesFanatic
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.

 
Loading ...