How To Execute Compiling Command And Run it

BlitzMax Forums/BlitzMax Beginners Area/How To Execute Compiling Command And Run it

Hardcoal(Posted 2012) [#1]
I want to make a command that execute BMK Makeapp and then runs it
from my Editor.

how do i do that please?


matibee(Posted 2012) [#2]
Do you really need to compile the game from the editor?

The usual and simplest route is to have the editor.exe reside next to the game.exe and the editor fires up the game with some command line switches to take you straight to the level you're working on (skipping start up menus etc etc).


Hardcoal(Posted 2012) [#3]
so how do you execute and exe from my editor?
what is the command or way?


matibee(Posted 2012) [#4]
From one of my old MaxGUI editor projects...

?Win32
Local app:String = "game.exe "
?
?MacOS
Local app:String = "game.app/Contents/MacOS/game "
?
Local launch:String = app + (levelID + 1)
TProcess.Create(launch,0)



Worked on win and mac, and passed the level number in as a command line argument.

The game code that checks for the command line argument looks like this..


'========================================================================================
' Dev mode enabled if the game is started with a level number argument (1-60)
'
Global DEV_MODE_LEVEL% = 0

' check for dev mode
If ( AppArgs.length > 1 )
	Local levelID:String = AppArgs[1]
	If ( Len ( levelID ) )
		DEV_MODE_LEVEL	= levelID.ToInt()
		If ( DEV_MODE_LEVEL < 1 Or DEV_MODE_LEVEL > 60 )
			DEV_MODE_LEVEL = 0
		End If 
	End If 
End If