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

Remove Zombies Being More Attracted to Certain Players in BO1

HOT
broken avatar :(
Created 10 years ago
by jbird
0 Members and 1 Guest are viewing this topic.
9,832 views
broken avatar :(
×
broken avatar :(
Location: usUnited States
Date Registered: 13 May 2014
Last active: 5 days ago
Posts
167
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Member
×
jbird's Groups
I know I've posted this before, but I still haven't figured it out.

How do you remove zombies being more attracted towards certain players in Black Ops 1? I want zombies to be equally attracted to all players.
broken avatar :(
×
broken avatar :(
Senpai
Location: us
Date Registered: 28 September 2013
Last active: 10 months ago
Posts
602
Respect
Forum Rank
Zombie Enslaver
Primary Group
Box Mappers Elite
My Groups
More
My Contact & Social Links
More
×
arceus's Groups
Box Mappers Elite
Box Mappers Elite
arceus's Contact & Social LinksarceusNT
you'd have to look at the fin flesh function your self and see how the decide what player to follow :P then change it to be how you want it to locate players
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 11 March 2014
Last active: 5 years ago
Posts
264
Respect
Forum Rank
Mr. Elemental
Primary Group
Member
Signature
"Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live."
×
buttkicker845's Groups
buttkicker845's Contact & Social Links
after comparing bo1 _zombiemode_spawner script to the waw version it looks like you pretty much just need to comment out/change  these few sections of code from find_flesh in zombiemode_spawner.gsc
comment out this section of code
Code Snippet
Plaintext
               near_zombies = getaiarray("axis");
same_enemy_count = 0;
for (i = 0; i < near_zombies.size; i++)
{
if ( isdefined( near_zombies[i] ) && isalive( near_zombies[i] ) )
{
if ( isdefined( near_zombies[i].favoriteenemy ) && isdefined( self.favoriteenemy )
&& near_zombies[i].favoriteenemy == self.favoriteenemy )
{
if ( distancesquared( near_zombies[i].origin, self.favoriteenemy.origin ) < 225 * 225
&& distancesquared( near_zombies[i].origin, self.origin ) > 525 * 525)
{
same_enemy_count++;
}
}
}
}

if (same_enemy_count > 12)
{
self.ignore_player[self.ignore_player.size] = self.favoriteenemy;
}
and change this section
Code Snippet
Plaintext
if( players.size == 1 )
{
self.ignore_player = [];
}

else
{
for(i = 0; i < self.ignore_player.size; i++)
{
if( IsDefined( self.ignore_player[i] ) && IsDefined( self.ignore_player[i].ignore_counter ) && self.ignore_player[i].ignore_counter > 3 )
{
self.ignore_player[i].ignore_counter = 0;
self.ignore_player = array_remove( self.ignore_player, self.ignore_player[i] );
}
}
}

player = get_closest_valid_player( self.origin, self.ignore_player );
if( !isDefined( player ) && !isDefined( zombie_poi ) )
{
self zombie_history( "find flesh -> can't find player, continue" );
if( IsDefined( self.ignore_player ) )
{
self.ignore_player = [];
}
wait( 1 );
continue;
}



if ( !isDefined( level.check_for_alternate_poi ) || ![[level.check_for_alternate_poi]]() )
{
self.enemyoverride = zombie_poi;
self.favoriteenemy = player;
}
to this
Code Snippet
Plaintext
		// If playing single player, never ignore the player
if( players.size == 1 )
{
self.ignore_player = undefined;
}

player = get_closest_valid_player( self.origin, self.ignore_player );

if( !isDefined( player ) && !isDefined( zombie_poi ) )
{
self zombie_history( "find flesh -> can't find player, continue" );
if( IsDefined( self.ignore_player ) )
{
self.ignore_player = undefined;
self.ignore_player = [];
}

wait( 1 );
continue;
}

self.ignore_player = undefined;

self.enemyoverride = zombie_poi;
self.favoriteenemy = player;
by removing the section that trys to decide which player they should prefer over the other players it should revert to selecting the player based only on the distance from the zombie to the player
i havent tested this, ive just looked at the difference between the different the two scripts and thats the largest differences
Last Edit: March 22, 2016, 11:03:01 pm by buttkicker845
broken avatar :(
×
broken avatar :(
Location: usUnited States
Date Registered: 13 May 2014
Last active: 5 days ago
Posts
167
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Member
My Contact & Social Links
More
×
jbird's Groups
after comparing bo1 _zombiemode_spawner script to the waw version it looks like you pretty much just need to comment out/change  these few sections of code from find_flesh in zombiemode_spawner.gsc
comment out this section of code
Code Snippet
Plaintext
               near_zombies = getaiarray("axis");
same_enemy_count = 0;
for (i = 0; i < near_zombies.size; i++)
{
if ( isdefined( near_zombies[i] ) && isalive( near_zombies[i] ) )
{
if ( isdefined( near_zombies[i].favoriteenemy ) && isdefined( self.favoriteenemy )
&& near_zombies[i].favoriteenemy == self.favoriteenemy )
{
if ( distancesquared( near_zombies[i].origin, self.favoriteenemy.origin ) < 225 * 225
&& distancesquared( near_zombies[i].origin, self.origin ) > 525 * 525)
{
same_enemy_count++;
}
}
}
}

if (same_enemy_count > 12)
{
self.ignore_player[self.ignore_player.size] = self.favoriteenemy;
}
and change this section
Code Snippet
Plaintext
if( players.size == 1 )
{
self.ignore_player = [];
}

else
{
for(i = 0; i < self.ignore_player.size; i++)
{
if( IsDefined( self.ignore_player[i] ) && IsDefined( self.ignore_player[i].ignore_counter ) && self.ignore_player[i].ignore_counter > 3 )
{
self.ignore_player[i].ignore_counter = 0;
self.ignore_player = array_remove( self.ignore_player, self.ignore_player[i] );
}
}
}

player = get_closest_valid_player( self.origin, self.ignore_player );
if( !isDefined( player ) && !isDefined( zombie_poi ) )
{
self zombie_history( "find flesh -> can't find player, continue" );
if( IsDefined( self.ignore_player ) )
{
self.ignore_player = [];
}
wait( 1 );
continue;
}



if ( !isDefined( level.check_for_alternate_poi ) || ![[level.check_for_alternate_poi]]() )
{
self.enemyoverride = zombie_poi;
self.favoriteenemy = player;
}
to this
Code Snippet
Plaintext
		// If playing single player, never ignore the player
if( players.size == 1 )
{
self.ignore_player = undefined;
}

player = get_closest_valid_player( self.origin, self.ignore_player );

if( !isDefined( player ) && !isDefined( zombie_poi ) )
{
self zombie_history( "find flesh -> can't find player, continue" );
if( IsDefined( self.ignore_player ) )
{
self.ignore_player = undefined;
self.ignore_player = [];
}

wait( 1 );
continue;
}

self.ignore_player = undefined;

self.enemyoverride = zombie_poi;
self.favoriteenemy = player;
by removing the section that trys to decide which player they should prefer over the other players it should revert to selecting the player based only on the distance from the zombie to the player
i havent tested this, ive just looked at the difference between the different the two scripts and thats the largest differences

Didn't work. Made the game lag horribly bad every 2-3 seconds in co-op
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 11 March 2014
Last active: 5 years ago
Posts
264
Respect
Forum Rank
Mr. Elemental
Primary Group
Member
×
buttkicker845's Groups
buttkicker845's Contact & Social Links
try changing
Code Snippet
Plaintext
self.ignore_player = undefined;
to
Code Snippet
Plaintext
self.ignore_player = [];
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
If by "equally attracted to all players" you mean they follow whoever's closest, you just need to do a distance check.
broken avatar :(
×
broken avatar :(
Location: gbMilton Keynes
Date Registered: 17 January 2014
Last active: 6 years ago
Posts
6,875
Respect
Forum Rank
Immortal
Primary Group
Scripter
My Groups
More
My Contact & Social Links
More
Signature
If you want scripts / features made for you, then contact me by PM or email / skype etc
it will cost you tho so if you have no intention of reciprocating don't even waste my time ;)
×
Harry Bo21's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Harry Bo21's Contact & Social LinksHarryBo000[email protected]HarryBo21
I looked in the code - it already does this

I think it's another case of misunderstanding. I've never thought one player is "more attractive"

The players are grabbed using get_array_closest
broken avatar :(
×
broken avatar :(
Location: usUnited States
Date Registered: 13 May 2014
Last active: 5 days ago
Posts
167
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Member
My Contact & Social Links
More
×
jbird's Groups
I made a function that makes the zombies never ignore any players for as long as they are live, but it didn't change anything, so I don't think self.ignore_player has anything to do with zombies being more attracted towards certain players
broken avatar :(
×
broken avatar :(
Location: gbMilton Keynes
Date Registered: 17 January 2014
Last active: 6 years ago
Posts
6,875
Respect
Forum Rank
Immortal
Primary Group
Scripter
My Groups
More
My Contact & Social Links
More
×
Harry Bo21's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Harry Bo21's Contact & Social LinksHarryBo000[email protected]HarryBo21
I made a function that makes the zombies never ignore any players for as long as they are live, but it didn't change anything, so I don't think self.ignore_player has anything to do with zombies being more attracted towards certain players
like i just said, your looking for "nothing" anyway

they are not attracted to "player 1" they are attracted to "the closest player"

in the event the distance between 2 players is the same - then itll use the indexes, not "all the time"...

look its in the code you posted from source...


Code Snippet
Plaintext
player = get_closest_valid_player( self.origin, self.ignore_player );
Last Edit: March 24, 2016, 09:57:50 pm by Harry Bo21
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 11 March 2014
Last active: 5 years ago
Posts
264
Respect
Forum Rank
Mr. Elemental
Primary Group
Member
×
buttkicker845's Groups
buttkicker845's Contact & Social Links
like i just said, your looking for "nothing" anyway

they are not attracted to "player 1" they are attracted to "the closest player"

in the event the distance between 2 players is the same - then itll use the indexes, not "all the time"...

look its in the code you posted from source...


Code Snippet
Plaintext
player = get_closest_valid_player( self.origin, self.ignore_player );

yeah but if you look at the differences between black ops and WAW's code in black ops they have a bunch of things that resign
Code Snippet
Plaintext
self.favoriteenemy
while in WAW it just sticks with the closest player as the value. how can it not be "favoriting" a certain player?
broken avatar :(
×
broken avatar :(
Location: gbMilton Keynes
Date Registered: 17 January 2014
Last active: 6 years ago
Posts
6,875
Respect
Forum Rank
Immortal
Primary Group
Scripter
My Groups
More
My Contact & Social Links
More
×
Harry Bo21's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Harry Bo21's Contact & Social LinksHarryBo000[email protected]HarryBo21
Because "favouritenemy" is defined in that loop

And this code is nearly the same as waws  so how can it be something that only happens in bo1 apparently

And... Self.favouriteenemy is used the same and exists in both waw and bo1 actually, I used the existing code earlier today and just looked...
Last Edit: March 25, 2016, 12:55:15 am by Harry Bo21
broken avatar :(
×
broken avatar :(
Location: usUnited States
Date Registered: 13 May 2014
Last active: 5 days ago
Posts
167
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Member
My Contact & Social Links
More
×
jbird's Groups
All I know is that the upmost player on the scoreboard gets favorited over the others (and then the 2nd upmost player is favorited towards the players below him and so on).

Here is the code for get_closest_valid_player():

Code Snippet
Plaintext
get_closest_valid_player( origin, ignore_player )
{
valid_player_found = false;

players = get_players();
if( is_true( level._zombie_using_humangun ) )
{
players = array_merge( players, level._zombie_human_array );
}

if( IsDefined( ignore_player ) )
{

for(i = 0; i < ignore_player.size; i++ )
{
players = array_remove( players, ignore_player[i] );
}

}
while( !valid_player_found )
{

if( is_true(level.calc_closest_player_using_paths) )
{
player = get_closest_player_using_paths( origin, players );
}
else
{
player = GetClosest( origin, players );
}
if( !isdefined( player ) )
{
return undefined;
}

if( is_true( level._zombie_using_humangun ) && IsAI( player ) )
{
return player;
}


if( !is_player_valid( player, true ) )
{
players = array_remove( players, player );
continue;
}
return player;
}
}

get_closest_player_using_paths( origin, players )
{


min_length_to_player = 9999999;
player_to_return = undefined;
for(i = 0; i < players.size; i++ )
{
player = players[i];
length_to_player = get_path_length_to_enemy( player );


if( length_to_player < min_length_to_player )
{
min_length_to_player = length_to_player;
player_to_return = player;
}
}

return player_to_return;
}

get_path_length_to_enemy( enemy )
{




path_length = self CalcPathLength( enemy.origin );

return path_length;
}
Last Edit: March 24, 2016, 11:15:13 pm by jbird
broken avatar :(
×
broken avatar :(
Location: gbMilton Keynes
Date Registered: 17 January 2014
Last active: 6 years ago
Posts
6,875
Respect
Forum Rank
Immortal
Primary Group
Scripter
My Groups
More
My Contact & Social Links
More
×
Harry Bo21's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Harry Bo21's Contact & Social LinksHarryBo000[email protected]HarryBo21
All I know is that the upmost player on the scoreboard gets favorited over the others (and then the 2nd upmost player is favorited towards the players below him and so on).

Here is the code for get_closest_valid_player():

Code Snippet
Plaintext
get_closest_valid_player( origin, ignore_player )
{
valid_player_found = false;

players = get_players();
if( is_true( level._zombie_using_humangun ) )
{
players = array_merge( players, level._zombie_human_array );
}

if( IsDefined( ignore_player ) )
{

for(i = 0; i < ignore_player.size; i++ )
{
players = array_remove( players, ignore_player[i] );
}

}
while( !valid_player_found )
{

if( is_true(level.calc_closest_player_using_paths) )
{
player = get_closest_player_using_paths( origin, players );
}
else
{
player = GetClosest( origin, players );
}
if( !isdefined( player ) )
{
return undefined;
}

if( is_true( level._zombie_using_humangun ) && IsAI( player ) )
{
return player;
}


if( !is_player_valid( player, true ) )
{
players = array_remove( players, player );
continue;
}
return player;
}
}

get_closest_player_using_paths( origin, players )
{


min_length_to_player = 9999999;
player_to_return = undefined;
for(i = 0; i < players.size; i++ )
{
player = players[i];
length_to_player = get_path_length_to_enemy( player );


if( length_to_player < min_length_to_player )
{
min_length_to_player = length_to_player;
player_to_return = player;
}
}

return player_to_return;
}

get_path_length_to_enemy( enemy )
{




path_length = self CalcPathLength( enemy.origin );

return path_length;
}
no it doesn't, the code you just showed "proves" that

The code you were looking at before was specifically for solo hence if ( players.size == 1 )

It's grabbing "the closest player" as you can see if you look at the code you posted yourself

Only defaults on to player 1 if it cannot path to any other player
broken avatar :(
×
broken avatar :(
Location: usUnited States
Date Registered: 13 May 2014
Last active: 5 days ago
Posts
167
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Member
My Contact & Social Links
More
×
jbird's Groups
There is only one line of code under if(players.size == 1)

Code Snippet
Plaintext
if( players.size == 1 )
{
self.ignore_player = [];
}
broken avatar :(
×
broken avatar :(
Location: gbMilton Keynes
Date Registered: 17 January 2014
Last active: 6 years ago
Posts
6,875
Respect
Forum Rank
Immortal
Primary Group
Scripter
My Groups
More
My Contact & Social Links
More
×
Harry Bo21's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Harry Bo21's Contact & Social LinksHarryBo000[email protected]HarryBo21
There is only one line of code under if(players.size == 1)

Code Snippet
Plaintext
if( players.size == 1 )
{
self.ignore_player = [];
}
and that was what someone told you to change In a comment ( don't coz it's irrelevent )

The point is still there. Read the code "you" just posted. It gets the closest player - determined by how long the path is to each player - it is "not" weighted and I'm yet to experience this issue "in game"

Think your mistaken due to misinfo - I've seen people say this but I assure you it - is - wrong

 
Loading ...