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 / not loading file on rerun

Author
Message
shadey
16
Years of Service
User Offline
Joined: 25th Jan 2010
Location:
Posted: 18th Oct 2013 15:49 Edited at: 18th Oct 2013 15:56
for some reason my program saves and loads fine except for when I quit it and rerun, it doesn't load the levels objects onscreen?!



Hail to the king, baby!

http://davidjohnwheeler.blogspot.co.uk
shadey
16
Years of Service
User Offline
Joined: 25th Jan 2010
Location:
Posted: 20th Oct 2013 11:39
anyone? please!

Hail to the king, baby!

http://davidjohnwheeler.blogspot.co.uk
Mobiius
Valued Member
23
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 20th Oct 2013 12:44
Care to tell us what happens?

Is the file actually created?
Where is the file created?
Where is the game running from? (Which folder?)
Can the game find the file when you load? (You don't actually do any error checking on loading?)
What operating system are you using?
Is UAC turned on?

shadey
16
Years of Service
User Offline
Joined: 25th Jan 2010
Location:
Posted: 20th Oct 2013 18:19
yes,the file is created and it runs from the projects folder, i am using windows 8 and UAC is probably on!

Hail to the king, baby!

http://davidjohnwheeler.blogspot.co.uk
shadey
16
Years of Service
User Offline
Joined: 25th Jan 2010
Location:
Posted: 20th Oct 2013 20:23
turning UAC off doesn't fix the problem

Hail to the king, baby!

http://davidjohnwheeler.blogspot.co.uk
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 20th Oct 2013 21:51
Have you done basic checks such as checking whether:

- the loading function is actually called
- the variable r is ever 59

etc, etc?



Powered by Free Banners
SamKM
17
Years of Service
User Offline
Joined: 25th May 2009
Location:
Posted: 20th Oct 2013 21:58 Edited at: 20th Oct 2013 22:17
I've found the problem!
I had a look through the code, and what you're doing when loading is using Make object box, setting all the dimentions to 0, and then trying to scale it. That doesn't work, because 0 times whatever number is always going to be 0! In other words, the objects do exist, but they're all size 0
It might take a bit of tweaking to get them loading at the right size... When you're creating them with spacebar in the editor, maybe try creating them always with the dimentions '100, 100, 100', then scaling them afterwards? Then you could do the same with loading...
Good luck

EDIT:
I've changed these bits of your code, put them in and should work fine!

Block placing code:


Saving function:


Loading function:


Using the optional end parameter in object size x/y/z is useful for what you want to do, because it returns the actual size of the object (taking into account any scaling), so you don't need to use addx# and addz#!
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 20th Oct 2013 23:43
Well spotted SamKM!



Powered by Free Banners
shadey
16
Years of Service
User Offline
Joined: 25th Jan 2010
Location:
Posted: 21st Oct 2013 00:36
ah yes! of course.. thanks .

Hail to the king, baby!

http://davidjohnwheeler.blogspot.co.uk
Mobiius
Valued Member
23
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 21st Oct 2013 02:34
Damn, I missed that. Well spotted!

Login to post a reply

Server time is: 2026-07-08 01:54:10
Your offset time is: 2026-07-08 01:54:10