Game makes browser crash

So, I’m getting a really strange crash in my game (hosted in dashingdon). Basically, when the player chooses any of the first three options (see below), the browser crashes (as in, completely freezes, not allowing you to do anything). I have no idea why this is happening, and cannot see any error in the code (I’ve ran the bugcheckers on it, and nothing…) Any thoughts? Has this happened to anybody else?

You can see the vehicle where they brought the engineer, but it is impossible to tell where they could have placed him.
You are going to have to get closer, and it would be better to take somebody with you just in case you run into trouble.

*if turret_alive = 1
However, somebody should also stay guard around the ATC. You are not sure that you trust {turret_name} enough, as {turret_he} could just run off with your vehicle while you are away.
But, you could bring {turret_him} along with you, or leave {turret_him} at the turret of the ATC in case anybody approaches.
*choice
#Bring {turret_name} along with you You signal for {turret_name} to follow you, and start to walk along the rocks on the side of the mountain, carefully heading in the direction of the gang’s camp.
There is no path for you to follow, and as you contour the mountain you soon lose sight of the place where you left the ATC.

     While passing behind a particularly large boulder, you suddenly hear a metallic sound behind you. 
     Turning, you see that ${turret_name} has taken out ${turret_his} knife, eyeing you with an unfriendly expression. Somehow, 
     ${turret_his} leg is slightly stuck in between two stones, which caused ${turret_him} to lose ${turret_his} balance slightly and make the noise. 
     Otherwise, ${turret_he} might have managed to stab you in the back by surprise. 
     
     Placing ${turret_his} index finger on ${turret_his} mouth, ${turret_he} says, "Shhhhh". Clearly, this is the perfect place to try to kill you, 
     given that you cannot risk firing your weapon and alert those in the camp.
     Presumably, ${turret_he} then intends to do the same thing to ${navigator_name}, and keep the ATC.         

     *set combined_fighting (bonus_hand_combat + hand_combat)
     
     *choice
        #"Why are you doing this?"

           *label turret_talk
           Releasing ${turret_his} foot from the rocks, ${turret_name} starts to slowly approach you. "You know, ATCs fetch a good price these days!"
           
           It is clear ${turret_he} has no intention to negotiate with you over this. 
           
           *goto turret_fight
         
        #"Surely there is another way? We can solve this in a civilized manner"
        
           *goto turret_talk
        

        #Wait until ${turret_he} gets ${turret_his} foot free to attack 
           *set honour %+30            
           You wait for ${turret_him} to release ${turret_his} foot before you start your attack. 
           *goto turret_fight
           
        #Attack ${turret_him} immediately, taking advantage of ${turret_his} foot being stuck between the rocks
           *set honour %-10
           Better to take advantage of the situation, as with ${turret_his} foot stuck ${turret_he} is an easy target.  

           *set combined_fighting +50
                
           *label turret_fight
           *label strike_turret

           *if combined_fighting > turret_shooting               
           
                *if hand_weapon_type = "crushing"
                     Your ${hand_weapon_name} hits ${turret_him} on the side of the side of the head, knocking ${turret_him} out immediately.            
                     *goto finish_turret_fight
                     
                *else 
                    Your ${hand_weapon_name} strikes ${turret_his} hand, making ${turret_him} drop the knife ${turret_he} was holding. 
                    Falling to ${turret_his} knees, ${turret_he} pleads for mercy, promising that you'll never see ${turret_him} again if you let ${turret_him} live. 
                    *label finish_turret_fight   
                    
                    *choice
                        #Finish ${turret_him} off, ${turret_he} deserves to die for betraying you
                            
                            *label kill_turret
                        
                            With one swift movement of your ${hand_weapon_name} you finish ${turret_him} off. 
                    
                            *set human_kills + 1 
                            *set turret_alive 0
                            *set killed_turret 1
                    
                            Looking at the inert body of ${turret_name}, you curse the moment you thought it would be a good idea to hire ${turret_him}. Nevertheless, 
                            it was probably better to find out about ${turret_his} treacherous nature now than at a worse moment later. 
                    
                            *set kindness %-20
                            *set honour %-20
                     
                            *page_break
                    
                            *goto entrance_doorway

                        #Kill ${turret_him}. It is too dangerous to let ${turret_him} live  
                        
                            *goto kill_turret
                            
                        #Kill ${turret_him}. You never really liked ${turret_him} anyway  
                        
                            *goto kill_turret     

                        #Knock ${turret_him} out and handcuff ${turret_him}. You'll deal with ${turret_him} later, or abandon ${turret_him} to {turret_his} fate here
                        
                            *goto let_turret_live
                            
                        #Knock ${turret_him} out and handcuff ${turret_him}. !${turret_he}'ll have to answer to justice when you get to Burgos, if you decide to even bother dragging ${turret_him} back to the ATC
                        
                            *label let_turret_live
                        
                            With one swift movement of your ${hand_weapon_name} you knock ${turret_him} out. Then, you take your handcuffs out and place them on ${turret_him}, 
                            placing a handkerchief over ${turret_his} mouth so that ${turret_he} cannot scream for help. 
                 
                            
                            *set turret_alive 1
                            *set killed_turret 1
                            *set turret_handcuffed 1
                    
                            *set kindness %+30
                            *set honour %+20
                    
                            *page_break
                    
                            *goto entrance_doorway

           *else 
               *set hp %-20
               As you advance towards ${turret_him}, ${turret_he} slashes you with ${turret_his} knife on the side of the face. Surely, this would leave a nasty scar, 
               but before ${turret_he} can return to a defensive position you strike.  
               *goto strike_turret                                

     
  #Leave ${turret_name} at the ATC with ${navigator_name}         
     You leave ${turret_name} and ${navigator_name} at the ATC and start to walk along the rocks on the side of the mountain, carefully heading in the direction of the gang's camp. 
     There is no path for you to follow, and as you contour the mountain you soon lose sight of the place where you left the ATC. 
     
     *goto entrance_doorway         

*else

However, it would also be good for one of you to stand guard by the ATC, so you leave ${navigator_name} behind and start to walk along the rocks on the side of the mountain,
carefully heading in the direction of the gang’s camp.
There is no path for you to follow, and as you contour the mountain you soon lose sight of the place where you left the ATC.

*label entrance_doorway

I think (but my mind might be fried from my own coding today) that this label embedded within two layers of *if sends the game on an infinite loop.

In theory it should work fine but labels embedded within If strings tend to be problematic.

Of course, my coding is both basic and inefficient, so you can take my diagnostic with a grain of salt.

1 Like

Thanks, I feel like a complete idiot! (I cannot understand why I kept looking over and over at the code but didn’t see this!)

1 Like

I think every Coder knows that feeling.

4 Likes