UGX-Mods

Call of Duty: Black Ops 1 => Help Desk => Scripting => Topic started by: jiggy22 on February 03, 2018, 06:59:41 am

Title: Adding the Engineer Zombie
Post by: jiggy22 on February 03, 2018, 06:59:41 am
Hey everyone! So as part of my BO mod, I'm hoping to add the Engineer Zombie boss to Kino Der Toten, as what was at one point considered for the map. However, I'm running into trouble with getting him to actually spawn in on the level. Let me try to run down everything I've done so far:

- Add this line:
Code Snippet
Plaintext
	level.custom_ai_type = array_add( level.custom_ai_type, maps\_zombiemode_ai_boss::init );
Under:
Code Snippet
Plaintext
	level.custom_ai_type = [];

- Call this thread, zombeng_spawn_points, at the bottom of zombie_theater.gsc:
Code Snippet
Plaintext
zombeng_spawn_points()
{
org = spawn("script_origin", (-258.693, 695.059, -56.8574));
org.targetname = "boss_zombie_spawner";

org = spawn("script_origin", (-1507.99, 583.312, 0.307038));
org.targetname = "boss_zombie_spawner";

org = spawn("script_origin", (-1446.81, -184.471, 1.34885));
org.targetname = "boss_zombie_spawner";

org = spawn("script_origin", (-166.122, 1847.94, -14.0593));
org.targetname = "boss_zombie_spawner";
}

I got the "boss_zombie_spawner" targetname from the ai_boss.gsc script, which has two lines of code that read:
Code Snippet
Plaintext
	level.boss_zombie_spawners = GetEntArray( "boss_zombie_spawner", "targetname" );
array_thread( level.boss_zombie_spawners, ::add_spawn_function, maps\_zombiemode_ai_boss::boss_prespawn );

I'm kinda new with setting up spawn points via gsc files, so I might have done this part wrong. Surely I can just put all of the spawn points together in one function like this?

Code Snippet
Plaintext
zombeng_spawn_points()
{
org = spawn("script_origin", (-258.693, 695.059, -56.8574));
org = spawn("script_origin", (-1507.99, 583.312, 0.307038));
org = spawn("script_origin", (-1446.81, -184.471, 1.34885));
org = spawn("script_origin", (-166.122, 1847.94, -14.0593));
org.targetname = "boss_zombie_spawner";
}

- In zombie_theater.gsc, I've added this line:
Code Snippet
Plaintext
	level.boss_zombie_enter_level = 3;
Under this:
Code Snippet
Plaintext
	maps\_zombiemode_ai_dogs::enable_dog_rounds();

I got this from another line of code from the ai_boss.gsc, which reads:
Code Snippet
Plaintext
	if ( !isDefined( level.boss_zombie_enter_level ) )
{
level.boss_zombie_enter_level = maps\_zombiemode_ai_boss::boss_zombie_default_enter_level;
}

The boss_zombie_default_enter_level thread appears as follows:
Code Snippet
Plaintext
boss_zombie_default_enter_level()
{
Playfx( level._effect["boss_spawn"], self.origin );
playsoundatposition( "zmb_bolt", self.origin );
PlayRumbleOnPosition("explosion_generic", self.origin);
self.entered_level = true;
}

I'm probably wrong here, but I was assuming that I could simply designate a round to this function as seen above, where I'm trying to get the boss to spawn on round three.

- Before, I also tried adding this:
Code Snippet
Plaintext
	level.boss_zombie_spawn_heuristic = true;

Directly under the level.boss_zombie_enter round = 3 line in zombie_theater.gsc, but what that did was cause the spawn music to continuously play over and over again during the match. So I'm guessing that was totally wrong  ::)

Aside from that, I've got all the sounds, animations, models, and character files set up just fine. Any help would be greatly appreciated, thank you!!
Title: Re: Adding the Engineer Zombie
Post by: KhelMho on February 04, 2018, 03:23:41 am
oof
Title: Re: Adding the Engineer Zombie
Post by: jiggy22 on February 04, 2018, 05:52:12 pm
Anybody out there?
Title: Re: Adding the Engineer Zombie
Post by: jiggy22 on February 07, 2018, 08:15:05 pm
Guess I'll just bump this again  :P
Title: Re: Adding the Engineer Zombie
Post by: zombiedestroy29 on April 29, 2018, 04:38:27 am
I've tried to do this too on a custom map of mine that I made with radiant, same thing happens. everything loads in fine, but the engineer never actually spawns.
Title: Re: Adding the Engineer Zombie
Post by: gympie6 on April 29, 2018, 10:10:20 am
Hey everyone! So as part of my BO mod, I'm hoping to add the Engineer Zombie boss to Kino Der Toten, as what was at one point considered for the map. However, I'm running into trouble with getting him to actually spawn in on the level. Let me try to run down everything I've done so far:

- Add this line:
Code Snippet
Plaintext
	level.custom_ai_type = array_add( level.custom_ai_type, maps\_zombiemode_ai_boss::init );
Under:
Code Snippet
Plaintext
	level.custom_ai_type = [];

- Call this thread, zombeng_spawn_points, at the bottom of zombie_theater.gsc:
Code Snippet
Plaintext
zombeng_spawn_points()
{
org = spawn("script_origin", (-258.693, 695.059, -56.8574));
org.targetname = "boss_zombie_spawner";

org = spawn("script_origin", (-1507.99, 583.312, 0.307038));
org.targetname = "boss_zombie_spawner";

org = spawn("script_origin", (-1446.81, -184.471, 1.34885));
org.targetname = "boss_zombie_spawner";

org = spawn("script_origin", (-166.122, 1847.94, -14.0593));
org.targetname = "boss_zombie_spawner";
}

I got the "boss_zombie_spawner" targetname from the ai_boss.gsc script, which has two lines of code that read:
Code Snippet
Plaintext
	level.boss_zombie_spawners = GetEntArray( "boss_zombie_spawner", "targetname" );
array_thread( level.boss_zombie_spawners, ::add_spawn_function, maps\_zombiemode_ai_boss::boss_prespawn );

I'm kinda new with setting up spawn points via gsc files, so I might have done this part wrong. Surely I can just put all of the spawn points together in one function like this?

Code Snippet
Plaintext
zombeng_spawn_points()
{
org = spawn("script_origin", (-258.693, 695.059, -56.8574));
org = spawn("script_origin", (-1507.99, 583.312, 0.307038));
org = spawn("script_origin", (-1446.81, -184.471, 1.34885));
org = spawn("script_origin", (-166.122, 1847.94, -14.0593));
org.targetname = "boss_zombie_spawner";
}

- In zombie_theater.gsc, I've added this line:
Code Snippet
Plaintext
	level.boss_zombie_enter_level = 3;
Under this:
Code Snippet
Plaintext
	maps\_zombiemode_ai_dogs::enable_dog_rounds();

I got this from another line of code from the ai_boss.gsc, which reads:
Code Snippet
Plaintext
	if ( !isDefined( level.boss_zombie_enter_level ) )
{
level.boss_zombie_enter_level = maps\_zombiemode_ai_boss::boss_zombie_default_enter_level;
}

The boss_zombie_default_enter_level thread appears as follows:
Code Snippet
Plaintext
boss_zombie_default_enter_level()
{
Playfx( level._effect["boss_spawn"], self.origin );
playsoundatposition( "zmb_bolt", self.origin );
PlayRumbleOnPosition("explosion_generic", self.origin);
self.entered_level = true;
}

I'm probably wrong here, but I was assuming that I could simply designate a round to this function as seen above, where I'm trying to get the boss to spawn on round three.

- Before, I also tried adding this:
Code Snippet
Plaintext
	level.boss_zombie_spawn_heuristic = true;

Directly under the level.boss_zombie_enter round = 3 line in zombie_theater.gsc, but what that did was cause the spawn music to continuously play over and over again during the match. So I'm guessing that was totally wrong  ::)

Aside from that, I've got all the sounds, animations, models, and character files set up just fine. Any help would be greatly appreciated, thank you!!

I never modded for bo1 before but there is a thing that's wrong,
You want to link a variable to a method which is not returning anything.

I am talking about this var boss_zombie_default_enter_level.
I think you want to return this: return self.entered_level = true;

Next advice I give you is debugging the engineer zombie and look for problems.
Is he spawning? Where? Does he spawn? Yes or no? Does he enter that method? Cool
But why don't I see him yet, that kind of things.
Title: Re: Adding the Engineer Zombie
Post by: zombiedestroy29 on May 01, 2018, 01:24:43 am
make the script_noteworthy of one your spawns (the one that you want the engineer to spawn at first) this
first_boss_spawner

example:
Code Snippet
Plaintext
first_spawn_org = spawn("script_origin", (x,y,z)); 
first_spawn_org.targetname = "boss_zombie_spawner";
first_spawn_org.script_noteworthy = "first_boss_spawner";

also make the model and classname identicle to the engineer's

Code Snippet
Plaintext
org.targetname = "boss_zombie_spawner";
org.model = "char_ger_zombeng_body1_1";
org.classname = "actor_zombie_engineer";

next, set the spawnflags and count acoordingly (9999 for count is reccommended)

Code Snippet
Plaintext
org.count = "9999";
org.spawnflags = "53";

also I reccomend naming each spawn a different name
so instead of
Code Snippet
Plaintext
zombeng_spawn_points()
{
org = spawn("script_origin", (-258.693, 695.059, -56.8574));
org.targetname = "boss_zombie_spawner";

org = spawn("script_origin", (-1507.99, 583.312, 0.307038));
org.targetname = "boss_zombie_spawner";

org = spawn("script_origin", (-1446.81, -184.471, 1.34885));
org.targetname = "boss_zombie_spawner";

org = spawn("script_origin", (-166.122, 1847.94, -14.0593));
org.targetname = "boss_zombie_spawner";
}

it'd be

Code Snippet
Plaintext
zombeng_spawn_points()
{
org1 = spawn("script_origin", (-258.693, 695.059, -56.8574));
org1.targetname = "boss_zombie_spawner";

org2 = spawn("script_origin", (-1507.99, 583.312, 0.307038));
org2.targetname = "boss_zombie_spawner";

org3 = spawn("script_origin", (-1446.81, -184.471, 1.34885));
org3.targetname = "boss_zombie_spawner";

org4= spawn("script_origin", (-166.122, 1847.94, -14.0593));
org4.targetname = "boss_zombie_spawner";
}

finally, make sure that the engineer xanims are loaded or else he'll just do the idle animation