Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / save and load feature plus fps x10 to dbpro questions

Author
Message
kuljot
15
Years of Service
User Offline
Joined: 2nd Jan 2009
Location: sacramneto, ca united states
Posted: 10th May 2009 09:20
Ok guys i read the tutroial about saving games. i know i would get the players position x#,Y#,z#. then i write that to file as float. also i know how to read that. But to posiiton that object where it left off after saving last time would i simply just go position object x#,y#,z# after reading the file.
Also i know you can export fpsc maps into dbpro but can you export fps x10 maps into dbpro. if you can can you please post link on how to do this.

Gateway GT5628 Quad Core Desktop Intel Core 2 Q6600 2.4GHz Quad Core 3072MB RAM / 500GB 7200 SATA II Hard drive DVD RW 18X multi dual NVIDIA GeForce 8500GT ....
Veron
18
Years of Service
User Offline
Joined: 22nd Nov 2006
Location:
Posted: 10th May 2009 10:27
For loading FPSC maps, you load the universe.dbo file. If X10 also exports levels into a universe.dbo file, then one would assume that DBP can load them fine as well.

To position the player at the position that it was at when the game was saved, i'd do this:

1. When the user presses the save button
a) Get the player position
b) Save the player position to a file

2. When the player presses the load game button
a) Open up the file that is written to when saving the game
b) Extract all the info out of it and place the info into the usual variables

kuljot
15
Years of Service
User Offline
Joined: 2nd Jan 2009
Location: sacramneto, ca united states
Posted: 10th May 2009 18:52 Edited at: 10th May 2009 22:02
Thanks vernon. i still need further help. like for the last step to extract the info and use it to posiiton the player how would i code it. also can someone give me a link to the fpsc export to dbpro tutorial. i saw in once but i cant find the link anymore.

Gateway GT5628 Quad Core Desktop Intel Core 2 Q6600 2.4GHz Quad Core 3072MB RAM / 500GB 7200 SATA II Hard drive DVD RW 18X multi dual NVIDIA GeForce 8500GT ....
bobbel
15
Years of Service
User Offline
Joined: 5th Jan 2009
Location: In my DBPro case xD
Posted: 11th May 2009 08:23 Edited at: 11th May 2009 08:31
reading strings out of a file, you can learn that out of the manual (F1) what you have to do, is that the x position is always on the first line, the y on the second and the z on the third. that makes it easier to extract the values. how reading and writing works, i have no idea. but if you store them as floats, i think you should use "Read float" command

EDIT: What you also could do is use the command save array and put the x in 0, y in 1, and z in 2, then you can just say load array and you have easy acces to all the variables!

(\__/)
(O.o )
(> < ) This is Bunny. Copy Bunny into your signature to help him on his way to world domination!
Veron
18
Years of Service
User Offline
Joined: 22nd Nov 2006
Location:
Posted: 11th May 2009 09:50
#1 - the name is Veron.
As for the tutorial, it was either newsletter 36 or 37 from memory.

bobbel
15
Years of Service
User Offline
Joined: 5th Jan 2009
Location: In my DBPro case xD
Posted: 11th May 2009 16:18
You did not say anything about the arrays!1!1!!!!!111!1!1!!!

(\__/)
(O.o )
(> < ) This is Bunny. Copy Bunny into your signature to help him on his way to world domination!
kuljot
15
Years of Service
User Offline
Joined: 2nd Jan 2009
Location: sacramneto, ca united states
Posted: 12th May 2009 01:11 Edited at: 12th May 2009 07:54
Sorry veron i wasnt paying attention when i looked at ure name sorry once again, Hey bobbel can you give me example code to how that would work. or if anybody else could. write now i can save the objects positon and read it again, but i dont know how to use whats its read. thats what i need help with. Thanks in advance

Gateway GT5628 Quad Core Desktop Intel Core 2 Q6600 2.4GHz Quad Core 3072MB RAM / 500GB 7200 SATA II Hard drive DVD RW 18X multi dual NVIDIA GeForce 8500GT ....
bobbel
15
Years of Service
User Offline
Joined: 5th Jan 2009
Location: In my DBPro case xD
Posted: 12th May 2009 09:25 Edited at: 12th May 2009 09:26
this should work, but i never worked with load and save array before



And when you see this, you may realize you can put much more variables in there, like ammo, HP, GP, etc, etc,

(\__/)
(O.o )
(> < ) This is Bunny. Copy Bunny into your signature to help him on his way to world domination!
kuljot
15
Years of Service
User Offline
Joined: 2nd Jan 2009
Location: sacramneto, ca united states
Posted: 13th May 2009 01:29
thnaks ill give it a try later

Gateway GT5628 Quad Core Desktop Intel Core 2 Q6600 2.4GHz Quad Core 3072MB RAM / 500GB 7200 SATA II Hard drive DVD RW 18X multi dual NVIDIA GeForce 8500GT ....

Login to post a reply

Server time is: 2024-11-24 06:39:04
Your offset time is: 2024-11-24 06:39:04