What did You achieve today........

Miscellaneous Forums/General Discussion/What did You achieve today........

Today,
I made some progress in my game's GUI, which now resizes itself perfectly no matter what resolution the game is running at.

Yesterday, I got my script compiler/VM to compile and run this script flawlessly in a training mission for my tank game:
Game_AllowTankSwapping(False)
Game_AllowBaseCapture(False)

Local tank:Int

tank = Tank_Add("Light Tank", "American", 824, 1224)
Tank_SetFreeze(tank, True, True)
SetPlayerTank(tank)

Message "Welcome to Tank Combat Training."
Delay 3000

Message ""
Message "In this course, you will learn how"
Message "to control your tank and engage in"
Message "combat with other tanks."
Delay 4000

Message ""
Message "The tank you will be using for this"
Message "excercise is an M4 Sherman tank."
Delay 3000

Message ""
Message "As with any tank, you drive the M4"
Message "Sherman with the arrow keys or W/A/S/D"
Message "keys (depending on your preferance)."

Delay 1000
Message ""
Message "Try driving your tank around."

Tank_SetFreeze(tank, False, True)

Local x:Float, z:Float, dist:Float
Local cnt:Int
x = Tank_X(tank)
z = Tank_Z(tank)
Repeat
  dist = Abs(Tank_X(tank) - x) + Abs(Tank_Z(tank) - z)
  Delay 1000

  cnt = cnt + 1
  If cnt = 6 Then
    Message ""
    Message "Come on, try driving around."
  EndIf
  If cnt = 10 Then
    Message ""
    Message "Press the up arrow key to move forward."
  EndIf
  If cnt = 14 Then
    Message ""
    Message "You're still not moving. What is wrong?"
  EndIf
  If cnt = 16 Then
    Message ""
    Message "COME ON!!!"
  EndIf
Until dist > 1

If cnt >= 6 THen
  Message ""
  Message "That's right."
EndIf

Delay 6000

Message ""
Message "Okay, that's enough."

Delay 1000

Tank_SetFreeze(tank, True, True)

Delay 1000

Message ""
Message "Now, to fire your tank's cannon,"
Message "simply aim with the mouse, and press"
Message "the left mouse button."

Tank_SetFreeze(tank, True, False)

Delay 8000

Message ""
Message "Note: If you hold down the mouse"
Message "button, the cannon will fire as soon"
Message "as it has reloaded."

Delay 5000

Tank_SetFreeze(tank, True, True)

Message ""
Message "Good. Now you will be given a chance"
Message "to practice shooting. If you look"
Message "around, you should see 2 tank targets."
Message "Destroy both of them."
Message ""

Tank_SetFreeze(tank, False, False)

Local target1:Int, target2:Int
target1 = Tank_Add("Light Tank", "German", Tank_X(tank) - 80, Tank_Z(tank))
target2 = Tank_Add("Light Tank", "German", Tank_X(tank) - 80, Tank_Z(tank) + 20)
Tank_SetFreeze(target1, True, True)
Tank_SetFreeze(target2, True, True)

While Tank_Exists(target1) And Tank_Exists(target2)
  Delay 0
Wend

Message ""
Message "Nice shot. You may have noticed that at"
Message "long distances, your tank's bullets begin"
Message "to fall. With practice you can learn to"
Message "compensate for this, and hit targets at"
Message "very long ranges."

While Tank_Exists(target1) Or Tank_Exists(target2)
  Delay 0
Wend

Message ""
Message "Good job. Now, you should be ready to"
Message "start practicing combat with real tanks."

Delay 6000

target1 = Tank_Add("Light Tank", "German", Tank_X(tank) + 0, Tank_Z(tank) + 100)
AI_SetWaypoint(target1, Tank_X(tank), Tank_Z(tank))

Message ""
Message "There is now an enemy tank in the area."
Message "Try to destroy him before he destroys you."

Delay 3000

Message ""
Message "It usually helps to keep moving to avoid"
Message "being hit, although it may make aiming more"
Message "difficult."

Repeat
  While Tank_Exists(target1) And Tank_Exists(tank)
    Delay 0
  Wend

  If Tank_Exists(tank) = False Then
    Local msg:Int
    msg = msg + 1

    Select msg
    Case 1:
      Message ""
      Message "Your tank has been destroyed. Fortunately,"
      Message "this is only a simulation, and you can try"
      Message "again."
    Case 2:
      Message ""
      Message "Keep trying. You'll get him eventually."
    Case 3:
      Message ""
      Message "Keep practicing."
    EndSelect

    Delay 3000
    tank = Tank_Add("Light Tank", "American", Tank_X(target1), Tank_Z(Target1) - 150)
    SetPlayerTank(tank)
  Else
    Exit
  EndIf
Forever

Message ""
Message "Excellent! Now, for your final test, you must"
Message "help destroy 10 enemy tanks with only 4 friendly"
Message "tanks to help you."

Delay 5000

Message ""
Message "You tank will be upgraded to an M10 Wolverine."
Message "It is a little slower than the M4, although"
Message "the M10 is much tougher and more powerful."

Delay 3000

x = Tank_X(tank)
z = Tank_Z(tank)
Tank_Explode(tank)
tank = Tank_Add("Medium Tank", "American", x, z)
SetPlayerTank(tank)

Delay 2000

Message ""
Message "Get ready!"

x = Tank_X(tank)
z = Tank_Z(tank)

Local t:Int
t = Tank_Add("Medium Tank", "American", x-40, z+30); Tank_SetRank(t, RANK_SERGEANT)
t = Tank_Add("Heavy Tank", "American", x-20, z-30); Tank_SetRank(t, RANK_FIRST_LIEUTENANT)
Tank_Say(t, "Backup has arrived, " + Tank_LastName(tank) + ".")
t = Tank_Add("Heavy Tank", "American", x, z+30); Tank_SetRank(t, RANK_CAPTAIN)
t = Tank_Add("Medium Tank", "American", x+20, z-30); Tank_SetRank(t, RANK_CORPORAL)

Delay 4000

Tank_Say(t, "I'll watch for enemy tanks.")

Delay 3000

Tank_Say(t, "There they are!")

x = Tank_X(tank)
z = Tank_Z(tank)

t = Tank_Add("Light Tank", "German", x+80, z-200); Tank_SetRank(t, RANK_PRIVATE)
t = Tank_Add("Light Tank", "German", x+60, z+200); Tank_SetRank(t, RANK_PRIVATE)
t = Tank_Add("Light Tank", "German", x+40, z-200); Tank_SetRank(t, RANK_PRIVATE)
t = Tank_Add("Medium Tank", "German", x+20, z+200); Tank_SetRank(t, RANK_MAJOR)
t = Tank_Add("Light Tank", "German", x, z-100); Tank_SetRank(t, RANK_PRIVATE)
t = Tank_Add("Light Tank", "German", x-20, z-200); Tank_SetRank(t, RANK_PRIVATE)
t = Tank_Add("Light Tank", "German", x-40, z+200); Tank_SetRank(t, RANK_CORPORAL)
t = Tank_Add("Light Tank", "German", x-60, z-200); Tank_SetRank(t, RANK_PRIVATE)
t = Tank_Add("Light Tank", "German", x-80, z+200); Tank_SetRank(t, RANK_CORPORAL)
t = Tank_Add("Light Tank", "German", x-100, z-200); Tank_SetRank(t, RANK_SERGEANT)

While Tank_Exists(tank) And Team_Tanks("German") > 0
  Delay 1000
Wend

If Tank_Exists(tank) Then
  Message ""
  Message "Congratulations! You have successfully"
  Message "completed Tank Combat Training. You are now"
  Message "qualified for tank combat."

  Game_Victory()
Else
  Message ""
  Message "You have failed the Tank Combat Training test."
  Message "Please try again later.

  Game_Defeat()
EndIf