diff --git a/2.5DHero/2.5DHero/Overworld/OverworldScreen.vb b/2.5DHero/2.5DHero/Overworld/OverworldScreen.vb
index f2abb57b6..7a30911ee 100644
--- a/2.5DHero/2.5DHero/Overworld/OverworldScreen.vb
+++ b/2.5DHero/2.5DHero/Overworld/OverworldScreen.vb
@@ -81,6 +81,7 @@ Public Class OverworldScreen
End Set
End Property
+ Public Property GlobalGameModeScriptStarted As Boolean = False
#End Region
'''
@@ -143,6 +144,12 @@ Public Class OverworldScreen
''' Updates the OverworldScreen.
'''
Public Overrides Sub Update()
+ If GameModeManager.ActiveGameMode.StartScript <> "" AndAlso ActionScript.IsReady AndAlso Not GlobalGameModeScriptStarted Then
+ ActionScript.reDelay = 0.0F
+ ActionScript.StartScript(GameModeManager.ActiveGameMode.StartScript, 0)
+ GlobalGameModeScriptStarted = True
+ End If
+
'If the MapScript has a value loaded from the MapScript map tag and there is no script running, start that script:
If LevelLoader.MapScript <> "" And ActionScript.IsReady = True Then
ActionScript.reDelay = 0.0F
diff --git a/2.5DHero/2.5DHero/Resources/GameModeManager.vb b/2.5DHero/2.5DHero/Resources/GameModeManager.vb
index 4144b70ae..ba4895665 100644
--- a/2.5DHero/2.5DHero/Resources/GameModeManager.vb
+++ b/2.5DHero/2.5DHero/Resources/GameModeManager.vb
@@ -459,6 +459,8 @@ Public Class GameMode
End If
Case "startrotation"
Me._startRotation = CSng(Value.Replace(".", GameController.DecSeparator))
+ Case "startscript"
+ StartScript = Value
Case "startlocationname"
Me._startLocationName = Value
Case "startdialogue"
@@ -590,6 +592,7 @@ Public Class GameMode
"StartMap|" & Me._startMap & vbNewLine &
"StartPosition|" & Me._startPosition.X.ToString().Replace(GameController.DecSeparator, ".") & "," & Me._startPosition.Y.ToString().Replace(GameController.DecSeparator, ".") & "," & Me._startPosition.Z.ToString().Replace(GameController.DecSeparator, ".") & vbNewLine &
"StartRotation|" & Me._startRotation.ToString().Replace(GameController.DecSeparator, ".") & vbNewLine &
+ "StartScript|" & StartScript & vbNewLine &
"StartLocationName|" & Me._startLocationName & vbNewLine &
"StartDialogue|" & Me._startDialogue & vbNewLine &
"StartColor|" & Me._startColor.R & "," & Me._startColor.G & "," & Me._startColor.B & vbNewLine &
@@ -980,6 +983,11 @@ Public Class GameMode
End Set
End Property
+ '''
+ ''' The default gamemode boot up script.
+ '''
+ Public Property StartScript As String = ""
+
#End Region
Class GameRule