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

Add Friendly AI in BO1 Zombies?

broken avatar :(
Created 11 years ago
by jbird
0 Members and 1 Guest are viewing this topic.
10,464 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'm wondering how friendly bots could be made for zombies. I have heard it is possible in WaW, so I am assuming it is also possible in BO1.
Last Edit: December 06, 2015, 07:00:01 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
just adding a ai and setting his "team" to the players team would do it i believe

i think its "allied" or "allies" or something vs "axis"

in waw for example, merely need to place a "ally" actor ( they would not attack you, would attack enemies, but beyond that behavior youd need to do some work )
Last Edit: December 06, 2015, 08:56:02 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
just adding a ai and setting his "team" to the players team would do it i believe

i think its "allied" or "allies" or something vs "axis"

in waw for example, merely need to place a "ally" actor ( they would not attack you, would attack enemies, but beyond that behavior youd need to do some work )

I've never added any AI before, what exactly do I have to do to get them to spawn in? I can do the extra work.
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've never added any AI before, what exactly do I have to do to get them to spawn in? I can do the extra work.
hmm... i guess that might be harder on bo1

i wonder if maybe this could work

grab a zombie spawner

spawn something from it

set gibbed to true to stop them being "gibable"

change their model

( would need to make sure find_flesh is disabled, id need to check scripts for that tho, dont know off hand )

change his team

move him



I would hope thats all required





You could also try this to resolve what i put earlier


set a variable on the spawner like "spawner.is_ally = true"

and in the zombie_init() part in zombiemode_spawner.gsc, have it check for that variable, if it is defined and is true, then skip loading the zombie logic entirely ( could set the team, model and move him here too actually )







Otherwise maybe you can create a spawner point in script? Mot sure how you would tho
Last Edit: December 06, 2015, 09:11:43 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
How about this?

Code Snippet
Plaintext
init()
{
flag_wait( "all_players_connected" );
while(1)

bots = 4 - get_players().size
for(i=0;i<bots;i++)
{
if(!IsDefined player_ai[i].dead || player_ai[i].dead == true)
{
j = 3 - i
structs = getstructarray( "initial_spawn_points", "targetname" );
player_ai[i] = structs[j] StalingradSpawn();
player_ai[i].team = "allies";
player_ai[i] setmodel("c_usa_marine_michael_carter_player_zm")
player_ai[i].gibbed = true;
player_ai[i].head_gibbed = true;
player_ai[i].dead = false;
}
}
for(i=0;i<bots;i++)
{
player_ai[i] waittill("death");
player_ai[i].dead = true;
}
while( get_enemy_count() > 0 || level.zombie_total > 0 )
{
wait( 1.0 );
}
}
}
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
How about this?

Code Snippet
Plaintext
init()
{
flag_wait( "all_players_connected" );
while(1)

bots = 4 - get_players().size
for(i=0;i<bots;i++)
{
if(!IsDefined player_ai[i].dead || player_ai[i].dead == true)
{
j = 3 - i
structs = getstructarray( "initial_spawn_points", "targetname" );
player_ai[i] = structs[j] StalingradSpawn();
player_ai[i].team = "allies";
player_ai[i] setmodel("c_usa_marine_michael_carter_player_zm")
player_ai[i].gibbed = true;
player_ai[i].head_gibbed = true;
player_ai[i].dead = false;
}
}
for(i=0;i<bots;i++)
{
player_ai[i] waittill("death");
player_ai[i].dead = true;
}
while( get_enemy_count() > 0 || level.zombie_total > 0 )
{
wait( 1.0 );
}
}
}

Calling stalingradSpawn() using structs won't do anything.

AFAIK, there are only two ways you *might* be able to spawn the AI via script that i know of: fake AI or use an existing spawner, change its team, model, guns, etc and move him to wherever you want him.

Edit: the ai that the spawner spawns, not the spawner itself.



Last Edit: December 07, 2015, 01:41:08 am by daedra descent
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
Okay well should this work?

Code Snippet
Plaintext
init()
{
flag_wait( "all_players_connected" );
while(1)

bots = 4 - get_players().size
for(i=0;i<bots;i++)
{
if(!IsDefined player_ai[i].dead || player_ai[i].dead == true)
{
spawner = GetEntArray( "zombie_spawner", "script_noteworthy" )[0];
j = 3 - i;
structs = getstructarray( "initial_spawn_points", "targetname" )[j];
player_ai[i] = spawner StalingradSpawn();
player_ai.script_noteworthy = "player_ai";
player_ai[i].team = "allies";
player_ai[i] setmodel("c_usa_marine_michael_carter_player_zm")
player_ai forceteleport(structs);
player_ai[i].gibbed = true;
player_ai[i].head_gibbed = true;
player_ai[i].dead = false;
}
}
for(i=0;i<bots;i++)
{
player_ai[i] waittill("death");
player_ai[i].dead = true;
}
while( get_enemy_count() > 0 || level.zombie_total > 0 )
{
wait( 1.0 );
}
}
}
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
Missing semicolon:
Code Snippet
Plaintext
player_ai[i] setmodel("c_usa_marine_michael_carter_player_zm")
And why are you putting in [j] and [ 0 ]?
Code Snippet
Plaintext
spawner = GetEntArray( "zombie_spawner", "script_noteworthy" )[0];
structs = getstructarray( "initial_spawn_points", "targetname" )[j];
Something BO1 has? Never seen anyone do getEnt and getStruct like that :P
Last Edit: December 07, 2015, 10:44:44 am by HitmanVere
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
Missing semicolon:
Code Snippet
Plaintext
player_ai[i] setmodel("c_usa_marine_michael_carter_player_zm")
And why are you putting in [j] and [ 0 ]?
Code Snippet
Plaintext
spawner = GetEntArray( "zombie_spawner", "script_noteworthy" )[0];
structs = getstructarray( "initial_spawn_points", "targetname" )[j];
Something BO1 has? Never seen anyone do getEnt and getStruct like that :P
yea it's fine, he's just referencing a element in a array in the same line as collecting the array is all
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
youre also missing a semi colon here
Code Snippet
Plaintext
bots = 4 - get_players().size

also unless you already have the array player_ai initialized (which from your posted code doesnt look like it) you should add
Code Snippet
Plaintext
player_ai = []; //creates a new array
under your
Code Snippet
Plaintext
flag_wait( "all_players_connected" );
this will help avoid running into a uninitialized variable error

and instead of doing stalingradSpawn you can also use the method
Code Snippet
Plaintext
spawn_zombie(spawner,target_name); // take a spawner entity, and a possible targetname as parameters
which runs a check to ensure that the AI is spawned correctly

 
Loading ...