Changeset 2242

Show
Ignore:
Timestamp:
05/02/12 19:34:15 (14 months ago)
Author:
palota
Message:

adlerhorst_te: fixed elevator

Location:
Enemy-Territory/0.8/et/nav
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • Enemy-Territory/0.8/et/nav/adlerhorst_te.gm

    r1662 r2242  
    3434        Tank_Barrier_Dyno = 0, 
    3535        bridge_Dyno = 0, 
    36         Switches_callup_Enabled = false, 
    37         Switches_in_top_Enabled = false, 
    38         Switches_calldown_Enabled = false, 
    39         Switches_in_bot_Enabled = false, 
    4036        bridge_Built = false, 
    4137        Tank_Barrier_Built = false, 
     
    5046        doorbotstatus = false, //closed 
    5147        lift1Pos = "bottom", //lift at bottom 
     48        lift1Moving = false, 
    5249        docs_Taken = false, 
    5350        docs_Reurned = false, 
    54         doortopstatus = false, //closed 
    55         doorbotstatus = false, //closed 
    5651        Tank_Built = true, //Built at Start 
    5752 
     
    117112                        Priority = 0, 
    118113                        WaypointName = "callup", 
    119                         LimitBots = 1, 
    120                         PressOnce = true, 
    121                         Timeout = 1500, 
    122                         LimitTeam = 0, // disabled initially. 
     114                        Timeout = 22000, 
    123115                        AimPosition = Vec3(-4476.618, -7115.125 ,4064.090), 
    124116                        // /bot waypoint_setproperty paththrough UseSwitch_PT:callup 
     117                        ExitConditions = 
     118                        { 
     119                                f = function(bot){ 
     120                                        return Map.lift1Moving && Map.lift1Pos == "bottom"; 
     121                                } 
     122                        }, 
    125123                        Wait = function() 
    126124                        { 
    127                                 if ( Map.doortopstatus == true && Map.lift1Pos == "top") 
    128                                 { 
    129                                         sleep(0.5); 
    130                                         return true; 
    131                                 } 
    132                                 else if ( Map.doortopstatus == false && Map.lift1Pos == "top") 
    133                                 { 
    134                                         sleep(1.5); 
    135                                         return true; 
    136                                 } 
    137                                 else if ( Map.lift1Pos == "moving" ) 
    138                                 { 
    139                                         sleep(17); 
    140                                         return true; 
    141                                 } 
    142                                 return false; 
     125                                if(Map.lift1Moving){ return false; } 
     126                                sleep(2); 
     127                                return true; 
    143128                        }, 
    144129                }, 
     
    148133                        Priority = 0, 
    149134                        WaypointName = "in_top", 
    150                         LimitBots = 1, 
    151                         PressOnce = true, 
    152                         Timeout = 1500, 
    153                         LimitTeam = 0, // disabled initially. 
     135                        Timeout = 3500, 
    154136                        AimPosition = Vec3(-4552.427, -6960.125, 4064.761), 
    155137                        // /bot waypoint_setproperty paththrough UseSwitch_PT:in_top 
    156138                        Wait = function() 
    157139                        { 
    158                                 if ( Map.doortopstatus == true && Map.lift1Pos == "top" ) 
    159                                 { 
    160                                         sleep(0.5); 
    161                                         return true; 
    162                                 } 
    163                                 else if ( Map.doortopstatus == false && Map.lift1Pos == "top" ) 
    164                                 { 
    165                                         sleep(1.5); 
    166                                         return true; 
    167                                 } 
    168                                 else if ( Map.lift1Pos == "moving" ) 
    169                                 { 
    170                                         sleep(17); 
    171                                         return true; 
    172                                 } 
    173                                 return false; 
     140                                return !Map.lift1Moving; 
    174141                        }, 
    175142                }, 
     
    179146                        Priority = 0, 
    180147                        WaypointName = "calldown", 
    181                         LimitBots = 1, 
    182                         PressOnce = true, 
    183                         Timeout = 1500, 
    184                         LimitTeam = 0, // disabled initially. 
     148                        Timeout = 22000, 
    185149                        AimPosition = Vec3(-4601.875, -6887.567, 1216.112), 
    186150                        // /bot waypoint_setproperty paththrough UseSwitch_PT:calldown 
     151                        ExitConditions = 
     152                        { 
     153                                f = function(bot){ 
     154                                        return Map.lift1Moving && Map.lift1Pos == "top"; 
     155                                } 
     156                        }, 
    187157                        Wait = function() 
    188158                        { 
    189                                 if ( Map.doorbotstatus == true && Map.lift1Pos == "bottom") 
    190                                 { 
    191                                         sleep(0.5); 
    192                                         return true; 
    193                                 } 
    194                                 else if ( Map.doorbotstatus == false && Map.lift1Pos == "bottom") 
    195                                 { 
    196                                         sleep(1.5); 
    197                                         return true; 
    198                                 } 
    199                                 else if ( Map.lift1Pos == "moving" ) 
    200                                 { 
    201                                         sleep(17); 
    202                                         return true; 
    203                                 } 
    204                                 return false; 
     159                                if(Map.lift1Moving){ return false; } 
     160                                sleep(2); 
     161                                return true; 
    205162                        }, 
    206163                }, 
     
    210167                        Priority = 0, 
    211168                        WaypointName = "in_bot", 
    212                         LimitBots = 1, 
    213                         PressOnce = true, 
    214                         Timeout = 1500, 
    215                         LimitTeam = 0, // disabled initially. 
    216                         AimPosition = Vec3(-4552.246, 7063.875, 1216.423), 
     169                        Timeout = 3500, 
     170                        AimPosition = Vec3(-4552.246, -7063.875, 1216.423), 
    217171                        // /bot waypoint_setproperty paththrough UseSwitch_PT:in_bot 
    218172                        Wait = function() 
    219173                        { 
    220                                 if ( Map.doorbotstatus == true && Map.lift1Pos == "bottom" ) 
    221                                 { 
    222                                         sleep(0.5); 
    223                                         return true; 
    224  
    225                                 } 
    226                                 else if ( Map.doorbotstatus == false && Map.lift1Pos == "bottom" ) 
    227                                 { 
    228                                         sleep(1.5); 
    229                                         return true; 
    230                                 } 
    231                                 else if ( Map.lift1Pos == "moving" ) 
    232                                 { 
    233                                         sleep(17); 
    234                                         return true; 
    235                                 } 
    236                                 return false; 
     174                                return !Map.lift1Moving; 
    237175                        }, 
    238176                }, 
     
    242180        lift1 = function(trigger) 
    243181        { 
    244                 Map.lift1Pos = "moving"; 
    245                 Map.Switches.callup.Disabled = true; 
    246                 Map.Switches.in_top.Disabled= true; 
    247                 Map.Switches.calldown.Disabled = true; 
    248                 Map.Switches.in_bot.Disabled = true; 
    249                 Map.Switches.e1_top1.LimitTeam = 0; 
    250                 Map.Switches.e1_top2.LimitTeam = 0; 
    251                 Map.Switches.e1_bot1.LimitTeam = 0; 
    252                 Map.Switches.e1_bot2.LimitTeam = 0; 
    253                 doortopstatus = false; //closed 
    254                 doorbotstatus = false; //closed 
    255                 Util.MapDebugPrint("lift moving"); 
    256  
    257                 sleep(17); 
    258  
    259                 vel = ToVector(trigger.Action); 
    260  
    261                 if (vel.z < 0) 
     182                Util.MapDebugPrint("lift moving", true); 
     183                Map.Switches.in_top.Enabled = false; 
     184                Map.Switches.in_bot.Enabled = false; 
     185 
     186                Map.lift1Moving = true; 
     187                sleep(15.3); 
     188                Map.lift1Moving = false; 
     189 
     190                z = ToVector(trigger.Action).z; 
     191                if (z < 0) 
    262192                { 
    263193                        Map.lift1Pos = "bottom"; 
    264                         Map.Switches.calldown.Enabled = true; 
     194                        Util.MapDebugPrint("lift at bottom", true); 
     195                        sleep(2); 
    265196                        Map.Switches.in_bot.Enabled = true; 
    266  
    267                         Util.MapDebugPrint("lift at bottom"); 
    268                 } 
    269                 else if (vel.z > 0) 
     197                } 
     198                else if (z > 0) 
    270199                { 
    271200                        Map.lift1Pos = "top"; 
    272                         Map.Switches.callup.Enabled = true; 
     201                        Util.MapDebugPrint("lift at top", true); 
     202                        sleep(2); 
    273203                        Map.Switches.in_top.Enabled = true; 
    274  
    275                         Util.MapDebugPrint("lift at top"); 
    276                 } 
    277         }, 
     204                } 
     205        }, 
     206 
    278207        //lift doors 
    279208        lowerliftdoor = function( trigger ) 
     
    283212                        Map.doorbotstatus = true; //open 
    284213                        Map.Switches.calldown.Enabled = false; 
    285                         Map.Switches.in_bot.Enabled = false; 
    286                         Wp.SetWaypointFlag("bot","closed",false); 
    287  
    288                         Util.MapDebugPrint("Bottom Door Open"); 
     214 
     215                        Util.MapDebugPrint("Bottom Door Open", true); 
    289216                } 
    290217                else if ( trigger.Action == "closing" ) 
     
    292219                        Map.doorbotstatus = false; //closed 
    293220                        Map.Switches.calldown.Enabled = true; 
    294                         Map.Switches.in_bot.Enabled = true; 
    295                         Wp.SetWaypointFlag("bot","closed",true); 
    296  
    297                         Util.MapDebugPrint("Bottom Door Closed"); 
     221 
     222                        Util.MapDebugPrint("Bottom Door Closed", true); 
    298223                } 
    299224        }, 
     
    304229                        Map.doortopstatus = true; //open 
    305230                        Map.Switches.callup.Enabled = false; 
    306                         Map.Switches.in_top.Enabled = false; 
    307                         Wp.SetWaypointFlag("top","closed",false); 
    308  
    309                         Util.MapDebugPrint("Top Door Open"); 
     231 
     232                        Util.MapDebugPrint("Top Door Open", true); 
    310233                } 
    311234                else if ( trigger.Action == "closing" ) 
     
    313236                        Map.doortopstatus = false; //closed 
    314237                        Map.Switches.callup.Enabled = true; 
    315                         Map.Switches.in_top.Enabled = true; 
    316                         Wp.SetWaypointFlag("top","closed",true); 
    317  
    318                         Util.MapDebugPrint("Top Door Closed"); 
     238 
     239                        Util.MapDebugPrint("Top Door Closed", true); 
    319240                } 
    320241        }, 
     
    701622                Map.Switches.calldown.Enabled = true; 
    702623                Map.Switches.in_bot.Enabled = true; 
    703                 Map.Switches.callup.LimitTeam = (1<<TEAM.ALLIES); 
    704                 Map.Switches.in_top.LimitTeam = (1<<TEAM.ALLIES); 
    705                 Map.Switches.calldown.LimitTeam = (1<<TEAM.ALLIES); 
    706                 Map.Switches.in_bot.LimitTeam = (1<<TEAM.ALLIES); 
    707                 Wp.SetWaypointFlag("LIFT_A","closed",false); //open the way to the lift 
    708                 Wp.SetWaypointFlag("top","closed",false); 
    709                 Wp.SetWaypointFlag("bot","closed",false); 
     624                Wp.SetWaypointFlag("in_top","closed",false); 
     625                Wp.SetWaypointFlag("in_bot","closed",false); 
    710626                //Bots don't use lift till controls built 
    711627                Util.EnableGoal( "FLAG.*" ); 
     
    746662                Map.Elevator_Controls_Dyno = 0; 
    747663 
    748                 Map.Switches.callup.Disabled = true; 
    749                 Map.Switches.in_top.Disabled= true; 
    750                 Map.Switches.calldown.Disabled = true; 
    751                 Map.Switches.in_bot.Disabled = true; 
    752                 Map.Switches.e1_top1.LimitTeam = 0; 
    753                 Map.Switches.e1_top2.LimitTeam = 0; 
    754                 Map.Switches.e1_bot1.LimitTeam = 0; 
    755                 Map.Switches.e1_bot2.LimitTeam = 0; 
    756  
    757                 Wp.SetWaypointFlag("LIFT_A","closed",true); //close the way to the lift 
    758                 Wp.SetWaypointFlag("top","closed",true); 
    759                 Wp.SetWaypointFlag("bot","closed",true); 
     664                Map.Switches.callup.Enabled = false; 
     665                Map.Switches.in_top.Enabled= false; 
     666                Map.Switches.calldown.Enabled = false; 
     667                Map.Switches.in_bot.Enabled = false; 
     668 
     669                Wp.SetWaypointFlag("in_top","closed",true); 
     670                Wp.SetWaypointFlag("in_bot","closed",true); 
    760671                SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_lift.*" ); 
    761672                SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_docs.*" ); 
     
    13241235        SetAvailableMapGoals( TEAM.ALLIES, true, "MOUNT_Tank" ); 
    13251236        SetAvailableMapGoals( TEAM.ALLIES, true, "ATTACK_ZONE.*"); 
    1326         Wp.SetWaypointFlag("LIFT_A","closed",true); 
    1327         Wp.SetWaypointFlag("top","closed",true); 
    1328         Wp.SetWaypointFlag("bot","closed",true); 
     1237        Wp.SetWaypointFlag("in_top","closed",true); 
     1238        Wp.SetWaypointFlag("in_bot","closed",true); 
    13291239//Add Use Wp 
    13301240        Util.AddUseWp("PLANT_Assault_Ramp", "ramp");