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
nruser
18
Years of Service
User Offline
Joined: 22nd Dec 2007
Location: Serbia
Posted: 28th Nov 2011 21:30
how can i make dbp read file and load the map/level from it, i tried to save my map to kind of ini file, but when i want to load it i get one more object that was not saved before and ini file gets corrupted with some other data in the source code that is not related?

this is the map file


and this is my function for loading



what am i doing wrong, can someone show me thier method of performing save/load operation?
Daniel wright 2311
User Banned
Posted: 28th Nov 2011 21:40
Need to see the way you saved in your map to know for shure

Here is how I do it



my signature keeps being erased by a mod So this is my new signature.
Daniel wright 2311
User Banned
Posted: 28th Nov 2011 21:56
doubloe post.

Here is a way to save memory blocks that work so much better.I use this from another thread



my signature keeps being erased by a mod So this is my new signature.
nruser
18
Years of Service
User Offline
Joined: 22nd Dec 2007
Location: Serbia
Posted: 28th Nov 2011 22:12
this is my save function



also i had some problems when i wanted to save array like player from your post to file so i tried to save this way
Daniel wright 2311
User Banned
Posted: 28th Nov 2011 22:31
arrays are always saved in and loaded in better in blocks and not strings. try the code i posted abouve and change your saving code and loading code and it should work.If you can wait till later i will write it for you, right now its bottal time for my baby..

my signature keeps being erased by a mod So this is my new signature.
nruser
18
Years of Service
User Offline
Joined: 22nd Dec 2007
Location: Serbia
Posted: 28th Nov 2011 23:16
ok
nruser
18
Years of Service
User Offline
Joined: 22nd Dec 2007
Location: Serbia
Posted: 29th Nov 2011 02:30
now there is another problem with this



now i don't get any result from loading the map, no errors, crashes or anything
Daniel wright 2311
User Banned
Posted: 29th Nov 2011 04:27
Quote: "now i don't get any result from loading the map, no errors, crashes or anything"


good, Im glade you worked it out.

my signature keeps being erased by a mod So this is my new signature.
MrValentine
AGK Backer
15
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 29th Nov 2011 05:20
I don't think he means he worked it out...

Daniel wright 2311
User Banned
Posted: 29th Nov 2011 06:22
Quote: "I don't think he means he worked it out"


well then, if you are right my bad,I will wait to see what he says then.

my signature keeps being erased by a mod So this is my new signature.
nruser
18
Years of Service
User Offline
Joined: 22nd Dec 2007
Location: Serbia
Posted: 29th Nov 2011 17:30
no i didn't worked it out, i have problems with loading data, i don't get any result, when i used my original code i had one bulk object created, and 'corrupted' map file?
Daniel wright 2311
User Banned
Posted: 29th Nov 2011 20:58
Quote: "no i didn't worked it out, i have problems with loading data, i don't get any result, when i used my original code i had one bulk object created, and 'corrupted' map file? "


Your open to write map should be right below your if file exist so the values hold true in the writing prosess.Now I dont know for shure if this was the problem but this is what I would test first,if it is not the problem we will fo from there.I changed it for you already.



my signature keeps being erased by a mod So this is my new signature.
nruser
18
Years of Service
User Offline
Joined: 22nd Dec 2007
Location: Serbia
Posted: 29th Nov 2011 23:53
your code doesn't change anything, with that code program crashes, but this is the code that i found on the forum



i'am not sure who coded this, how can i put this in a function to save every object, with position, angle, scale and other details; for me point of concern is this



is there another method besides this because i wanted to save object with type like this one



and load it later?
basjak
16
Years of Service
User Offline
Joined: 16th Apr 2010
Location: feel like signing up for mars
Posted: 30th Nov 2011 00:23 Edited at: 30th Nov 2011 15:27
in my opinion creating a level this way is very mixing and time consuming. create your own format:

example: string$="objno,scale,x,y,z,Ox,Oy,Oz,texture,FX"

and make a small app the can create a file this way then let your game app break up the string.
nruser
18
Years of Service
User Offline
Joined: 22nd Dec 2007
Location: Serbia
Posted: 1st Dec 2011 01:54
the basic idea was to write every object or whatever with its data to file and later to be able to load it, the problem is that data can be written but can't be loaded later.

Quote: "
create your own format:

example: string$="objno,scale,x,y,z,Ox,Oy,Oz,texture,FX"

and make a small app the can create a file this way then let your game app break up the string
"


i think that this is not bad idea but it is almost the same thing that i was doing, i wrote data to file and later i read the data from there but it can't be used to create object.
MrValentine
AGK Backer
15
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 1st Dec 2011 02:28
I just had a rogue idea... Maybe experiment and save the data to a memblock? Just a thought...

Also another thought was save position data in one file and object data in anothef...

Just as a diagnostic approach...

Daniel wright 2311
User Banned
Posted: 1st Dec 2011 03:19
Quote: "I just had a rogue idea... Maybe experiment and save the data to a memblock? Just a thought...

Also another thought was save position data in one file and object data in anothef...

Just as a diagnostic approach..."


I had already told him this, im not shure he understands,i even posted a example.I hope he gets it to work for him, dont give up my friend.

my signature keeps being erased by a mod So this is my new signature.
MrValentine
AGK Backer
15
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 1st Dec 2011 04:42
Sorry buddy I did not notice... Oh well a fresh reminder haha

TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 1st Dec 2011 07:37 Edited at: 1st Dec 2011 09:21
hi nruser


Your variable SecNum counts how many objects are in the file, and then you do this for...next loop to load the objects accordingly:



However, if SecNum were 0, you'd sill be loading an object, because for i=12 to 12 would still loop once. Tell me if this fixes it:



Quote: "I had already told him this, im not shure he understands,i even posted a example.I hope he gets it to work for him, dont give up my friend."


What are you blabbering about? You haven't mentioned the word "memblock" anywhere in your previous posts. You obviously have no idea what you're talking about

Please restrain yourself from posting useless and unhelpful posts, as all it does is clutter up the thread. That goes for you too MrValentine.

TheComet

Daniel wright 2311
User Banned
Posted: 1st Dec 2011 16:33 Edited at: 1st Dec 2011 16:34
Quote: "What are you blabbering about? You haven't mentioned the word "memblock"


Here is a way to save memory blocks that work so much better.I use this from another thread,YOU DID NOT READ THAT POST?????????

I just double read all my posts and yes I did ,dont start trouble when its not needed,I even gave him a great example for memory blocks,YES I DID.

You need to calm down and stop acting like if you are better then me,his code deals with strings,I already gave him a great example of memory blocks and how to use them for strings.

You need to open your eyes and re read all my posts.

my signature keeps being erased by a mod So this is my new signature.
MrValentine
AGK Backer
15
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 1st Dec 2011 16:40
Comet... What did I say? I genuinly gave useful direction.......

TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 1st Dec 2011 17:23
Sorry MrValentine, I excuse myself I overreacted and am not being fair on your behalf.

Quote: "Here is a way to save memory blocks that work so much better.I use this from another thread,YOU DID NOT READ THAT POST?????????

I just double read all my posts and yes I did ,dont start trouble when its not needed,I even gave him a great example for memory blocks,YES I DID."


And I just figured out that my "search" function can't search inside code snippets

The intention of nruser is to save his brushes in a readable format to a file. Your code example would output weird stuff. While this isn't a problem for the program to read/write, it definitely is a problem for the user to open the file and edit it. That's why the goal here is to figure out what's wrong with HIS code, not give him new code. There's a good reason why he chose to output it as text rather than memblocks.

Quote: "You need to calm down and stop acting like if you are better then me,"


And this is waaaayy beside the point. I never intended to "prove" myself to you that I'm better than you, that's just absurd and you know it We are a community, we help each other, and everyone is valued equally (well except for the mods and valued members I suppose).

TheComet

MrValentine
AGK Backer
15
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 1st Dec 2011 17:39
I never have issues with you Comet...



Well can the OP please comment

Has anythinh helped?

Daniel wright 2311
User Banned
Posted: 1st Dec 2011 17:41
Quote: "The intention of nruser is to save his brushes in a readable format to a file."


Ok, so I did tell him about blocks did I not??? I gave him a great example on how they work either way. Just becousae I did not wirte his whole code does not mean I did not try to help him out.

You are trying to make it seem like you are smart and I am stupid and did nothing to try to help him,this is not so,I tryed to help him out. done and done.

Th
Quote: "ere's a good reason why he chose to output it as text rather than memblocks"


Yes, and he never expalined this till way latter on, And I now see this point.

my signature keeps being erased by a mod So this is my new signature.
TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 1st Dec 2011 17:57
Quote: "Ok, so I did tell him about blocks did I not??? I gave him a great example on how they work either way. Just becousae I did not wirte his whole code does not mean I did not try to help him out."


Yes, but your program outputs this:



Quote: "You are trying to make it seem like you are smart and I am stupid and did nothing to try to help him,this is not so,I tryed to help him out. done and done."


Are we going around in circles? I just pointed out that it is not my intention to make myself appear smart, my only goal is to help out nruser. I'm sorry I exploded like that, it was wrong of me.

TheComet

Daniel wright 2311
User Banned
Posted: 1st Dec 2011 18:37 Edited at: 1st Dec 2011 18:37
Quote: "I'm sorry I exploded like that, it was wrong of me."


All forgiven, I stll think he needs to not use strings for saving and loading, I guess it deends on what it is he is saving and loading in his directory folders.

my signature keeps being erased by a mod So this is my new signature.
nruser
18
Years of Service
User Offline
Joined: 22nd Dec 2007
Location: Serbia
Posted: 1st Dec 2011 20:55
Ok thanks to TheComet i menaged to fix this, i also needed to fix some other places for this code to work. Now is there any way to obtain witch texture object is using, but to get it as a string not integer?

Login to post a reply

Server time is: 2026-07-10 01:32:43
Your offset time is: 2026-07-10 01:32:43