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.

Author
Message
pugmartin
23
Years of Service
User Offline
Joined: 3rd Jan 2003
Location: United Kingdom
Posted: 13th May 2003 00:49
Hi there. In my code, i setup an array with a few TYPEs in it, such as:
object(num).texture
object(num).texscale

etc

This works fine in my code and everythings hunky dory until i added a simple save routine which basically writes all the associated things to do with the blocks into a file. Everything works, until i try and use the array with type to refer to a variable.

So, in other words, using : write file 1,object position x(num)
works fine.

But, using : write file 1,object(num).texture
dont.

Even copying the contents to another variable first dont work, such as : tex=object(num).texture
then : write file 1,tex

If i then look at whats saved, instead of being say 2 or 20, it ends up about 18025353!

I think its to do with it recording the pointer rather than the value?
shwuckie
23
Years of Service
User Offline
Joined: 9th May 2003
Location: Australia
Posted: 13th May 2003 22:10
instead of using write file filenumber,variable use write byte filenumber,variable or write word filenumber,variable etc

optic blast! megablast! have a blast!!
shwuckie
23
Years of Service
User Offline
Joined: 9th May 2003
Location: Australia
Posted: 13th May 2003 22:12
oops and while i think of it ya could always write all ya needed info sequentially into a memblock and then use write memblock filenumber,memblock number just make sure ya write and read from the memblock properly

optic blast! megablast! have a blast!!
pugmartin
23
Years of Service
User Offline
Joined: 3rd Jan 2003
Location: United Kingdom
Posted: 13th May 2003 22:40
Found it mate, the problem actually lay with the `texture` command. My code was writing to disk and rereading it properly, its just later on, when things got textured that it went tits up.

Texture object 4,selectedcube(cubenumber).texture
wouldnt work for example. Doesnt send the actual value held in the variable. Pretty sure its sending the pointer instead.
Took me ages to trawl thru me code too! Ah well, least its sorted now...

Gonna tell Rich about this, dunno if they know bout it yet.

Thanks for your help though mate

shwuckie
23
Years of Service
User Offline
Joined: 9th May 2003
Location: Australia
Posted: 14th May 2003 01:15
no trubbles bubbles, now i mite go get some sleep im getting loopy

optic blast! megablast! have a blast!!

Login to post a reply

Server time is: 2026-07-11 08:47:05
Your offset time is: 2026-07-11 08:47:05