Modme Forums
Menu:

Boss Fight

Game Modding | Call of Duty: Black Ops 3 | Scripting


ModsOnPoint:

Okay so I've been learning scripting and I'm still not that great.
I've been working on my first map for 6 months and I want to release it by next month, but I need an Easter Egg.

I want to interact with 4 skulls and they do four of the same things basically.

step 1
Interact with a light (an actual light)
Then interact with a skull model.
After interacting with both, You have to fill the skull up with souls.

step 2
Interact with a second light
Then interact with a second skull model.
Fill it with souls.

Step 3
Interact with a third light
Then interact with a third skull model.
fill it with souls

Step 4
Interact with a 4th light
Then interact with a 4th skull model.
After interacting with both, You have to fill it up with souls as well.

After The souls are collected then comes the boss fight.

Also I would like the boss to be a certain number of witches/buried ghosts by spiki.

The question is...Is this even possible, and if so how in the world do i script it?


Spiki:

By interact im guessing you mean press F

Im guessing you know about triggers so you'd just need to place them near the lights and models.
To make the trigs in order just put one waittill after another.
To make functions/steps go in order just start a new function when one is done like the trigs.

Example:

function step1()
{
trig1 = GetEnt("step1_light","targetname");
trig1 waittill("trigger", player);


trig2 = GetEnt("step1_skull","targetname");
trig2 waittill("trigger", player);

step2();
}


To make a soul box you need a zombie death callback

zm_spawner::register_zombie_death_event_callback(&zombie_death_check);

and check if the zombie was close enough to the box

function zombie_death_check() //self = zombie
{
soul_tubes = GetEntArray("soul_tubes","targetname");
tube = ArrayGetClosest(self.origin,soul_tubes);

if(Distance(self.origin,tube.origin)<SOUL_TUBE_DISTANCE)
    {
    tube notify("soul_tube_collect", self);
    }
}


ModsOnPoint:

By interact im guessing you mean press F

Im guessing you know about triggers so you'd just need to place them near the lights and models.
To make the trigs in order just put one waittill after another.
To make functions/steps go in order just start a new function when one is done like the trigs.

Example:

function step1()
{
trig1 = GetEnt("step1_light","targetname");
trig1 waittill("trigger", player);


trig2 = GetEnt("step1_skull","targetname");
trig2 waittill("trigger", player);

step2();
}


To make a soul box you need a zombie death callback

zm_spawner::register_zombie_death_event_callback(&zombie_death_check);

and check if the zombie was close enough to the box

function zombie_death_check() //self = zombie
{
soul_tubes = GetEntArray("soul_tubes","targetname");
tube = ArrayGetClosest(self.origin,soul_tubes);

if(Distance(self.origin,tube.origin)<SOUL_TUBE_DISTANCE)
    {
    tube notify("soul_tube_collect", self);
    }
}

Thank You so much


ModsOnPoint:

Okay I'm finishing up my map...I got the fill souls working. Thanks You so much spiki!! Now all I have left is the boss fight. I was wondering if anybody could help me understand how to initiate a boss fight which spawns a certain amount of spiki's buried witches...with fire surrounding the area where the boss fight will take place.


Magicman:

Okay I'm finishing up my map...I got the fill souls working. Thanks You so much spiki!! Now all I have left is the boss fight. I was wondering if anybody could help me understand how to initiate a boss fight which spawns a certain amount of spiki's buried witches...with fire surrounding the area where the boss fight will take place.


do you want the buried witches to be the boss fight, or do you want it to be a component of one? Like how on DE the skulls are a component of the bossfight but the giant keeper is the main boss


ModsOnPoint:

do you want the buried witches to be the boss fight, or do you want it to be a component of one? Like how on DE the skulls are a component of the bossfight but the giant keeper is the main boss

Yes I want the buried witches to be a component of a boss fight.


ModsOnPoint:

How do I stop an infinite spawn at a certain point within the script?


Pepergogo:

You can use this to clear all the remaining zombies:

//Clear zombies
    zombies = zombie_utility::get_round_enemy_array();
        if ( isdefined( zombies ) )
        {
            array::run_all( zombies, &Kill );
        }


Use this to stop the zombie spawn:
//Stop Spawning
    level flag::clear( "spawn_zombies" );


And use this to enable the spawn again:
level flag::set( "spawn_zombies" ); //Start zombie spawn


ModsOnPoint:

You can use this to clear all the remaining zombies:
//Clear zombies
    zombies = zombie_utility::get_round_enemy_array();
        if ( isdefined( zombies ) )
        {
            array::run_all( zombies, &Kill );
        }


Use this to stop the zombie spawn:
//Stop Spawning
    level flag::clear( "spawn_zombies" );


And use this to enable the spawn again:
level flag::set( "spawn_zombies" ); //Start zombie spawn


Thank You so much


ModsOnPoint:

Okay so I'm spawning witches inside my boss battle. Within my boss battle function I'm using
while(1)
{
zm_buried_ghost::spawn_witch(100);
wait (2);
}
to spawn the buried ghost. My question now is...how do I end the infinite spawn to continue on to the next function?


ModsOnPoint:

Nevermind after a lot of research, trial and error, and learning more on scripting I got it working.
The Fix: I removed
while(1)
{
zm_buried_ghost::spawn_witch(100);
wait (2);
}

and replaced it with

for( i=0; i,10;i++ );
{
zm_buried_ghost::spawn_witch(100);
wait(2);
}

Hope this helps any new map makers having trouble.


ModsOnPoint:

I need help fellas...I want to teleport all players to a certain spot when one player activates a trigger. How would I do this?


Magicman:

I need help fellas...I want to teleport all players to a certain spot when one player activates a trigger. How would I do this?


#using scripts\shared\lui_shared;

function pistol_def_tp()
{
spots = struct::get_array("pistol_def_tp_spot", "targetname");

while(1)
{
level waittill("end_of_round");

foreach(player in GetPlayers())
{
player thread lui::screen_fade_out(1);
}


level waittill( "start_of_round" );


foreach(player in GetPlayers())
{
loc = array::random(spots);
player SetOrigin(loc.origin + (0,0,20));
player SetPlayerAngles(loc.angles);
player thread zm::screen_fade_in(2);
}

}


}

this is code put together by spiki. It isn't exactly what you want, but if you read and understand that code, it's a good starting point for you


Harry Bo21:

You realise step 1 2 3 and 4 are really just 1 step right


ModsOnPoint:

#using scripts\shared\lui_shared;

function pistol_def_tp()
{
spots = struct::get_array("pistol_def_tp_spot", "targetname");

while(1)
{
level waittill("end_of_round");

foreach(player in GetPlayers())
{
player thread lui::screen_fade_out(1);
}


level waittill( "start_of_round" );


foreach(player in GetPlayers())
{
loc = array::random(spots);
player SetOrigin(loc.origin + (0,0,20));
player SetPlayerAngles(loc.angles);
player thread zm::screen_fade_in(2);
}

}


}

this is code put together by spiki. It isn't exactly what you want, but if you read and understand that code, it's a good starting point for you

Thank You. Much appreciated


ModsOnPoint:

You realise step 1 2 3 and 4 are really just 1 step right

Yeah I found that out as I was learning to script it.