I want an entire room to be moved. I have risers in that room, so I have to teleport the structs as they can't be moved. So I need first to stop the zombies spawning. I tried by turning off the zone and then on with:
Code Snippet
Plaintext
zone trigger_off(); // ... zone trigger_on();
And this actually works, but it doesn't move the zone as it is disabled. I tried also setting the .is_active = false and .is_enabled = false, but they do nothing. Any idea?
Im not sure what the function trigger_off() does, but the function disable_trigger() move's the trigger down 10000 units. So it's not actually disabled, it's just out of reach. Maybe that's the same with trigger_off() and that's messing with your move commands??
Also, the zone being an info_volume, i'm not sure if you can move those. Could be you need to 'teleport' them as well, just like the structs.
enable_trigger() / disable_trigger() functions from _zombiemode_utility:
I used something like this before to turn a zone off.
Code Snippet
Plaintext
zonedisabletrig = getent ("zonedisabletrig" , "targetname"); zonedisabletrig waittill ("trigger"); for(x=0;x<level.zones[ "start_zone" ].spawners.size;x++) { level.zones[ "start_zone" ].spawners[x].locked_spawner = true; level.enemy_spawns = array_remove_nokeys(level.enemy_spawns, level.zones[ "start_zone" ].spawners[x]); } level.zones[ "start_zone" ].is_enabled = false; // Does the zone need to be evaluated? level.zones[ "start_zone" ].is_occupied = false; // Is the zone occupied by a player? level.zones[ "start_zone" ].is_active = false; // Are the spawners currently enabled for spawning? } [code/]
Im not sure what the function trigger_off() does, but the function disable_trigger() move's the trigger down 10000 units. So it's not actually disabled, it's just out of reach. Maybe that's the same with trigger_off() and that's messing with your move commands??
Also, the zone being an info_volume, i'm not sure if you can move those. Could be you need to 'teleport' them as well, just like the structs.
So trigger_off() does the same as disable_trigger().
I used something like this before to turn a zone off.
Code Snippet
Plaintext
zonedisabletrig = getent ("zonedisabletrig" , "targetname"); zonedisabletrig waittill ("trigger"); for(x=0;x<level.zones[ "start_zone" ].spawners.size;x++) { level.zones[ "start_zone" ].spawners[x].locked_spawner = true; level.enemy_spawns = array_remove_nokeys(level.enemy_spawns, level.zones[ "start_zone" ].spawners[x]); } level.zones[ "start_zone" ].is_enabled = false; // Does the zone need to be evaluated? level.zones[ "start_zone" ].is_occupied = false; // Is the zone occupied by a player? level.zones[ "start_zone" ].is_active = false; // Are the spawners currently enabled for spawning? } [code/]
I like that function, but I don't understand it at all, so I think I wouldn't know to turn the zone on again lol.
Anyway, thank both of you very much for the ideas, but I made a shi*** function that changes the origin of the zone, then disables it and, after the move has been done, it enables the zone again. I don't like how I made it but it works, so I I'll use it.
I like that function, but I don't understand it at all, so I think I wouldn't know to turn the zone on again lol.
Code Snippet
Plaintext
zonedisabletrig = getent ("zonedisabletrig" , "targetname"); zonedisabletrig waittill ("trigger"); for(x=0;x<level.zones[ "start_zone" ].spawners.size;x++) { level.zones[ "start_zone" ].spawners[x].locked_spawner =false; level.enemy_spawns = array_remove_nokeys(level.enemy_spawns, level.zones[ "start_zone" ].spawners[x]); } level.zones[ "start_zone" ].is_enabled = true; // Does the zone need to be evaluated? level.zones[ "start_zone" ].is_occupied = true; // Is the zone occupied by a player? level.zones[ "start_zone" ].is_active =true; // Are the spawners currently enabled for spawning? }
Just a wild guess
Last Edit: September 10, 2015, 06:39:08 pm by BluntStuffy