Duplicate your ENTIRE game folder, so that you have two versions of the same game. (I suggest you copy it to the desktop) Make a new folder, and name it the name of your game. cut and paste the duplicate gamemaker into that folder. rename it to "engine". (if you name it something else, you will have to modify the code i give you for it to work properly.) you now have game structure like this:
>Desktop>mygamename>engine
Now we need to remove all the maps that don't pertain to your game in any way. open up (in the duplicate game folder) packages>base> and delete EVERYTHING in there. this removes all the preloaded games. open up my_stuff>packages>base> and delete everything but your game. this will remove all but your game for playing. You are now done removing the other stuff. (If you know what you are doing, and are only here for tips, you can also delete all the textures and the models you aren't using at this point as well.)
I have been told that editing the keymap is NOT the way to go due to the fact that other modes (not FPS, which this tutorial is for) have different keys needed. IF you feel like ruining the other modes, and removing the games ability to detect certain key presses continue the next paragraph, otherwise, skip the next paragraph, and continue reading.
Next, we remove the user's ability to modify your game, COMPLETELY. first step: removing the editing shortcut keys. open up >mygamename>engine>data>keymap.cfg.cfg and search for these things:
101
96
47
these keys allow the user to enter code in-game, and to enter editmode. if you intend to edit this later, put two slashes in fron of the line the code is on. ex:
Code: Select all
//keymap 96 BACKQUOTE
And now, i will tell you the right way of completely removing the users ability to enter edit mode in the game. open up >mygamename>engine>data>defaults.cfg. search for
Code: Select all
bind E [
Code: Select all
//bind E [
// @nokeybind [edittoggle]//mostly universal :P
// @ctrlkeybind [if $editing showentgui]
// @shiftkeybind [showtexgui] //won't show unless $editing
// @bothkeybind [notepad (mapcfgname)]
You have now almost completely removed the users ability to edit the game in FPS. Now for the menus.
open up >mygamename>engine>data>lang>en>menus.cfg and search for "if (= $editing 1)" (without quotes.) You will come up with something that looks like this code:
Code: Select all
main = [
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 "Edit Materials" "showgui materials"
guibutton "Quickedit Menu (F3)" "showquickgui"
guibutton "Texture Menu (F2)" "showtexgui"
]
guibar
]
guilist [
guibutton "Toggle Editmode (e)" "edittoggle"
guibutton "Load Map" "showgui maps; MODE = (getmode); mode (getmode); initmapgui"
guibutton "Load Custom Map" "showgui loadmap"
guibutton "Multiplayer" "showgui multiplayer"
guibutton "Help" "showgui help"
guibar
guibutton "Options" "showgui options"
guibutton "Jukebox" "showgui jukebox"
guibutton "Change Skill Level" "showgui skilllvl"
guibutton "About" "showgui authors"
guibutton "Exit The Game" quit exit
]
]
]
Code: Select all
main = [
guilist [
guibutton "Toggle Editmode (e)" "edittoggle"
guibutton "Load Map" "showgui maps; MODE = (getmode); mode (getmode); initmapgui"
guibutton "Load Custom Map" "showgui loadmap"
guibutton "Multiplayer" "showgui multiplayer"
guibutton "Help" "showgui help"
guibar
guibutton "Options" "showgui options"
guibutton "Jukebox" "showgui jukebox"
guibutton "Change Skill Level" "showgui skilllvl"
guibutton "About" "showgui authors"
guibutton "Exit The Game" quit exit
]
]
Code: Select all
guibutton "Toggle Editmode (e)" "edittoggle"
Code: Select all
main = [
guilist [
guibutton "Play Game" "map mygamename"
]
guilist [
guibutton "Help" "showgui help"
]
guilist [
guibutton "Options" "showgui options"
]
guilist [
guibutton "Jukebox" "showgui jukebox"
]
guilist [
guibutton "Exit The Game" quit exit
]
]
go into the >mygamename>engine> and delete all the files. NOT THE FOLDERS. Don't worry, I will have the stuff you need in this tutorial. Now, create two files. one called mygamename.bat, and another simply called mygamename_unix. (change mygamename to the name of your game!) in the .bat file insert this code:
Code: Select all
engine\bin\sandbox_fps.exe -qengine\my_stuff -r %1 %2 %3 %4 %5
in the mygamname_unix file, insert this code: (You can ignore if all your game players use windows.)
Code: Select all
#!/bin/bash
#Sandbox directory is in the engine folder
SANDBOX_DIR=engine
#SANDBOX_OPTIONS="-r"
SANDBOX_OPTIONS="-qengine/.platinumarts -r"
case $(uname -m) in
i386|i486|i586|i686)
MACHINE_BIT=32
;;
*)
MACHINE_BIT=64 #assume 64bit otherwise
;;
esac
if [ -a ${SANDBOX_DIR}/bin/sandbox_client_${MACHINE_BIT}_fps ]
then
cd ${SANDBOX_DIR}
chmod +x ./bin/sandbox_??????_* #server and client are 6 characters; don't want to make the windows stuff executable
exec ./bin/sandbox_client_${MACHINE_BIT}_fps ${SANDBOX_OPTIONS} $*
else
echo "A problem was encountered, please check which of the following it is."
echo "1) There isn't an available executable for your architecture; $(uname -m)"
echo "2) the executable was moved"
echo "3) There isn't an executable"
echo "install the sdl, sdlimage and sdlmixer libs and try \"cd src && make install\" to compile a binary"
exit 1
fi
What if its not perfect? The menus aren't what i want, and when the game starts, it shows the basics of making a game, not playing mine! Heres how to fix those things:
First, you want to change the menu theme. go into >mygamename>engine>data>defaults.cfg and go to line number 8. (SO easy to find.) The code on that line looks like this:
Code: Select all
exec hud/2.3.cfg
Code: Select all
exec hud/ironfist.cfg
Code: Select all
newgui options [
guibutton "PG UP and PG DN as universal delta" [bind PAGEUP [universaldelta -1]; bind PAGEDOWN [universaldelta 1]]
if (= $skilllevel 3) [guibutton "Debuging Settings" "showgui debugsettings"]
guibutton "Set Language" "showgui language" $language
guilist [
guibutton "Modify GUI Colours" "showgui setguicol"
guibar
guistayopen [
guibutton "Reset Colours" guiresetcolours
]
]
guibutton "Console Messages" "showgui console"
guibutton "GUI themes" "showgui themes; initthemegui"
if (= $skilllevel 1) [
@options1
]
if (= $skilllevel 2) [
@options2
]
if (= $skilllevel 3) [
@options3
]
guitab "Resolution"
guicheckbox "Fullscreen" fullscreen
guitext "field of view (default: 100)"
guislider fov
guistayopen [
guilist [
guilist [
guibutton "320x240" "screenres 320 240" (if (&& (= $scr_w 320) (= $scr_h 240)) [result "radio_on"] [result "radio_off"])
guibutton "640x480" "screenres 640 480" (if (&& (= $scr_w 640) (= $scr_h 480)) [result "radio_on"] [result "radio_off"])
guibutton "800x600" "screenres 800 600" (if (&& (= $scr_w 800) (= $scr_h 600)) [result "radio_on"] [result "radio_off"])
guibutton "1024x768" "screenres 1024 768" (if (&& (= $scr_w 1024) (= $scr_h 768)) [result "radio_on"] [result "radio_off"])
guibutton "1152x864" "screenres 1152 864" (if (&& (= $scr_w 1152) (= $scr_h 864)) [result "radio_on"] [result "radio_off"])
guibutton "1280x960" "screenres 1280 960" (if (&& (= $scr_w 1280) (= $scr_h 960)) [result "radio_on"] [result "radio_off"])
]
guibar
guilist [
guibutton "1400x1050" "screenres 1400 1050" (if (&& (= $scr_w 1400) (= $scr_h 1050)) [result "radio_on"] [result "radio_off"])
guibutton "1600x1200" "screenres 1600 1200" (if (&& (= $scr_w 1600) (= $scr_h 1200)) [result "radio_on"] [result "radio_off"])
guibutton "1792x1344" "screenres 1792 1344" (if (&& (= $scr_w 1792) (= $scr_h 1344)) [result "radio_on"] [result "radio_off"])
guibutton "1856x1392" "screenres 1856 1392" (if (&& (= $scr_w 1856) (= $scr_h 1392)) [result "radio_on"] [result "radio_off"])
guibutton "1920x1440" "screenres 1920 1440" (if (&& (= $scr_w 1920) (= $scr_h 1440)) [result "radio_on"] [result "radio_off"])
guibutton "2048x1536" "screenres 2048 1536" (if (&& (= $scr_w 2048) (= $scr_h 1536)) [result "radio_on"] [result "radio_off"])
]
guibar
guilist [
guibutton "1024x640" "screenres 1024 640" (if (&& (= $scr_w 1024) (= $scr_h 640)) [result "radio_on"] [result "radio_off"])
guibutton "1280x720" "screenres 1280 720" (if (&& (= $scr_w 1280) (= $scr_h 720)) [result "radio_on"] [result "radio_off"])
guibutton "1280x768" "screenres 1280 768" (if (&& (= $scr_w 1280) (= $scr_h 768)) [result "radio_on"] [result "radio_off"])
guibutton "1280x800" "screenres 1280 800" (if (&& (= $scr_w 1280) (= $scr_h 800)) [result "radio_on"] [result "radio_off"])
guibutton "1440x900" "screenres 1440 900" (if (&& (= $scr_w 1440) (= $scr_h 900)) [result "radio_on"] [result "radio_off"])
guibutton "1600x1000" "screenres 1600 1000" (if (&& (= $scr_w 1600) (= $scr_h 1000)) [result "radio_on"] [result "radio_off"])
]
guibar
guilist [
guibutton "1680x1050" "screenres 1680 1050" (if (&& (= $scr_w 1680) (= $scr_h 1050)) [result "radio_on"] [result "radio_off"])
guibutton "1920x1080" "screenres 1920 1080" (if (&& (= $scr_w 1920) (= $scr_h 1080)) [result "radio_on"] [result "radio_off"])
guibutton "1920x1200" "screenres 1920 1200" (if (&& (= $scr_w 1920) (= $scr_h 1200)) [result "radio_on"] [result "radio_off"])
guibutton "2048x1280" "screenres 2048 1280" (if (&& (= $scr_w 2048) (= $scr_h 1280)) [result "radio_on"] [result "radio_off"])
guibutton "2560x1600" "screenres 2560 1600" (if (&& (= $scr_w 2560) (= $scr_h 1600)) [result "radio_on"] [result "radio_off"])
guibutton "3840x2400" "screenres 3840 2400" (if (&& (= $scr_w 3840) (= $scr_h 2400)) [result "radio_on"] [result "radio_off"])
]
]
]
guitab "Miscelaneous"
guilist [
guilist [
guicheckbox "2D menus" gui2d
guicheckbox "Click tab navigation" guiclicktab
guitext "Mouse Sensitivity "
]
guilist [
guicheckbox "Gui Errors " guierrors
guitext ""
newsens = $sensitivity
guifield newsens 5 [sensitivity $newsens]
]
]
guilist [
guitext "Loading Backgrounds "
guiradio "Off" loadbacktype 0
guibar
guiradio "Screenshots (default)" loadbacktype 1
guibar
guiradio "Map shots" loadbacktype 2
]
]
Code: Select all
guibutton "GUI themes" "showgui themes; initthemegui"
Code: Select all
guibutton "Modify GUI Colours" "showgui setguicol"
What about the start up GUIs? how do i edit/delete those? Its simple, when you know what to do. first, open up the file: >mygamename>engine>data>lang>en>menus.cfg and goto line number 1672 or search "newgui intro [". You should come up with the intro menu. Edit that, and refrain from changing the lines that include the username info. a barebones intro GUI would look like this:
Code: Select all
newgui intro [
guitext "We need your nickname to continue. Please put it in the box below, and press enter."
guibar
newname = (getname)
guifield newname 18 [name $newname]
guibar
guibutton "Play Game" "cleargui; showgui main"
]
If you find an error that would cause problems, or are having problems yourself, post a question, and i will attempt to help.