
Posts
4
Respect
Forum Rank
Fresh Corpse
Primary Group
Member
Login Issues
Forgot password?Activate Issues
Account activation email not received? Wrong account activation email used?Other Problems?
Contact Support - Help Center Get help on the UGX Discord. Join it now!![]() | Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum. |
i remember doing this for someone a few months ago. what do u want to happen to the zombies that get stuck on the other side after door closes? Theres a few options, make an alternative root for the zombies to go around or , waittill all zombies and players are out of the room before closing door or, kill any zombies left behind or , teleport zombies to a valid zone.
I have a script for this that you can use but what do you want the zombies to do after door closes?
also
func_for_debris{
level.trigger_targetname = "TARGETNAME_OF_TRIGGER_4_DEBRIS"; // replace the caps letters, this is the buy trigger
level.block_clip = "TARGETNAME_OF_MESH_TO_BLOCK"; // replace the caps letters, this is the mesh that blocks the way
level.newloc = "TARGETNAME_OF_MESH_TO_BLOCK"; // replace the caps letters, this is the script origin that the zombies that died will spawn at
level.zone_targetname = "TARGETNAME_OF_INSIDE_TRIGGER"; // replace the caps letters, this is the inside trigger
trigger = getent(level.trigger_targetname,"targetname");
//init the trigger
cost = 1000;
if( IsDefined( trigger.zombie_cost ) )
{
cost = trigger.zombie_cost;
}
trigger set_hint_string( trigger, "default_buy_debris_" + cost );
trigger SetCursorHint( "HINT_NOICON" );
if( isdefined (trigger.script_flag) && !IsDefined( level.flag[trigger.script_flag] ) )
{
flag_init( trigger.script_flag );
}
trigger UseTriggerRequireLookAt();
//end init
while( 1 )
{
trigger waittill( "trigger", who );
if( !who UseButtonPressed() )
{
continue;
}
if( who in_revive_trigger() )
{
continue;
}
if( is_player_valid( who ) )
{
if( who.score >= trigger.zombie_cost )
{
// set the score
who maps\_zombiemode_score::minus_to_player_score( trigger.zombie_cost );
if( isDefined( level.achievement_notify_func ) )
{
level [[ level.achievement_notify_func ]]( "DLC3_ZOMBIE_ALL_DOORS" );
}
bbPrint( "zombie_uses: playername %s playerscore %d round %d cost %d name %s x %f y %f z %f type debris", who.playername, who.score, level.round_number, trigger.zombie_cost, trigger.target, trigger.origin );
// delete the stuff
junk = getentarray( trigger.target, "targetname" );
if( IsDefined( trigger.script_flag ) )
{
flag_set( trigger.script_flag );
}
play_sound_at_pos( "purchase", trigger.origin );
move_ent = undefined;
clip = undefined;
for( i = 0; i < junk.size; i++ )
{
junk[i] connectpaths();
junk[i] add_new_zombie_spawners();
level notify ("junk purchased");
if( IsDefined( junk[i].script_noteworthy ) )
{
if( junk[i].script_noteworthy == "clip" )
{
clip = junk[i];
continue;
}
}
struct = undefined;
if( IsDefined( junk[i].script_linkTo ) )
{
struct = getstruct( junk[i].script_linkTo, "script_linkname" );
if( IsDefined( struct ) )
{
move_ent = junk[i];
junk[i] thread debris_move( struct );
}
else
{
junk[i] Delete();
}
}
else
{
junk[i] Delete();
}
}
// get all trigs, we might want a trigger on both sides
// of some junk sometimes
all_trigs = getentarray( trigger.target, "target" );
for( i = 0; i < all_trigs.size; i++ )
{
all_trigs[i] delete();
}
if( IsDefined( clip ) )
{
if( IsDefined( move_ent ) )
{
move_ent waittill( "movedone" );
move_ent notsolid();
}
clip Delete();
}
newclipfunc();
break;
}
else
{
play_sound_at_pos( "no_purchase", trigger.origin );
// who thread maps\nazi_zombie_sumpf_blockers::play_no_money_purchase_dialog();
}
}
}
}
newclipfunc(){
player[0]._inzone = false;
player[1]._inzone = false;
player[2]._inzone = false;
player[3]._inzone = false;
players = get_players();
trigger = getent(level.zone_targetname,"targetname");
while(1){
for(i=0;i<players.size;i++){
if(players[i] istouching(trigger)){
player[i]._inzone = true;
if(player.size == 4){
if(player[0]._inzone && player[1]._inzone && player[2]._inzone && player[3]._inzone)
{
blockit();
}
}else if(player.size == 3){
if(player[0]._inzone && player[1]._inzone && player[2]._inzone)
{
blockit();
}
}else if(player.size == 2){
if(player[0]._inzone && player[1]._inzone)
{
blockit();
}
}else if(player.size == 1){
if(player[0]._inzone)
{
blockit();
}
}
}else{
player[i]_inzone = false;
}
}
}
}
bockit(){
level.zombies_kilt = 0;
clip = getentarray(level.block_clip,"targetname"); // targetname of the mesh(s) to block the enterence
newloc = getent(level.newloc,"targetname");
zombies1 = getEntArray( "zombie_spawner", "script_noteworthy" );
zombies1 = getEntArray( "zombie_spawner", "script_noteworthy" );
later_rounds = getentarray("later_round_spawners", "script_noteworthy" );
trigger = getent(level.zone_targetname,"targetname");
for(i=0;i<clip.size;i++){
clip[i] movez(50,1); // 50 is how many units it will move up, 1 is the speed
}
zombies = GetAiArray( "axis" , "all" );
for(i=0;i<zombies.size;i++){
if(zombies[i] !istouching(trigger))
{
level.zombies_kilt++;
}
}
for(i=0;i<level.zombies_kilt;i++){
//if(level.round_number < HIGHROUND)
/*{
zombie = spawn_zombie( later_rounds[0] );
zombie maps\_zombiemode_spawner::zombie_think();
}*/
zombie = spawn_zombie( zombies1[0] );
zombie maps\_zombiemode_spawner::zombie_think();
zombie forceTeleport(newloc.origin);
}
}I was thinking wait until the end of the round and then close it off. The biggest problem I ran into is deactivating the spanners, as I couldn't find any way to do that.
this is found in the zone mananger: // The zone is not active so disable the spawners
else
{
// Making an assumption that if one of the zone's spawners
// is in the array, then all of them are in the array
if ( level.zones[ zone_name ].spawners.size > 0 )
{
no_dupes = array_check_for_dupes( level.enemy_spawns, level.zones[ zone_name ].spawners[0] );
if( !no_dupes )
{
for(x=0;x<level.zones[ zone_name ].spawners.size;x++)
{
level.zones[ zone_name ].spawners[x].locked_spawner = true;
level.enemy_spawns = array_remove_nokeys(level.enemy_spawns, level.zones[ zone_name ].spawners[x]);
}
}
}
// Making an assumption that if one of the zone's spawners is in the array, then all of them are in the array
if ( level.zones[ zone_name ].dog_spawners.size > 0 )
{
no_dupes = array_check_for_dupes( level.enemy_dog_spawns, level.zones[ zone_name ].dog_spawners[0] );
if( !no_dupes )
{
for(x=0;x<level.zones[ zone_name ].dog_spawners.size;x++)
{
level.enemy_dog_spawns = array_remove_nokeys(level.enemy_dog_spawns, level.zones[ zone_name ].dog_spawners[x]);
}
}
}
// deactivate any associated dog spawn locations
if ( level.zones[ zone_name ].dog_locations.size > 0 )
{
// Making an assumption that if one of the structs is in the array, then all of them are in the array
no_dupes = array_check_for_dupes(level.enemy_dog_locations, level.zones[ zone_name ].dog_locations[0]);
if( !no_dupes )
{
for(x=0; x<level.zones[ zone_name ].dog_locations.size; x++)
{
level.zones[ zone_name ].dog_locations[x].locked_spawner = false;
level.enemy_dog_locations = array_remove_nokeys(level.enemy_dog_locations, level.zones[ zone_name ].dog_locations[x]);
}
}
}
// deactivate any associated zombie_rise locations
if ( level.zones[ zone_name ].rise_locations.size > 0 )
{
// Making an assumption that if one of the zone's spawners
// is in the array, then all of them are in the array
no_dupes = array_check_for_dupes(level.zombie_rise_spawners, level.zones[ zone_name ].rise_locations[0]);
if( !no_dupes )
{
for(x=0; x<level.zones[ zone_name ].rise_locations.size; x++)
{
level.zones[ zone_name ].rise_locations[x].locked_spawner = false;
level.zombie_rise_spawners = array_remove_nokeys(level.zombie_rise_spawners, level.zones[ zone_name ].rise_locations[x]);
}
}
}
}
}
So when I want to deactivate, I would just set
level.zones[ "zone_name" ].is_active = false;
and this will subsequently disable all spawners?
![]() | Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum. |
![]() | Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community. |
i dont really know, I just took the code they use to disable the zone if no one is in it. Im way too tired to read it