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

[BO1] Help Removing Player Priority

broken avatar :(
Created 10 years ago
by jbird
0 Members and 1 Guest are viewing this topic.
3,151 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
In BO1, zombies are more attracted towards white player. I was wondering if there was a way to remove this. I've tried and so far haven't found out how. Here is the _zombiemode_spawner script. I think it has something to do with self.favoriteenemy or self.ignore_player

http://pastebin.com/Q92wmwdr

Here is find_flesh(), the function that I believe causes this to happen.

Code Snippet
Plaintext
find_flesh()
{
self endon( "death" );
level endon( "intermission" );
self endon( "stop_find_flesh" );
if( level.intermission )
{
return;
}

self.helitarget = true;
self.ignoreme = false;
self.noDodgeMove = true;


self.ignore_player = [];
self zombie_history( "find flesh -> start" );
self.goalradius = 32;
while( 1 )
{



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;
}



if (isDefined(level.zombieTheaterTeleporterSeekLogicFunc) )
{
        self [[ level.zombieTheaterTeleporterSeekLogicFunc ]]();
        }
       
zombie_poi = self get_zombie_point_of_interest( self.origin );

players = get_players();


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;
}

self thread zombie_pathing();


if( players.size > 1 )
{
for(i = 0; i < self.ignore_player.size; i++)
{
if( IsDefined( self.ignore_player[i] ) )
{
if( !IsDefined( self.ignore_player[i].ignore_counter ) )
self.ignore_player[i].ignore_counter = 0;
else
self.ignore_player[i].ignore_counter += 1;
}
}
}

self thread attractors_generated_listener();
self.zombie_path_timer = GetTime() + ( RandomFloatRange( 1, 3 ) * 1000 );
while( GetTime() < self.zombie_path_timer )
{
wait( 0.1 );
}
self notify( "path_timer_done" );
self zombie_history( "find flesh -> bottom of loop" );
debug_print( "Zombie is re-acquiring enemy, ending breadcrumb search" );
self notify( "zombie_acquire_enemy" );
}
}
Last Edit: December 24, 2015, 04:03:59 am by jbird
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 1 January 2014
Last active: 5 years ago
Posts
397
Respect
Forum Rank
Perk Hacker
Primary Group
Member
My Contact & Social Links
More
Signature
×
vinnyz500's Groups
vinnyz500's Contact & Social LinksXxMrPotatoxXpsn_hackedlobbies4uvinnyz500
i think it is networking related, as the white player is always the host if i am not mistaken
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 30 December 2012
Last active: 2 years ago
Posts
577
Respect
Forum Rank
Zombie Enslaver
Primary Group
Scripter
My Groups
More
My Contact & Social Links
More
Signature
My preferred name is "xSanchez78".
Check me out here: www.steamcommunity.com/id/xSanchez78
×
alaurenc9'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.
alaurenc9's Contact & Social LinksxSanchez78xSanchez78xSanchez78xSanchez78xSanchez78xSanchez78
i feel like this is because in every check in an array of players, player 0 ( white ) is always first. if there are checks that just go through who ever passes first, white player will always be checked first so he might always pass first. idk just a thought
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 think it is networking related, as the white player is always the host if i am not mistaken

White player is only always host on PC. On consoles, white player may not be host sometimes and it is still the white player the zombies are most attracted to.

Double Post Merge: December 24, 2015, 04:36:21 am
i feel like this is because in every check in an array of players, player 0 ( white ) is always first. if there are checks that just go through who ever passes first, white player will always be checked first so he might always pass first. idk just a thought

Is there a way I could get the zombies to truly go after which player is closest to them?
Last Edit: December 24, 2015, 04:36:21 am 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
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 think it is networking related, as the white player is always the host if i am not mistaken
at a guess, its not the "white" player, its the "first player in the array"

so rearrange the array

Code Snippet
Plaintext
players = get_players();
players = array_randomize( players );

will randomize the order

and it already uses - the closest player



also, for good coding practice ( not really needed here but anyway )

Code Snippet
Plaintext
players = get_players();

if ( !isDefined( players ) || players.size < 1 )
    return;

players = array_randomize( players );

in this case tho, you would have to decide for yourself if or not to "return"
Last Edit: December 24, 2015, 02:43:13 pm by Harry Bo21
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
The reason is simple... its the for statements. It does player 0 first, then 1 then 2 etc.
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 30 December 2012
Last active: 2 years ago
Posts
577
Respect
Forum Rank
Zombie Enslaver
Primary Group
Scripter
My Groups
More
My Contact & Social Links
More
×
alaurenc9'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.
alaurenc9's Contact & Social LinksxSanchez78xSanchez78xSanchez78xSanchez78xSanchez78xSanchez78
The reason is simple... its the for statements. It does player 0 first, then 1 then 2 etc.

I said this already 3 comments above yours
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
I said this already 3 comments above yours
that moment when someone assumes u read more than the 1st comment

 
Loading ...