void AttachSlate(string &in asArea, string &in asBodyName)
{
for(int a=1; a <= 5; ++a) for(int b=1; b <= 5; ++b) {
int x = a;
int y = b;
string sThisArea = "x"+a+"y"+b;
if(asArea == sThisArea) {
AddDebugMessage("asArea: " + asArea, false);
if(StringContains(asBodyName, "west")) {
SetLocalVarString("WestDoor", sThisArea + "_w");
SetLocalVarInt(GetLocalVarString("WestDoor"), 1);
AddDebugMessage("West Variable: > " + GetLocalVarString("WestDoor") + " < is now: " + GetLocalVarInt(GetLocalVarString("WestDoor")), false);
}
if(StringContains(asBodyName, "north")) { // x=2, y=3 (first slate: put turn in x2y3)
SetLocalVarString("NorthDoor", sThisArea + "_n"); // NorthDoor = "x2y3_n"
SetLocalVarInt(GetLocalVarString("NorthDoor"), 1); // x2y3_n = 1
AddDebugMessage("North Variable: > " + GetLocalVarString("NorthDoor") + " < is now: " + GetLocalVarInt(GetLocalVarString("NorthDoor")), false);
}
if(StringContains(asBodyName, "east")) { // x=2, y=3
SetLocalVarString("EastDoor", sThisArea + "_e"); // EastDoor = "x2y3_e"
SetLocalVarInt(GetLocalVarString("EastDoor"), 1); // x2y3_e = 1
AddDebugMessage("East Variable: > " + GetLocalVarString("EastDoor") + " < is now: " + GetLocalVarInt(GetLocalVarString("EastDoor")), false);
}
if(StringContains(asBodyName, "south")) {
SetLocalVarString("SouthDoor", sThisArea + "_s");
SetLocalVarInt(GetLocalVarString("SouthDoor"), 1);
AddDebugMessage("South Variable: > " + GetLocalVarString("SouthDoor") + " < is now: " + GetLocalVarInt(GetLocalVarString("SouthDoor")), false);
}
// x=2, y=2 (second slate: put horiz. in x2y2)
SetLocalVarString("WestReady", "x" + --x + "y" + y); ++x; // WestReady = "x1y2"
SetLocalVarString("NorthReady", "x" + x + "y" + --y); ++y; // NorthReady = "x2y1"
SetLocalVarString("EastReady", "x" + ++x + "y" + y); --x; // EastReady = "x3y2"
SetLocalVarString("SouthReady", "x" + x + "y" + ++y); --y; // SouthReady = "x2y3"
string sThisRoom = "x"+x+"y"+y; // sThisRoom = "x2y2"
AddDebugMessage("WestReady: " + GetLocalVarString("WestReady") + "_e = " + GetLocalVarInt(GetLocalVarString("WestReady")), false);
AddDebugMessage("NorthReady: " + GetLocalVarString("NorthReady") + "_s = " + GetLocalVarInt(GetLocalVarString("NorthReady")), false);
AddDebugMessage("EastReady: " + GetLocalVarString("EastReady") + "_w = " + GetLocalVarInt(GetLocalVarString("EastReady")), false);
AddDebugMessage("SouthReady: " + GetLocalVarString("SouthReady") + "_n = " + GetLocalVarInt(GetLocalVarString("SouthReady")), false);
if(GetBoolLocalVarInt(GetLocalVarString("WestReady")+"_e") && GetBoolLocalVarInt(GetLocalVarString("WestDoor")))
if(GetEntityExists("move_" + GetLocalVarString("WestReady") + "_" + sThisRoom) == true)
UpdateDoors("move_" + GetLocalVarString("WestReady") + "_" + sThisRoom, 1);
if(GetBoolLocalVarInt(GetLocalVarString("NorthReady")+"_s") && GetBoolLocalVarInt(GetLocalVarString("NorthDoor")))
if(GetEntityExists("move_" + GetLocalVarString("NorthReady") + "_" + sThisRoom) == true)
UpdateDoors("move_" + GetLocalVarString("NorthReady") + "_" + sThisRoom, 1);
if(GetBoolLocalVarInt(GetLocalVarString("EastReady")+"_w") && GetBoolLocalVarInt(GetLocalVarString("EastDoor")))
if(GetEntityExists("move_" + sThisRoom + "_" + GetLocalVarString("EastReady")) == true)
UpdateDoors("move_" + sThisRoom + "_" + GetLocalVarString("EastReady"), 1);
if(GetBoolLocalVarInt(GetLocalVarString("SouthReady")+"_n") && GetBoolLocalVarInt(GetLocalVarString("SouthDoor"))) // x2y3_n = true && SouthDoor = ?
if(GetEntityExists("move_" + sThisRoom + "_" + GetLocalVarString("SouthReady")) == true)
UpdateDoors("move_" + sThisRoom + "_" + GetLocalVarString("SouthReady"), 1); // move_x2y2_x2y3
}
}
}