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 in PAS 2.6 (and 2.6.1)

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 in PAS 2.6 (and 2.6.1)

Post by DaGeek247 »

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 :P


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
and put this code in the "mygamename_run.sh" file:

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
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:

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"
]
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

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
		]
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

Code: Select all

			guibutton "Toggle Editmode (e)"	"edittoggle"
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:

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
	]
]

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:

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
	]
]
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:)

Code: Select all

//bind BACKQUOTE [
//	@nokeybind [saycommand "/"]
//]
//bind SLASH [
//	@nokeybind [saycommand "/"]
//]
\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:

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!"]
]
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!
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
BlackGulf
Member
Member
Posts: 127
Joined: August 28th, 2011, 5:07 pm
Name: Trevor
IRC Username: BlackGulf
Location: Stalkin' Your Mom
Contact:

Re: Exporting your game in PAS 2.6 (and 2.6.1)

Post by BlackGulf »

this work for 2.7 also
Image

Current Project
The Adventures Of NotaPig

Models Image
Maps Image
Coding Image
Textures Image
Music and SFX Image

In Need Of Staff.
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 in PAS 2.6 (and 2.6.1)

Post by DaGeek247 »

Thanks for checking that out. My next step is to make a "Base Sandbox" with just the engine and a few others. Then you can add your game and its files to that instead of exporting.
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 in PAS 2.6 (and 2.6.1)

Post by chocolatepie33 »

DaGeek247 wrote:My next step is to make a "Base Sandbox" with just the engine and a few others.
I believe jSoft is already working on his version of that, but it's middleware, so I believe it does have content... Anyways, this sounds like a pretty good idea, except for the fact that map-art.cfgs include ALL textures, not just only the ones you used. How would that be fixed?
Julius wrote:Contribute to http://www.opengameart.org NOW!
Save the wiki!
Hirato
Developer
Developer
Posts: 689
Joined: May 30th, 2009, 1:23 pm
IRC Username: hirato

Re: Exporting your game in PAS 2.6 (and 2.6.1)

Post by Hirato »

chocolatepie33 wrote:Anyways, this sounds like a pretty good idea, except for the fact that map-art.cfgs include ALL textures, not just only the ones you used. How would that be fixed?
There's a cullart command that will reduce the amount of texture definitions significantly, you may need to use compactvslots afterwards to get rid of the vslots
This is not a url, clicking it is pointless
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 in PAS 2.6 (and 2.6.1)

Post by DaGeek247 »

As of yet, it is only an idea. It would only include the gui stuff, and the engine. No textures, no models. Those would need to be added by the user.

Or maybe I could remove most of the stuff, and keep only the basics such as the player models... Im not sure, but either way the user will need to add the stuff used in his maps.
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
Mike
Administrator
Administrator
Posts: 871
Joined: May 24th, 2009, 12:52 pm

Re: Exporting your game in PAS 2.6 (and 2.6.1)

Post by Mike »

Thank you for doing this tutorial :D
Sign up for our Newsletter to keep up to date with the Sandbox news!
We also have a facebook page, facebook group, myspace page and a twitter page[/b][/color]!
chocolatepie33
Support Team
Support Team
Posts: 2458
Joined: April 27th, 2010, 5:31 pm
IRC Username: CP

Re: Exporting your game in PAS 2.6 (and 2.6.1)

Post by chocolatepie33 »

DaGeek247 wrote:As of yet, it is only an idea. It would only include the gui stuff, and the engine. No textures, no models. Those would need to be added by the user.

Or maybe I could remove most of the stuff, and keep only the basics such as the player models... Im not sure, but either way the user will need to add the stuff used in his maps.
That sounds good... the only problem is that the user may not know what stuff they'll need... I think the "add all first, remove later" idea makes sense, because it gives you a wide range of textures and such to choose from. Then you can remove what you don't need.
Julius wrote:Contribute to http://www.opengameart.org NOW!
Save the wiki!
justinyd
Member
Member
Posts: 2
Joined: September 21st, 2012, 9:22 am
Name: Justin

Re: Exporting your game in PAS 2.6 (and 2.6.1)

Post by justinyd »

Has anyone tried to automate this process with a script? Is that even possible? What would be the most tricky part?
Thanks!
justinyd
Member
Member
Posts: 2
Joined: September 21st, 2012, 9:22 am
Name: Justin

Re: Exporting your game in PAS 2.6 (and 2.6.1)

Post by justinyd »

Has anyone tried to automate this process with a script? Is that even possible? What would be the most tricky part?
Thanks!
Post Reply