Can someone teach me map loading?

You must understand the Game Editor concepts, before post here.

Can someone teach me map loading?

Postby jimmynewguy » Sat Jun 06, 2009 2:49 am

I want to load maps from external files, yes i know there is a demo on this, but it uses .txt which anyone can edit or in otherwords change the game.

The only example I have seen of this is Pyro's Game Over Land and i really couldn't figure that one out with the map editor and all. (But come on, it's not broken down, and well it's pyro XD) So i was wondering if anyone out there would be kind enough to teach me how to do this. I would extremly appreciate it, and I could make times better games with this.
Thanks in advanced.
Working on a probably too ambitious project! Wild-west-adventure-RPG-shooter-thing.
User avatar
jimmynewguy
 
Posts: 1137
Joined: Sat Mar 31, 2007 6:27 pm
Score: 89 Give a positive score

Re: Can someone teach me map loading?

Postby skydereign » Sat Jun 06, 2009 6:11 am

Well, you can still alter the files that pyro has... at least I can. But you would like it to be non legible? The reason those .room files are used is that you don't know how to change it, but you can still access it. Is that okay? I might be able to explain a similar method if you like.
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: Can someone teach me map loading?

Postby Bee-Ant » Sat Jun 06, 2009 8:33 am

Why dont you make the file as .dll or .dat or whatever so that people wouldnt notice it???
Or just use your own encoding...
maybe write @#e% for 1, or a7r% for 2, etc...so although they can open the file, they wouldnt understand what its mean... :D
User avatar
Bee-Ant
 
Posts: 3723
Joined: Wed Apr 11, 2007 12:05 pm
Location: http://www.instagram.com/bee_ant
Score: 210 Give a positive score

Re: Can someone teach me map loading?

Postby jimmynewguy » Sat Jun 06, 2009 1:34 pm

ya sky that's what i mean. Like i want ME to be able to change it, but not whoever downloads it, and BeeAnt, that's a nice idea, but can GE read a .dll?
Working on a probably too ambitious project! Wild-west-adventure-RPG-shooter-thing.
User avatar
jimmynewguy
 
Posts: 1137
Joined: Sat Mar 31, 2007 6:27 pm
Score: 89 Give a positive score

Re: Can someone teach me map loading?

Postby Bee-Ant » Sat Jun 06, 2009 2:46 pm

Why not?
I said that because i already do that.. :D
If you want to use your own encoding.save and load the file as char,and encode it using strcmp...
Code: Select all
int i,j,value;
char var[limit][limit];
FILE *map=fopen("map1.dll","r");
for(i=0;i<limit;i++)
{for(j=0;j<limit;j++)
{fscanf(map,"%s%",&var[i][j]);
if(!strcmp(var[i][j],"7a&%"))value=1;
if(value==1)//creates map with specified sprite
if(value==2)//etc
}}
fclose(map);

Thats the basic i think :D
User avatar
Bee-Ant
 
Posts: 3723
Joined: Wed Apr 11, 2007 12:05 pm
Location: http://www.instagram.com/bee_ant
Score: 210 Give a positive score


Return to Advanced Topics

Who is online

Users browsing this forum: No registered users and 1 guest

cron