Exporting your game in PAS 2.6 (and 2.6.1)
Posted: December 5th, 2010, 1:03 pm
I made a tut for exporting your game in PAS 2.5, now its for the next version. It's a little complicated, but the end result is a game with out edit mode, menus that open up your game directly, and a few other modifications as well. good luck!
This tutorial is the basics (+ Some) on how to make your game available for download. If you have a website, and made a cool game, follow this tutorial, then all your users need to do is download, and press play game. If you made a random game that took you thirty minutes, i suggest you dont do this, because it may take up to thirty minutes to do this tutorial.
Requirements:
This tutorial
PAS 2.6 or PAS 2.6.1
A working Brain
Preparing PAS for Exporting
First step. DUPLICATE PAS 2.6. This is important, as some changes made may be irreversible, and you want a falback just in case. I suggest you copy the game maker to your desktop, since that will make things easier. Make a new folder, called "mygame". (mygame = the name of the game you are exporting) Cut and paste the duplicate of PAS 2.6 into that folder, and rename it to "engine" Your folder structure will look like this: Desktop>mygame>engine>. That is good. Delete ALL the files, NOT THE FOLDERS, in the engine folder. You now have the engine folder empty, save for the folders. If you delete the folders, you will have to start this tutorial over again. The folders in the "engine" folder contain the gamemaker itself, while the files in the "engine" folder merely start it. Next, create two files: "mygamename_run.bat" and "mygamename_run.sh" in the "mygame" Desktop>mygame> folder. of course, change mygamename to the name of your game.
Place this code in the "mygamename_run.bat" file:
and put this code in the "mygamename_run.sh" file:
That creates the launchers for the gamemaker. Next, You need to remove all the game files you DONT want the user to access. Go into mygame>engine>packages>base> and delete everything in that folder. There should be nothing in there. Then go and get you game files and copy them into that folder. You will need two file, mygame-art.cfg and mygame.ogz. If you created any code for it, you will also need mygame.cfg. You now are ready for the next major step:
Editing Menus To fit Game:
You have set the PAS duplicate, so that it is no longer duplicate, and you can now actually start Working on the insides of PAS. In this section of the tutorial, I will go through the basics of editing the menus, so you can have it run your game directly from PAS, and not have select and load a map. First off, open >mygame>engine>data>fps>menus.cfg
This will edit all the menus of the FPS game. I have almost no experiance with RPG, or any other game type, so this tutorial in turn is for FPS mode only as well. The first part you will want to edit is on line number four. This menu, is the intro menu you see everytime the gamemaker start for the first time. Edit line number four through line number 82 to your hearts content. IT can be deleted, changed up, rearanged, or what ever you want. I do suggest that you keep the part including the nickname, as that stores a map variable with the users nickname. If you have no idea what im talking about here, i suggest you remove line number 4 through 82, and replace it with this code:
Next, You might want to actually edit the menus, so go to mygame>engine>data>menus.cfg. go to line number 611, or search for "main = [". You should come up with the main menu. remove
so that the editing menu, and the non-editng menu are the same. Now, the other part of the menu can be modified. First, remove the button that toggles editmode in the game mker, by deteing so that the user can now only enter editmode in-game via the "E" key, and typeing "/edittoggle" in game. we will fix that in th enext section. Change the remaining menu code, so that it looks like this:
change "mygame" to the EXACT name of your game so that it will load it directly. The menu will now look very simple, but thats okay. One more thing you need to change before you are ready to remove edit mode. When you click exit, it shows an "are you sure you want to leave screen". This is fine, but it also mentions that you can save your map. the users aren't supposed to edit the map, so we are gonna change this. go into >mygame>engine>data>menus.cfg, and go to line 598, or search for "newgui quit [". edit this to suit your wants, or change it to this:
You are now ready to completely remove editmode for the user to use.
Removing Editmode:
You have already started on removing editmode from the menus, but now your are ready to get rid of it completely. There are two methods. One that an admin, I wont say his nick (Hirato) says that editing them is bad and destructive. I disagree. IF you understand and know the risks included. The first method, requires editing the keybinds, so that there are simply no keys that allow editmode. This can be good, if you want to completely remove the game's ability to use those keys. It generally isn't. You can edit/remove the keybinds by going to >mygame>engine>data>kaymap.cfg. if you want to remove the editmode keys, go to lines 28, 51, 56, and put two slashes in front of those lines. dont delete, as they might be wanted later.
to properly remove the editing keys from your game, go into >mygame>engine>data>dafaults.cfg. Got to line 337, or search "bind BACKQUOTE [". line 337 to line 348 contains all the keys for editing. The first two binds allow the user to enter code into the game. if you dont want them to do that, then backslash it all. (looks like below:)\if you want the user to be able to enter only certain code, then your out of luck here. I have NO idea how to do that. This just removes the abaility to enter code in-game. the last bind is the "e" bind. It, when used, toggles editmode. You can change to do whatever you want, like make it say funny things like this:
or you can simply backslash it all, so that entering editmode in-game is impossible. If this does not immediatly work, you need to delete the config_fps.cfg file to reset.
Removing editmode from the game is fairly quick, and easy to understand if you have any coding experiance. (be it C, or VB, it counts.) You have now succesfuly exported your game in PAS 2.6 Tell me about problems, correcctions, or asnything i else, and i will do me best to help out. Good luck!
This tutorial is the basics (+ Some) on how to make your game available for download. If you have a website, and made a cool game, follow this tutorial, then all your users need to do is download, and press play game. If you made a random game that took you thirty minutes, i suggest you dont do this, because it may take up to thirty minutes to do this tutorial.
Requirements:
This tutorial
PAS 2.6 or PAS 2.6.1
A working Brain
Preparing PAS for Exporting
First step. DUPLICATE PAS 2.6. This is important, as some changes made may be irreversible, and you want a falback just in case. I suggest you copy the game maker to your desktop, since that will make things easier. Make a new folder, called "mygame". (mygame = the name of the game you are exporting) Cut and paste the duplicate of PAS 2.6 into that folder, and rename it to "engine" Your folder structure will look like this: Desktop>mygame>engine>. That is good. Delete ALL the files, NOT THE FOLDERS, in the engine folder. You now have the engine folder empty, save for the folders. If you delete the folders, you will have to start this tutorial over again. The folders in the "engine" folder contain the gamemaker itself, while the files in the "engine" folder merely start it. Next, create two files: "mygamename_run.bat" and "mygamename_run.sh" in the "mygame" Desktop>mygame> folder. of course, change mygamename to the name of your game.
Place this code in the "mygamename_run.bat" file:
Code: Select all
bin\sandbox_fps.exe -qengine\my_stuff -r %1 %2 %3 %4 %5
Code: Select all
#!/bin/bash
# SANDBOX_DIR should refer to the directory in which sandbox is placed.
#SANDBOX_DIR=~/sandbox
#SANDBOX_DIR=/usr/local/sandbox
SANDBOX_DIR=engine
SANDBOX_OPTIONS=""
SANDBOX_MODULE="fps"
SANDBOX_HOME="my_stuff_unix"
SANDBOX_TYPE="client"
SANDBOX_PREFIX="sandbox"
SANDBOX_EXEC="eval"
while [ $# -ne 0 ]
do
case $1 in
"-h"|"-?"|"-help"|"--help")
echo "Launching Game..."
exit 1
;;
esac
tag=$(expr substr "$1" 1 2)
argument=$(expr substr "$1" 3 1022)
case $tag in
"-g")
SANDBOX_MODULE=$argument
;;
"-q")
SANDBOX_HOME="\"$argument\""
;;
"-k"|"-i"|"-m"|"-r"|"-l"|"-x")
SANDBOX_OPTIONS+=" $tag\"$argument\""
;;
"--")
case $argument in
"server")
SANDBOX_TYPE="server"
;;
"master")
SANDBOX_TYPE="master"
;;
"debug")
SANDBOX_PREFIX="debug"
SANDBOX_EXEC="gdb --args"
;;
esac
;;
*)
SANDBOX_OPTIONS+=" $1"
;;
esac
shift
done
case $(uname -m) in
i386|i486|i586|i686)
MACHINE_BIT=32
;;
*)
MACHINE_BIT=64 #assume 64bit otherwise
;;
esac
function failed {
echo ""
echo "A problem was encountered, please check which of the following it is."
echo "1) there's no ${SANDBOX_TYPE} for module ${SANDBOX_MODULE}"
echo "2) There isn't an available executable for your architecture; $(uname -m)"
echo "3) the executable was moved"
echo "please make sure that ${SANDBOX_DIR}/bin/${SANDBOX_PREFIX}_${SANDBOX_TYPE}_${MACHINE_BIT}_${SANDBOX_MODULE} exists. If it doesn't..."
echo "install the sdl, sdl-image and sdl-mixer DEVELOPMENT libraries and use \"make -C ${SANDBOX_DIR}/src install\" to compile a binary"
echo ""
exit 1
}
cd ${SANDBOX_DIR}
chmod +x ./bin/sandbox_*
case ${SANDBOX_TYPE} in
"client")
if [ -a bin/${SANDBOX_PREFIX}_client_${MACHINE_BIT}_${SANDBOX_MODULE} ]
then
${SANDBOX_EXEC} ./bin/${SANDBOX_PREFIX}_client_${MACHINE_BIT}_${SANDBOX_MODULE} -q${SANDBOX_HOME} -r ${SANDBOX_OPTIONS}
else
failed
fi
;;
"server")
if [ -a bin/${SANDBOX_PREFIX}_server_${MACHINE_BIT}_${SANDBOX_MODULE} ]
then
${SANDBOX_EXEC} ./bin/${SANDBOX_PREFIX}_server_${MACHINE_BIT}_${SANDBOX_MODULE} -q${SANDBOX_HOME} ${SANDBOX_OPTIONS}
else
failed
fi
;;
"master")
if [ -a bin/${SANDBOX_PREFIX}_master ]
then
${SANDBOX_EXEC} ./bin/${SANDBOX_PREFIX}_master
else
failed
fi
;;
esac
Editing Menus To fit Game:
You have set the PAS duplicate, so that it is no longer duplicate, and you can now actually start Working on the insides of PAS. In this section of the tutorial, I will go through the basics of editing the menus, so you can have it run your game directly from PAS, and not have select and load a map. First off, open >mygame>engine>data>fps>menus.cfg
This will edit all the menus of the FPS game. I have almost no experiance with RPG, or any other game type, so this tutorial in turn is for FPS mode only as well. The first part you will want to edit is on line number four. This menu, is the intro menu you see everytime the gamemaker start for the first time. Edit line number four through line number 82 to your hearts content. IT can be deleted, changed up, rearanged, or what ever you want. I do suggest that you keep the part including the nickname, as that stores a map variable with the users nickname. If you have no idea what im talking about here, i suggest you remove line number 4 through 82, and replace it with this code:
Code: Select all
newgui intro [
guitext "This is your first time playing. Please enter your"
guitext "chosen nickname in the text box below, and press Continue."
guibar
newname = (getname)
guifield newname 18 [name $newname]
guibutton "Continue" "cleargui; showgui main"
]
Code: Select all
guilist [
if (= $editing 1) [
guilist [
guibutton "Newmap" "showgui newmap"
guibutton "Savemap" "showgui savemap"
guibar
guibutton "New particle" "showgui newparticles"
guibutton "New light" "showgui newlight"
guibutton "New Mapmodel" "showgui mapmodels"
guibutton "Find Entities (F5)" "showgui entfind"
guibutton "Editing GUI" "showgui editing"
guibutton "Skybox menu (F4)" "showgui skies"
guibutton "Edit Materials" "showgui materials"
guibutton "Quickedit Menu (F3)" "showquickgui" "menu"
guibutton "Texture Menu (F2)" "showtexgui" "menu"
]
guibar
]
Code: Select all
guibutton "Toggle Editmode (e)" "edittoggle"
Code: Select all
main = [
guilist [
guibutton "Play Game" "map cubemaze2"
]
guilist [
guibar
]
guilist [
guibutton "Options" "showgui options"
]
guilist [
guibutton "Movie Recorder" "showgui recorder"
]
guilist [
guibutton "Jukebox" "showgui jukebox"
]
guilist [
guibar
]
guilist [
guibutton "Exit The Game" [ if $mainmenu [quit] [showgui quit]] exit
]
]
Code: Select all
newgui quit [
guitext "Are you certain you wish to quit?"
guistrut 1
guistrut 1
guilist [
guibutton "No, don't quit" "cleargui 1"
guistrut 20
guibutton "Yes, Quit." "quit" exit
]
]
Removing Editmode:
You have already started on removing editmode from the menus, but now your are ready to get rid of it completely. There are two methods. One that an admin, I wont say his nick (Hirato) says that editing them is bad and destructive. I disagree. IF you understand and know the risks included. The first method, requires editing the keybinds, so that there are simply no keys that allow editmode. This can be good, if you want to completely remove the game's ability to use those keys. It generally isn't. You can edit/remove the keybinds by going to >mygame>engine>data>kaymap.cfg. if you want to remove the editmode keys, go to lines 28, 51, 56, and put two slashes in front of those lines. dont delete, as they might be wanted later.
to properly remove the editing keys from your game, go into >mygame>engine>data>dafaults.cfg. Got to line 337, or search "bind BACKQUOTE [". line 337 to line 348 contains all the keys for editing. The first two binds allow the user to enter code into the game. if you dont want them to do that, then backslash it all. (looks like below:)
Code: Select all
//bind BACKQUOTE [
// @nokeybind [saycommand "/"]
//]
//bind SLASH [
// @nokeybind [saycommand "/"]
//]
Code: Select all
bind E [
@nokeybind [echo "GURRL"]
@ctrlkeybind [echo "HAAY"]
@shiftkeybind [echo "Pffft, The user will never see this."] //won't show unless $editing
@bothkeybind [echo "OOH, Gurl, I just got my nails did!"]
]
Removing editmode from the game is fairly quick, and easy to understand if you have any coding experiance. (be it C, or VB, it counts.) You have now succesfuly exported your game in PAS 2.6 Tell me about problems, correcctions, or asnything i else, and i will do me best to help out. Good luck!