Modme Forums

Despawn all zombies in a zone if there are no players in it

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


ModmeBot:

Thread By: mathfag

For example when you take the plane in mob of the dead, all of the zombies in the prison despawn and respawn on the bridge.

I don't even know how to start scripting this.


ModmeBot:

Reply By: CT8918

mathfag

For example when you take the plane in mob of the dead, all of the zombies in the prison despawn and respawn on the bridge.

I don't even know how to start scripting this.

I believe the game does this automatically. If there is no path from the zombie to you, they will die and respawn in a zone that can get to you.


ModmeBot:

Reply By: soul-toktzt

CT8918
mathfag

For example when you take the plane in mob of the dead, all of the zombies in the prison despawn and respawn on the bridge.

I don't even know how to start scripting this.

I believe the game does this automatically. If there is no path from the zombie to you, they will die and respawn in a zone that can get to you.

So let's say i have room, with a trapdoor and you have to fall down, in that room below are zombie spawns (different zone).

They'd just die and spawn there?

Or a teleport somewhere, to an obstacle course where no zombie spawns are and past that course is a room (with a different zone) with spawns... they'd just spawn there and not in an earlier zone?


ModmeBot:

Reply By: CT8918

soul-toktzt
CT8918
mathfag

For example when you take the plane in mob of the dead, all of the zombies in the prison despawn and respawn on the bridge.

I don't even know how to start scripting this.

I believe the game does this automatically. If there is no path from the zombie to you, they will die and respawn in a zone that can get to you.

So let's say i have room, with a trapdoor and you have to fall down, in that room below are zombie spawns (different zone).

They'd just die and spawn there?

Or a teleport somewhere, to an obstacle course where no zombie spawns are and past that course is a room (with a different zone) with spawns... they'd just spawn there and not in an earlier zone?

They should eventually, but there would be a slight delay. You could write a script that kills all the zombies immediately which would cause them to respawn instantly in that zone. I currently have a gdtdb error which I am trying to resolve, so I am unable to write this myself at the moment.


ModmeBot:

Reply By: soul-toktzt

CT8918
soul-toktzt
CT8918
mathfag

For example when you take the plane in mob of the dead, all of the zombies in the prison despawn and respawn on the bridge.

I don't even know how to start scripting this.

I believe the game does this automatically. If there is no path from the zombie to you, they will die and respawn in a zone that can get to you.

So let's say i have room, with a trapdoor and you have to fall down, in that room below are zombie spawns (different zone).

They'd just die and spawn there?

Or a teleport somewhere, to an obstacle course where no zombie spawns are and past that course is a room (with a different zone) with spawns... they'd just spawn there and not in an earlier zone?

They should eventually, but there would be a slight delay. You could write a script that kills all the zombies immediately which would cause them to respawn instantly in that zone. I currently have a gdtdb error which I am trying to resolve, so I am unable to write this myself at the moment.

Well an easy, quick and cheap way to make that would be a nuke that would spawn when you go somewhere which is seperated from the other rooms.


ModmeBot:

Reply By: CT8918

Here is a script that should kill all zombies. I can't test it at the moment but you could set up a multiple trigger that once touched, would run this code. The one thing is, what if the game wasn't a solo game and one player goes to the area? Would have to have something implemented to make sure all players were in the area. This below would work well, as is, if you plan on all players being in the same area at all times.

Make sure to include:

#using scripts\shared\ai\zombie_utility;



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


ModmeBot:

Reply By: soul-toktzt

CT8918

Here is a script that should kill all zombies. I can't test it at the moment but you could set up a multiple trigger that once touched, would run this code. The one thing is, what if the game wasn't a solo game and one player goes to the area? Would have to have something implemented to make sure all players were in the area. This below would work well, as is, if you plan on all players being in the same area at all times.

Make sure to include:

#using scripts\shared\ai\zombie_utility;



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

If there are multiple players and 1 goes to the area... wouldn't the zombies automatically go towards the other players? That's what i think tho.


ModmeBot:

Reply By: mathfag

CT8918

Here is a script that should kill all zombies. I can't test it at the moment but you could set up a multiple trigger that once touched, would run this code. The one thing is, what if the game wasn't a solo game and one player goes to the area? Would have to have something implemented to make sure all players were in the area. This below would work well, as is, if you plan on all players being in the same area at all times.

Make sure to include:

#using scripts\shared\ai\zombie_utility;



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

This works, but how do I kill off zombies that are in one zone or are touching a trigger.

I will figure out a script which will execute this one when all players are touching a trigger


ModmeBot:

Reply By: soul-toktzt

mathfag
CT8918

Here is a script that should kill all zombies. I can't test it at the moment but you could set up a multiple trigger that once touched, would run this code. The one thing is, what if the game wasn't a solo game and one player goes to the area? Would have to have something implemented to make sure all players were in the area. This below would work well, as is, if you plan on all players being in the same area at all times.

Make sure to include:

#using scripts\shared\ai\zombie_utility;



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

This works, but how do I kill off zombies that are in one zone or are touching a trigger.

I will figure out a script which will execute this one when all players are touching a trigger

I wish i knew more of scripting lol

But what about something like...

if zombie touches trigger, it dies?

I don't know how to write in code that.....

One sec, i'm going to edit this in a bit, i might try something.

Edit: tried something out, but it didn't work lol, i probably did something stupid xD

http://pastebin.com/S7HZPN4p