Finding linked doors/debris
-
Hey guys. My Zombies servers (both T5 and T6) have a feature where VIPs can lock a particular door or debris barrier so that other players can't open it and mess up their strategy. It works fine, except that most doors need to have both sides locked separately, and some doors are even linked to other doors (for example, the left-hand stage door in Kino is linked to another door on the floor above, with a flight of stairs between them, which both open if you pay to open one of them) and both doors need to be locked individually. Does anyone know a quick and easy way to figure out which other triggers are linked to a given door trigger, without having to rely on distance? I've tried a few things but can't figure it out.
This is my current code...
closedist = undefined; closedoor = undefined; //closetype = undefined; doors = getEntArray("zombie_door", "targetname"); if (isDefined(doors)) { for (i = 0; i < doors.size; i ++) { door = doors[i]; if (isDefined(door.zombie_cost) && (door.zombie_cost > 0) && (door.zombie_cost < 6969)) { dist = distanceSquared(ply.origin, door.origin); if (!isDefined(closedist) || (dist < closedist)) { closedist = dist; closedoor = door; //closetype = "zombie_door"; } } } } doors = getEntArray("zombie_debris", "targetname"); if (isDefined(doors)) { for (i = 0; i < doors.size; i ++) { door = doors[i]; if (isDefined(door.zombie_cost) && (door.zombie_cost > 0) && (door.zombie_cost < 6969)) { dist = distanceSquared(ply.origin, door.origin); if (!isDefined(closedist) || (dist < closedist)) { closedist = dist; closedoor = door; //closetype = "zombie_debris"; } } } } //æmoon*æ{ doors = getEntArray("zombie_airlock_buy", "targetname"); if (isDefined(doors)) { for (i = 0; i < doors.size; i ++) { door = doors[i]; if (isDefined(door.zombie_cost) && (door.zombie_cost > 0) && (door.zombie_cost < 6969)) { dist = distanceSquared(ply.origin, door.origin); if (!isDefined(closedist) || (dist < closedist)) { closedist = dist; closedoor = door; //closetype = "zombie_airlock_buy"; } } } } //}æ if (isDefined(closedoor)) { if (level.ConfigGameMode != "Gun Game") ply maps\_zombiemode_score::minus_to_player_score(1000); closedoor.zombie_cost = 6969; closedoor trigger_off(); }
It's a bit ugly - me and GSC don't get on very well - but it works for an individual side of a single door. The Moon part is obviously cut out of the scripts for other maps, and the price increase is just a failsafe.
-
Balrog85 Try dumping the mapents for the map using a public tool you can google to get, and check the key value pairs for the zombie_door type entities to see how they link doors together.
Alternatively, you can study the code here https://github.com/plutoniummod/t5-scripts/blob/main/ZM/Common/maps/_zombiemode_blockers.gsc where it runs the door code and determine how the game knows a door is linked.
-
Thanks. I couldn't get the tool to build, but I re-read the blockers GSC file you linked and noticed something I'd missed - think it's more up-to-date than the GSC dump I've been using.
Edit: Yeah, got it working. It was as simple as checking for triggers with the same "target" property. Seems really obvious now but I was trying the wrong properties, thinking it had something to do with the link-related ones.