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 / [DBPro]-[Blitzterrain] - Saving and loading terrain

Author
Message
Kezzla
16
Years of Service
User Offline
Joined: 21st Aug 2008
Location: Where beer does flow and men chunder
Posted: 25th Jun 2011 10:17
Hi,
I've been trying to write a subroutine for saving and loading a terrain using blitzterrain

It works fine saving the terrain, but I can't seem to able to load it, the program just freezes. (exits immediately on esc key, so its not chunking)

here's the code i'm using.


At the start of the project I load a flat terrain which loads fine.

my debugger is on strike so I'm unable to see what its hanging on.

any suggestions or advice would be greatly appreciated.
thanks
kezzla

Sometimes I like to use words out of contents
Cybermind
Valued Member
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: Denmark
Posted: 25th Jun 2011 22:20 Edited at: 25th Jun 2011 22:44
I have no experience with blitz terrain, but here is a few pointers:
if keystate(60) = 1 <- This will produce several rapid executions of the routine if nothing stops it.

if keystate(60) = 1 and key_60_stop = 0 (all variables are set to zero if nothing else is stated, so the first time the code hits this line, key_60_stop will be = 0)
key_60_stop = 1
code code code
endif

if keystate(60) = 0 then key_60_stop = 0

Cheers

EDIT: I can see you start by deleting a terrain, what happens if there is no terrain to delete?

The byte chrunchers are coming...
DIVIDING BY ZERO/BECAUSE WE SUCK...
Kezzla
16
Years of Service
User Offline
Joined: 21st Aug 2008
Location: Where beer does flow and men chunder
Posted: 26th Jun 2011 03:25
Thankyou for your help cybermind.

I added the upkey condition into the statement and it still hangs.

i was hoping it was a double delete issue but it doesn't seem to be.
if there was no terrain that would hang, or crash the program.

I might ask in the blitz terrain thread and then post the solution here.

thanks again

kezzla

Sometimes I like to use words out of contents

Login to post a reply

Server time is: 2024-11-22 19:13:01
Your offset time is: 2024-11-22 19:13:01