Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- clearguis().
- global tutwnd is gui(550, 200).
- set tutwnd:x to -100.
- set tutwnd:y to 100.
- set state to 0.
- set lbl to tutwnd:addlabel().
- set lbl:style:fontsize to 26.
- tutwnd:show().
- set title_start to "<b><size=32>".
- set title_end to "</size></b>".
- set code_start to "<i><b><color=orange>".
- set code_end to "</color></b></i>".
- set botcmd_start to "<b><color=orange>".
- set botcmd_end to "</color></b>".
- brakes on.
- set steeringmanager:rollcontrolanglerange to 180.
- set lbl:text to title_start + "Welcome to Twitch Plays KSP!" + title_end + "
- You can type " + botcmd_start + "!help" + botcmd_end + " or " + botcmd_start + "!commands" + botcmd_end + " at any time.
- To launch a plane you need to do four things: lock throttle, lock steering, turn brakes off, and stage.
- Commands that start with " + code_start + "/me" + code_end + " are sent to the ship's flight computer and interpreted as KOS code.
- To lock throttle, type " + code_start + "/me lock throttle to 1" + code_end.
- set thisheading to choose 90 if vang(heading(90,0):vector,ship:facing:vector) < 45 else 0.
- when throttle > 0 then {
- set lbl:text to "Now you need to lock steering. By convention, we use <b>x</b> for compass heading and <b>p</b> for pitch.
- Type " + code_start + "/me set x to " + thisheading + code_end.
- set state to 1.
- }
- when state = 1 and defined x and x:istype("scalar") then {
- set lbl:text to "Now set p to control pitch. It's measured in degrees above the horizon.
- Type " + code_start + "/me set p to 5" + code_end.
- set state to 2.
- }
- when state = 2 and defined p and p:istype("scalar") then {
- set lbl:text to "Now that x and p have been setup, the tutorial program will execute the steering lock for you, in this case " + code_start + "lock steering to heading(x,p)." + code_end + "
- Almost ready - now release the brakes.
- Type " + code_start + "/me brakes off" + code_end.
- lock steering to heading(x, p).
- set state to 3.
- }
- when state = 3 and not brakes then {
- set lbl:text to "Finally turn on the engine.
- Type " + code_start + "/me stage" + code_end.
- set state to 4.
- }
- when state = 4 and ship:maxthrust > 0 then {
- set lbl:text to "Once you are airborne, retract the landing gear.
- Type " + code_start + "/me gear off" + code_end.
- set state to 5.
- }
- when state = 5 and not gear then {
- set lbl:text to title_start + "Congratulations!" + title_end + "
- You can change throttle, x, and p to control the plane as you like.".
- set donetime to time:seconds.
- set state to 6.
- }
- when state = 6 and time:seconds > donetime + 20 then {
- tutwnd:hide().
- tutwnd:dispose().
- }
- clearscreen.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement