watchingtutorial = 0
bind ESCAPE [ if $connected [ ingamemenu ] [if (= (watchingtutorial) 1) [ showmenu "Tutorial Menu" ] [ if (watchingdemo) [ showmenu "Watching demo" ] [ showmenu main ] ] ] ]   
        tutstart = [
        if (= $arg1 1) [                             
                                mapstartonce = [tut]
                                
                        //disable most of the HUD
                        getconsize__ = $consize
                        getcrosshairsize__ = $crosshairsize
                        gethidespecthud__ = $hidespecthud
                        gethideteam__ = $hideteam
                        gethidehudequipment__ = $hidehudequipment
                        consize 0
                        crosshairsize 0
                        hidespecthud 1
                        hideteam 1
                        hidehudequipment 1
						//begin
                        watchingtutorial = [1]                  
                        demo "tutorial_demo"
] []]
 
        endtutorial = [
                consize $getconsize__
                crosshairsize $getcrosshairsize__
                hidespecthud $gethidespecthud__
                hideteam $gethideteam__
                hidehudequipment $gethidehudequipment__
                watchingtutorial = 0
]
tut = [
        sleep 50 [paused 1; showmenu "AC Tutorial - Welcome"; sleep 20 [mapstartonce = [endtutorial]]]
                consize 1; echo "2Live tutorial information will appear here."
]
 
tut2 = [
        sleep 9000 [paused 1; showmenu "AC Tutorial - Basic Movement"] //Need echoes timed with the movement before the paused 1
]
 
tut3 = [
        sleep 8000 [paused 1; showmenu "AC Tutorial - More Movement"] //ibid
]
        
tut4 = [
                consize 1; echo "Here, the players are straferunning."
                sleep 14200 [
                consize 2; echo "Now, they are jumping." 
                sleep 6000 [
                consize 1; echo "See them crouch up and down!"
                sleep 6000 [
                echo "See them crouchjump up and down!" ] ] ] 
        sleep 42000 [paused 1; showmenu "AC Tutorial - Weapons"] //Main timing sequence to go to next menu, all above are subkeyframes
]
        
tut5 = [
        sleep 10 [paused 1; showmenu "AC Tutorial - Weapon Info"] 
]
        
tut6 = [
                sleep 6000 [consize 2; echo "Someone is about to get splattered with the shotgun"]
                sleep 18000 [consize 2; echo "BOOM HEADSHOT! Remember, there is no spread while scoping."]
                sleep 26000 [consize 2; echo "Slice and dice with the knife."]
                sleep 41000 [consize 2; echo "Fire in the hole! Grenades, grenades, grenades."]
        sleep 50000 [paused 1; showmenu "AC Tutorial - CTF"]
]
 
tut7 = [
                                sleep 9000 [consize 3; echo "Touch a flag to pick it up"]
                                sleep 17000 [echo "You will drop the flag if you get fragged."]
                                sleep 19000 [echo "Touch the flag to return it"]
                                sleep 26000 [echo "Touch your own flag to score!"]
        sleep 41000 [paused 1; showmenu "AC Tutorial - Advanced"] 
]
 
tut8 = [                
                                sleep 50 [echo "They are now edge jumping. These are popular spots to edgejump."]
                                sleep 18500 [echo "To rifle sprint, face opposite to where you want to go, and jump backwards while shooting."]
                                sleep 32500 [echo "Similar to the rifle sprint, rifle jump by jumping, facing down, and shooting."]
                                sleep 49000 [echo "That was a bad attempt at grenade jumping. You are not supposed to suicide."]
                                sleep 50000 [echo "A good grenade jump will give you height and distance."]
                                sleep 65000 [echo "Time for the combat demonstration!"]
        sleep 200000 [paused 1; showmenu "AC Tutorial - GG"]
]
 
newmenu "Tutorial Menu"
menuitem "Go back to tutorial" [closemenu "Watching Tutorial"; paused 0]
menuitem "Restart tutorial" "tutstart 1"
menuitem "3Stop 5tutorial" "dm ac_complex; endtutorial"
 
newmenu "AC Tutorial - Welcome"
menuitem "1Thank you for downloading and trying 2AssaultCube!" -1
menuitem "" -1
menuitem "This short tutorial will show you the basics so you" -1
menuitem "can start fragging as soon as possible. Just sit back" -1
menuitem "and watch. You will be able to experiment after." -1
menuitem "" -1
menuitem "                      0Continue" "paused 0; tut2; consize 0"
 
newmenu "AC Tutorial - Basic Movement"
menuitem "Basic movement is done with the WASD keys." -1
menuitem "For left-handed players that prefer to use" -1
menuitem "the arrow keys for movement, you can switch" -1
menuitem "to a left-handed setup via the HUD settings." -1
menuitem "This change will only be visible if your weapon" -1
menuitem "model is visible on the screen. /hudgun 1" -1
menuitem "" -1
menuitem "W: Forward" -1
menuitem "S: Backward" -1
menuitem "A: Left" -1
menuitem "D: Right" -1
menuitem "" -1 
menuitem "                   0Continue - 1/7" "paused 0; tut3"
 
newmenu "AC Tutorial - More Movement"
menuitem "If you combine a directional key (W or S)" -1
menuitem "with a strafing key, you will straferun." -1
menuitem "This diagonal movement is faster. Use it" -1
menuitem "to your advantage all day, every day." -1
menuitem "" -1
menuitem "Jumping is done with the spacebar." -1
menuitem "Use it to get up to new places or" -1
menuitem "dodge bullets." -1
menuitem "" -1
menuitem "Crouching makes your player go low" -1
menuitem "to the ground. It reduces recoil," -1
menuitem "which is what causes your gun to" -1
menuitem "be pushed upwards when you shoot." -1
menuitem "" -1
menuitem "Crouch jumping is a combination of" -1
menuitem "the two. First jump, then crouch." -1
menuitem "Your player will jump slightly higher" -1
menuitem "and farther with this technique." -1
menuitem "" -1
menuitem "Jump: spacebar" -1
menuitem "Crouch: shift" -1
menuitem "" -1
menuitem "                   0Continue - 2/7" "paused 0; tut4"
 
newmenu "AC Tutorial - Weapons"
menuitem "There is a variety of weapons in AssaultCube." -1
menuitem "Some are better for certain situations than" -1
menuitem "others. Choose your starting weapon with the B" -1
menuitem "key. Switch between your pistol, grenades and" -1
menuitem "knife by scrolling the mouse wheel." -1
menuitem "" -1
menuitem "When you are out of ammo for your primary" -1
menuitem "weapon, it is sometimes better to switch to" -1
menuitem "your pistol (scroll the mousewheel or press 2)" -1
menuitem "and keep firing." -1
menuitem "" -1
menuitem "Your knife is also a potent weapon. Use it" -1
menuitem "when your enemy is cornered or out of ammo." -1
menuitem "" -1 
menuitem "For long range engagements, or for better" -1
menuitem "accuracy, use the right mouse button to use" -1
menuitem "the sniper scope. The sniper is the only" -1
menuitem "weapon that has a scope, and is more accurate" -1
menuitem "when scoped. However there is no damage bonus." -1
menuitem "" -1
menuitem "Shoot: left mouse" -1
menuitem "Reload: R" -1
menuitem "Scope/Grenade: right mouse" -1
menuitem "Cycle through weapons: mousewheel" -1
menuitem "Knife: middle mouse click"
menuitem "" -1
menuitem "                         0Continue - 3/7" "paused 0; tut5"
 
newmenu "AC Tutorial - Weapon Info"
menuitem "When you get close enough to your enemy, the" -1
menuitem "shotgun will splatter them into bits of gibs (gore)." -1
menuitem "" -1
menuitem "A headshot with the sniper will reward you with an" -1
menuitem "instant kill and 2 frags instead of one." -1
menuitem "" -1
menuitem "A knife kill is worth two frags as well." -1
menuitem "Just make sure you are close to your enemy!" -1
menuitem "" -1
menuitem "Be careful with grenades! One can easily damage,"-1
menuitem "or gib teammates with these." -1
menuitem "" -1 
menuitem "                         0Continue - 4/7" "paused 0; tut6"
 
newmenu "AC Tutorial - CTF"
menuitem "Capture the Flag, or CTF for short, is one of the" -1
menuitem "most popular gamemodes in AssaultCube. The objective" -1
menuitem "here is to bring the enemy flag back to your own, All" -1
menuitem "while the opposing team is trying to steal yours! If" -1
menuitem "you are the flag carrier and your own flag is stolen," -1
menuitem "is usually safer to proceed to the safety of your own" -1
menuitem "base." -1
menuitem "" -1 
menuitem "                         0Continue - 5/7" "paused 0; tut7"
 
newmenu "AC Tutorial - Advanced"
menuitem "There are several advanced tactics you can use while" -1
menuitem "playing AssaultCube." -1
menuitem "Edge jumping is a trick that lets you jump higher," -1
menuitem "when jumping onto an edge. You must be strafing or" -1
menuitem "straferunning and land on the very edge of a ledge" -1
menuitem "to execute this. Press spacebar again when you are" -1
menuitem "on the edge to jump a bit higher." -1
menuitem ""
menuitem "Rifle sprinting uses the recoil of the Assault Rifle" -1
menuitem "to propel you across a map." -1
menuitem "" -1 
menuitem "Rifle jump is similar a rifle sprint, except you use" -1
menuitem "it to jump higher and farther. A grenade jump is a" -1
menuitem "more drastic and violent jump, using the explosion" -1
menuitem "of the grenade to propel yourself." -1
menuitem "" -1 
menuitem "After this is done, you will watch demonstration of" -1
menuitem "real combat in AssaultCube."
menuitem "                                  0Continue - 6/7" "paused 0; tut8"
 
newmenu "AC Tutorial - GG"
menuitem "Thats it! The tutorial is over now. Take a minute" -1
menuitem "to look at the scoreboard. Your name along with" -1
menuitem "your frags and deaths will be displayed. When" -1
menuitem "applicable, points for objective-based games" -1
menuitem "are also displayed. Score is calculated with a" -1
menuitem "complicated formula, which will not be discussed" -1
menuitem "in this tutorial. Ping is the lag time i.e. latency." -1
menuitem "However, a high ping is not unplayable with AC," -1
menuitem "where pings of up to 350 are acceptable. The column" -1
menuitem "before that is PJ, short for Packet Jump. Normal" -1
menuitem "values for PJ is around 40-60, anything higher than" -1
menuitem "this will cause strange gameplay effects such as" -1
menuitem "teleporting. When a players PJ shows LAG it means" -1
menuitem "that they are suffering from bad PJ values." -1
menuitem "" -1
menuitem "Show scoreboard: TAB" -1
menuitem "Try it out!" -1
menuitem "" -1
menuitem "                   0Finish - 7/7" "paused 0; endmenuitem"

endmenuitem = [
	sleep 1000 [showscores 1]
	sleep 60000 dm ac_complex; endtutorial
]

