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.

Start- and Endpoint, Gametime

Talk about anything related to Platinum Arts Sandbox here!
Locked
schoenbt
Member
Member
Posts: 3
Joined: July 19th, 2012, 2:00 am
Name: Torsten
IRC Username: B4shir

Start- and Endpoint, Gametime

Post by schoenbt »

Hello!
I'm working with sandbox a few days and it is getting better and better. But there are still a few questions left open:

1. How can i set an Endpoint as Level goal? (There should be a Startpoint (spawning) and an Endpoint (goal)). :?:
2. Is it possiple to get something like an output of the gametime/ playtime (time from start to endpoint) :?:

Greetings from cologne, germany! 8-)
Torsten
chocolatepie33
Support Team
Support Team
Posts: 2458
Joined: April 27th, 2010, 5:31 pm
IRC Username: CP

Re: Start- and Endpoint, Gametime

Post by chocolatepie33 »

First things first: what mode are you using, along with what version of Sandbox?
schoenbt wrote:1. How can i set an Endpoint as Level goal? (There should be a Startpoint (spawning) and an Endpoint (goal)).
Depends on what you want to happen when you reach the goal.
schoenbt wrote:2. Is it possiple to get something like an output of the gametime/ playtime (time from start to endpoint)
You can edit the .bat of the mode you're using, use the -g command to specify an output .txt file (example: -goutput.txt), and you could use programming to implement a loop that counts out time, then record that into the txt file. I don't know what you could do for multiple text files, however.
Julius wrote:Contribute to http://www.opengameart.org NOW!
Save the wiki!
schoenbt
Member
Member
Posts: 3
Joined: July 19th, 2012, 2:00 am
Name: Torsten
IRC Username: B4shir

Re: Start- and Endpoint, Gametime

Post by schoenbt »

Thank you for your reply, chocolatepie33!
I'm currently using Sandbox Beta 2.2 (1.3) in singleplayer mode.

schoenbt wrote:1. How can i set an Endpoint as Level goal? (There should be a Startpoint (spawning) and an Endpoint (goal)).

chocolatepie33 wrote: Depends on what you want to happen when you reach the goal.
If the player reaches the goal the game should end and the playtime should be stopped (like a maze).
schoenbt wrote:2. Is it possiple to get something like an output of the gametime/ playtime (time from start to endpoint)

chocolatepie33 wrote:You can edit the .bat of the mode you're using, use the -g command to specify an output .txt file (example: -goutput.txt), and you could use programming to implement a loop that counts out time, then record that into the txt file. I don't know what you could do for multiple text files, however.
Ah, ok - that could be an option but currently i'm using OSX and i'm not sure if it's possible to write a batch-file or to start sandbox with the "-g"-command (do you/ or anyone tried it out ?).

Greetings from cologne, germany! 8-)
Torsten
chocolatepie33
Support Team
Support Team
Posts: 2458
Joined: April 27th, 2010, 5:31 pm
IRC Username: CP

Re: Start- and Endpoint, Gametime

Post by chocolatepie33 »

schoenbt wrote:currently i'm using OSX
Oh no... Macs are such pains when it comes to Sandbox...

Since you're using such an old version, I'll assume that you're using FPS mode. Basically, what would happen is that you would have a numeric variable called "time" in your map. Once the player crosses the start line, a loop is triggered making "time" increase. Once the player crosses the finish line, a boolean (true/false) value, representing "map finished" (or something similar) would be switched to 1 (true), therefore stopping the loop, which is on if the boolean variable is not 1. From there, you can use the echo command to output the result to the output file.

As for editing the .bat file, I don't know much else on editing it, I don't even know what you use to launch Sandbox from a mac.
Julius wrote:Contribute to http://www.opengameart.org NOW!
Save the wiki!
User avatar
kddekadenz
Member
Member
Posts: 423
Joined: July 17th, 2011, 11:02 am
Name: kdd
Contact:

Re: Start- and Endpoint, Gametime

Post by kddekadenz »

schoenbt wrote: 1. How can i set an Endpoint as Level goal? (There should be a Startpoint (spawning) and an Endpoint (goal)). :?:
2. Is it possiple to get something like an output of the gametime/ playtime (time from start to endpoint) :?:
Here is the scriptlib of RJ. I'm too lazy to break it up for you. It includes answers for both questions.

Code: Select all

//enable sp

a = 0
sleep 0 [sp_on]

sp_on = [
    if (= $a 0) [
        sp;
        a = 1;
    ]
]


//settings

movespeed 100
jumpvel 100


//variables

//timer
	timer = [
		time = (format "%1 Seconds" $seconds)
 		seconds = (+ $seconds 1)
  		sleep 1000 [timer]
	]

	seconds = 0
	timer


//scoring

	collect_coin = [
 		coins = (+ $coins 1)
		coins = (format "%1 coins" $coins)
	]

coins = 0


//trigger

level_trigger_1 = [showgui win]

level_trigger_2 = [collect_coin; sound $coinsound]



newgui win [
	guitext (format "Congratulations %1, you made it!" (getname))
	guitext (format "You needed %1 seconds." (time))
	guitext (format "You collected %1 coins." (coins))
	guibar
	guilist [
		guibutton "[Next map]" "sp $nextmap"
		guibar
		guibutton "[Restart]" "restart"
		guibar
		guibutton "[Quit game]" "quit" 
	]
]


//cheats
toorich = 	[coins = (+ $coins 999)
		 coins = (format "%1 coins" $coins)
		echo "toorich - cheat was activated"
		]


//make common operations shorter - this saves a lot of time

restart = "sp"	//not really shorter, but logical

next = "sp $nextmap"

c_coin = "newent mapmodel 1 12 2"

c_apple = "newent mapmodel 3 12 2"

c_fin = "newent mapmodel -1 7 1"

c_tele = "newent teleport 0 2"

c_jump = "newent mapmodel 0"


//debugging

d_score = [echo (format "You have %1 coins." (coins))]

d_time = [echo (format "%1 seconds" (time))]


//sounds

coinsound = (registersound rj/coin 255)


//textures

exec "packages/rj/textures.cfg"


//models

exec "packages/rj/models.cfg"


//music

playasong = [ music (concatword "autotracker/music" (+ 1 (rnd 8)) ".ogg") playasong ]
playasong
Kelgar is an advanced RPG beeing developed in Sandbox
rydion_dev
Member
Member
Posts: 20
Joined: August 30th, 2012, 9:43 am
Location: Great Britain

Re: Start- and Endpoint, Gametime

Post by rydion_dev »

Can "Gametime" be implemented into a track racing game with multiple laps? If so, how? If not, what is the best alternative?
Freelance PAS user good at building RPG maps and designing interiors. Hates texturing though...
rydion_dev wrote:This doesn't cut any mustard at all, I'm afraid. It barely cuts tomato sauce!
User avatar
kddekadenz
Member
Member
Posts: 423
Joined: July 17th, 2011, 11:02 am
Name: kdd
Contact:

Re: Start- and Endpoint, Gametime

Post by kddekadenz »

I think so. I'm not sure about the KRS scripting stuff, but I think it is similar to the old FPS mode.
Kelgar is an advanced RPG beeing developed in Sandbox
chocolatepie33
Support Team
Support Team
Posts: 2458
Joined: April 27th, 2010, 5:31 pm
IRC Username: CP

Re: Start- and Endpoint, Gametime

Post by chocolatepie33 »

Last I checked, there wasn't scripting for krs.
Julius wrote:Contribute to http://www.opengameart.org NOW!
Save the wiki!
Locked