Hi! Welcome to the forum for Platinum Arts Sandbox Free 3D Game Maker. I currently have the forums locked as I am attempting to properly update them.

In the meantime please join the new Discord Server!

If you have any questions please e-mail me through the Platinum Arts website.

Exporting Your game with PAS 2.5

Learn more on how to use Sandbox, or submit your own tutorials or resources.
Post Reply
User avatar
DaGeek247
Member
Member
Posts: 53
Joined: May 17th, 2010, 6:52 pm
Name: DaGeek247
IRC Username: DaGeek247
Location: sitting or standing when not laying down
Contact:

Exporting Your game with PAS 2.5

Post by DaGeek247 »

Well, you have a game you have made, and you want to "export" it. PAS itself does NOT have an export button (Im pretty dadgum sure it doesn't) so where do you start? The first part, is to set the game up for running. ( I might looking into making one... hmmm...)

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
if you don't intend for this to be edited later, simply delete the three lines. That is how you edit the keymap.

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 [
and simply put two slashes on all the code within the "[]" brackets. your end result will look like this:

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
		]
	]
]
remove the ENTIRE first part, so there is no difference from the editing menu, and non-editing menu. It will look like this:

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
		]
	]
next remove the

Code: Select all

guibutton "Toggle Editmode (e)"	"edittoggle"
so that the user now has absoloutly no way to enter edit mode in-game. change the whole thing so that it looks like this:

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
		]
]
and change mygamename to the actual name of the gamefile.ogz. (without the .ogz part) You now have a working game without the ability to go into edit mode, and on the menu, it loads your game directly. well, ALMOST... there are a few things you need to do. First, copy your game files to >mygamename>engine>packages>base> so that you actually have your game. don't add any .BAK files, as they are backups. all you need is the mygamename.ogz and the mygamename-art.cfg files. (If you created code for it, you also want mygamename.cfg) Now the game export is basicly done. You just need to add the gamestart files.

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
I had problems with this, but im hoping it was just my computer, because the unix version worked perfectly.

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
open up the _unix (or .bat file, depends on what OS you have) and test it out. double check to see if you can enter edit mode, and if the game loads properly when you click the menu button. you now have a completely exported game!

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
go into the >mygamename>engine>data>hud> folder, and choose what menu you want. i prefer the iron fist menu theme, so my code would look like this:

Code: Select all

exec hud/ironfist.cfg
If you created your own menu theme, you could put it here. If you don't want the user to change the theme via the opions menu, go into the >mygamename>engine>data>lang>en>menus.cfg and go to line number 990 or search "newgui options [". you should see this:

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
	]
]
find the line with this code:

Code: Select all

	guibutton "GUI themes" "showgui themes; initthemegui"
and

Code: Select all

		guibutton "Modify GUI Colours" "showgui setguicol"
and then delete it. there is now no way for the user to edit the themes short of editing the config files themeslves. (Its a pain without a tutorial like this one.) The user can no longer edit the theme.

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"
]
That code is the least you can have with a username. if you dont want this menu at all, delete the code, and never get a nickname from the user. good luck!

If you find an error that would cause problems, or are having problems yourself, post a question, and i will attempt to help.
If a packet hits a pocket on a socket on a port,
and the bus is interrupted as a very last resort,
and the address of the memory makes your floppy disk abort,
then the socket packet pocket has an error to report

DaGeek247 of http://dageek247.tk/
chocolatepie33
Support Team
Support Team
Posts: 2458
Joined: April 27th, 2010, 5:31 pm
IRC Username: CP

Re: Exporting Your game with PAS 2.5

Post by chocolatepie33 »

Wow, this a great (albeit confusing) tutorial, DG. So this is like publishing a game, almost?
Also, with the nickname part, I hope you know about the getname function, which takes a nickname and inserts it where needed in text... If you don't have one and the game uses the getname function, it would say Sandboxer, which may not be what was intended.
Julius wrote:Contribute to http://www.opengameart.org NOW!
Save the wiki!
User avatar
DaGeek247
Member
Member
Posts: 53
Joined: May 17th, 2010, 6:52 pm
Name: DaGeek247
IRC Username: DaGeek247
Location: sitting or standing when not laying down
Contact:

Re: Exporting Your game with PAS 2.5

Post by DaGeek247 »

Yes, its basicly publishing the game, at a basic level. The getname function, was what i was mentioning. if you never use it in your map, you can get rid of the menu completely.
If a packet hits a pocket on a socket on a port,
and the bus is interrupted as a very last resort,
and the address of the memory makes your floppy disk abort,
then the socket packet pocket has an error to report

DaGeek247 of http://dageek247.tk/
User avatar
Umbra
Restricted User
Posts: 8
Joined: January 7th, 2011, 4:48 pm
Name: Parx Shearer
Location: The realms of Ice and snow.
Contact:

Re: Exporting Your game with PAS 2.5

Post by Umbra »

That was great! :) I hope you post more tutorials in the future about upcoming versions. This was a lot of help. I want to publish some games, but I'm not sure I want to put them on the projects page yet. I will send my game to the projects page once I have finished with the variables. I know this page may be a little silent, but I hope every one hears about your tutorials. Good Luck!
-Parx-

I'm working on an RPG. Any help would be greatly helpful and will be recognized.
Thanks for your cooperation, (even though I was a little foolish in the past).
www.umbrawolf.com
Post Reply