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.

DarkBASIC Professional Discussion / Save my game - any ideas

Author
Message
Salsa
22
Years of Service
User Offline
Joined: 21st Sep 2003
Location:
Posted: 24th Sep 2003 20:44
My game is cool, but i want to make a save point, now it's quite easy to have the code like:
if pbject collision (character,savepoint)
but what sort of code will save the character and everything?
And how could i load it?

Any suggestions?
Andrew
22
Years of Service
User Offline
Joined: 23rd Aug 2003
Location: United Kindom (what makes it important?)
Posted: 24th Sep 2003 20:50 Edited at: 24th Sep 2003 20:51
Yes i have been trying to do the same thing.
I think this is actually very possible to do, not sure what codes to look up but if i go back to the manual there has to be something there.
There has to be a special code to do this, i just know it.
Unless someone else has learnt this and can help you, but for now i cant help you.

I know my codes - i am now more advanced with DBP-
Ask me any question (um not to do with online though :0)
David T
Retired Moderator
23
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 24th Sep 2003 20:54
Check out the file access commands, it just involves saving all your variables to a file then loading them all again when loading.

OPEN TO WRITE, and WRITE FILE (integer), WRITE FLOAT (real) and WRITE STRING (strings) should do the trick.

c:/dos
c:/dos run
run dos run
TheRipper
22
Years of Service
User Offline
Joined: 24th Sep 2003
Location:
Posted: 24th Sep 2003 20:55
Hi,
i am new in the forum but i have wored for a while in DBPro,
and i belive the best way to make a save is by simply
writing the coordinates and angle of all the objects into a file
and when you load simply position and rotate the objects according to the data.
Salsa
22
Years of Service
User Offline
Joined: 21st Sep 2003
Location:
Posted: 24th Sep 2003 21:14
Thanks -
Also i want to make my person move on it's own, i can move it forward on it's own but how do i make him stop at a certain point, and then rotate him and move him.

Can you help please!!!
Thanks
TheRipper
22
Years of Service
User Offline
Joined: 24th Sep 2003
Location:
Posted: 24th Sep 2003 21:17 Edited at: 24th Sep 2003 21:18
what do you mean on its own?
like randomly or AI?
Salsa
22
Years of Service
User Offline
Joined: 21st Sep 2003
Location:
Posted: 24th Sep 2003 21:20
I mean it moves on it's own like:
move object 1,4 : walk=1

if walk=1 then loop object 2

how do i make him rotate,move left etc???? at a certain point
TheRipper
22
Years of Service
User Offline
Joined: 24th Sep 2003
Location:
Posted: 24th Sep 2003 21:24
if you mean that you want the animation to match the movment then:
1)if the movment and animation are fast enaugth nobody will notice when you change animations with direction, so it will look perfectly normal.
2)if the movment or animation isnt fast then you can make transition animations, example: "walk to stand","stand to walk","walk to leftwalk" and so on...

if this is not what you ment then please explain yourself.
David T
Retired Moderator
23
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 24th Sep 2003 22:32
To turn an object simply change it's Y angle, to tile change it's X angle.

c:/dos
c:/dos run
run dos run

Login to post a reply

Server time is: 2026-07-25 08:29:10
Your offset time is: 2026-07-25 08:29:10