Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Loading .dat confusing
Goto page 1, 2  Next
 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
&Vage
Grandmaster Cheater Supreme
Reputation: 0

Joined: 25 Jul 2008
Posts: 1053

PostPosted: Thu Jan 15, 2009 7:44 pm    Post subject: Loading .dat confusing Reply with quote

Code:

void Dat::LoadMap( void ){
   int count = 0;
   while(!i.eof()){
      i>>Tiles[i][i];
      count += 1;
   }
   free(&count);
}


Well... it loads correctly but the Tiles is like
Tiles[30][30] = { 0, 0, 1, 1, 2, 2 }; etc. and the .dat's format is like this

0
1
0
2
0
3 ...etc I want it to be able to turn Tiles into...

Tiles[30][30] = { 0, 1, 0, 2, 0, 3 };
Back to top
View user's profile Send private message
Skyone
Grandmaster Cheater
Reputation: 0

Joined: 10 Sep 2006
Posts: 508

PostPosted: Thu Jan 15, 2009 7:53 pm    Post subject: Reply with quote

???

Last edited by Skyone on Wed Dec 23, 2009 9:08 am; edited 7 times in total
Back to top
View user's profile Send private message AIM Address MSN Messenger
&Vage
Grandmaster Cheater Supreme
Reputation: 0

Joined: 25 Jul 2008
Posts: 1053

PostPosted: Thu Jan 15, 2009 7:55 pm    Post subject: Reply with quote

Skyone wrote:
What the fuck type of code is that?
Code that workz.
Back to top
View user's profile Send private message
Skyone
Grandmaster Cheater
Reputation: 0

Joined: 10 Sep 2006
Posts: 508

PostPosted: Thu Jan 15, 2009 7:58 pm    Post subject: Reply with quote

???

Last edited by Skyone on Wed Dec 23, 2009 9:08 am; edited 7 times in total
Back to top
View user's profile Send private message AIM Address MSN Messenger
hcavolsdsadgadsg
I'm a spammer
Reputation: 26

Joined: 11 Jun 2007
Posts: 5801

PostPosted: Thu Jan 15, 2009 9:26 pm    Post subject: Reply with quote

i just saw an thread on gamedev the other night about methods of loading tiles within a 2d game engine... i didn't read it, but it probably had some useful advice.

anyway, rethink your loading. are you using an already existing engine or what? i've never tried writing an engine, but i'd probably try something like... (take it with a grain of salt)

(obviously bullshit code)
Code:

#define MAP_SIZE 32

int main(){
   struct{
      int x;
      int y;
   }tiles[MAP_SIZE];

   for(int i = 0; i < MAP_SIZE << 1; i++){
      if (fileBufferPositionThing % 2) //even, x y formating.
         tiles[i].x = something;
      else //odd
         tiles[i].y = something;
   }

   return 0;
}
Back to top
View user's profile Send private message
&Vage
Grandmaster Cheater Supreme
Reputation: 0

Joined: 25 Jul 2008
Posts: 1053

PostPosted: Thu Jan 15, 2009 9:40 pm    Post subject: Reply with quote

slovach wrote:
i just saw an thread on gamedev the other night about methods of loading tiles within a 2d game engine... i didn't read it, but it probably had some useful advice.

anyway, rethink your loading. are you using an already existing engine or what? i've never tried writing an engine, but i'd probably try something like... (take it with a grain of salt)

(obviously bullshit code)
Code:

#define MAP_SIZE 32

int main(){
   struct{
      int x;
      int y;
   }tiles[MAP_SIZE];

   for(int i = 0; i < MAP_SIZE << 1; i++){
      if (fileBufferPositionThing % 2) //even, x y formating.
         tiles[i].x = something;
      else //odd
         tiles[i].y = something;
   }

   return 0;
}

DarkGDK
Back to top
View user's profile Send private message
oib111
I post too much
Reputation: 0

Joined: 02 Apr 2007
Posts: 2947
Location: you wanna know why?

PostPosted: Thu Jan 15, 2009 9:54 pm    Post subject: Reply with quote

Doesn't DarkGDK come with tutorials for game developers?
_________________


8D wrote:

cigs dont make people high, which weed does, which causes them to do bad stuff. like killing
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
&Vage
Grandmaster Cheater Supreme
Reputation: 0

Joined: 25 Jul 2008
Posts: 1053

PostPosted: Thu Jan 15, 2009 9:57 pm    Post subject: Reply with quote

It does, but not data loading.
Back to top
View user's profile Send private message
crayzbeef
Expert Cheater
Reputation: 0

Joined: 21 Jan 2007
Posts: 101

PostPosted: Fri Jan 16, 2009 2:07 pm    Post subject: Reply with quote

Why the fuck are you saying void in the parameters? Wherever you learned C++ from is very old and shitty, might want to find a new source.

Also, i HOPE you aren't using darkgdk to do 2d.
Back to top
View user's profile Send private message
rapion124
Grandmaster Cheater Supreme
Reputation: 0

Joined: 25 Mar 2007
Posts: 1095

PostPosted: Fri Jan 16, 2009 2:18 pm    Post subject: Reply with quote

crayzbeef wrote:
Why the fuck are you saying void in the parameters? Wherever you learned C++ from is very old and shitty, might want to find a new source.

Also, i HOPE you aren't using darkgdk to do 2d.


You can't use void for the "main" function, but void is perfectly fine for other functions in your program.
Back to top
View user's profile Send private message
crayzbeef
Expert Cheater
Reputation: 0

Joined: 21 Jan 2007
Posts: 101

PostPosted: Fri Jan 16, 2009 2:24 pm    Post subject: Reply with quote

rapion124 wrote:
crayzbeef wrote:
Why the fuck are you saying void in the parameters? Wherever you learned C++ from is very old and shitty, might want to find a new source.

Also, i HOPE you aren't using darkgdk to do 2d.


You can't use void for the "main" function, but void is perfectly fine for other functions in your program.


Perfectly fine? According to what? a C++ standard 20 years ago?
Back to top
View user's profile Send private message
&Vage
Grandmaster Cheater Supreme
Reputation: 0

Joined: 25 Jul 2008
Posts: 1053

PostPosted: Fri Jan 16, 2009 2:36 pm    Post subject: Reply with quote

crayzbeef wrote:
Why the fuck are you saying void in the parameters? Wherever you learned C++ from is very old and shitty, might want to find a new source.

Also, i HOPE you aren't using darkgdk to do 2d.

Oh man big guy on the internetz.
Back to top
View user's profile Send private message
92Garfield
I'm a spammer
Reputation: 57

Joined: 20 Dec 2007
Posts: 5871
Location: Banana Republic Germany

PostPosted: Fri Jan 16, 2009 2:39 pm    Post subject: Reply with quote

maybe you should at least say the language you use.

Here you go a working code to read from a file (you can call it .dat)

Code:
Public oFSO As New FileSystemObject

Do Until oldPath = Text2.Text Or oldPath = ""
oldPath = Text2.List(y)
y = y + 1
Loop
If oldPath <> Text2.Text Then
oldPath = Text2.Text
Text2.AddItem (Text2.Text)
If oFSO.FileExists(App.path & "\Config\Paths.92Garfield") = False Then
Open App.path & "\Config\Paths.92Garfield" For Output As #1
Close #1
End If
Set LoadFile = oFSO.OpenTextFile(App.path & "\Config\Paths.92Garfield", ForAppending)
LoadFile.Write Text2.Text & cr$
LoadFile.Close
End If


_________________


Last edited by 92Garfield on Fri Jan 16, 2009 2:43 pm; edited 1 time in total
Back to top
View user's profile Send private message
&Vage
Grandmaster Cheater Supreme
Reputation: 0

Joined: 25 Jul 2008
Posts: 1053

PostPosted: Fri Jan 16, 2009 2:40 pm    Post subject: Reply with quote

92Garfield wrote:
maybe you should at least say the language you use.

It's really not that hard to see what language I'm using.
Back to top
View user's profile Send private message
92Garfield
I'm a spammer
Reputation: 57

Joined: 20 Dec 2007
Posts: 5871
Location: Banana Republic Germany

PostPosted: Fri Jan 16, 2009 2:44 pm    Post subject: Reply with quote

_void_ wrote:
92Garfield wrote:
maybe you should at least say the language you use.

It's really not that hard to see what language I'm using.


Could be:
C#
C
C++
JS
Java
Flash
PHP (Well kinda obviously not since its SS)
...
Dunno so many

_________________
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites