New iPhone GeLoader (Work in Progress)

Talk about making games.

New iPhone GeLoader (Work in Progress)

Postby Fojam » Wed Nov 02, 2011 4:13 pm

ok so apps in the root /Applications directory can run .sh files as the executable. i dont know yet if they can run that in the mobile directory also, though. this gives me an idea.

we can make a version of geplayer where the first executable is an sh file that scans a folder for its contents. it then lists its contents inside a text file. then it runs the geplayer executable, which runs a dat game. the dat game reads the list of maps from the text file and lists them in the game. when you click on one of them, it loads the game. this will allow people to keep multiple games in their geplayer app!
Last edited by Fojam on Thu Nov 03, 2011 11:31 pm, edited 1 time in total.
CLICK TO GIVE ME POINTS

My Latest Projects:
Super Smash Bros: viewtopic.php?f=6&t=12307 PLEASE help by making sprites!
User avatar
Fojam
 
Posts: 513
Joined: Thu Mar 19, 2009 10:02 pm
Location: under your bed!!!
Score: 69 Give a positive score

Re: iPhone idea

Postby CrimsonTheDarkBat » Wed Nov 02, 2011 4:15 pm

Oh dear god I've gone cross-eyed. :shock: :lol:

Sounds like a good idea though, and would certainly solve a lot of people iPhone woes. ^^
Sonic Velocity Development Thread --> http://game-editor.com/forum/viewtopic.php?f=4&t=11461

Completed Games:
Sonic: War of the Emeralds
Sonic: Empire of Nightmares
Sonic.EXE - The Game
Alice: Crimson Omen
Epsilon 27
User avatar
CrimsonTheDarkBat
 
Posts: 223
Joined: Fri Mar 21, 2008 10:54 am
Score: 20 Give a positive score

Re: iPhone idea

Postby Fojam » Wed Nov 02, 2011 4:17 pm

im gonna learn a little sh script and try to make this work
CLICK TO GIVE ME POINTS

My Latest Projects:
Super Smash Bros: viewtopic.php?f=6&t=12307 PLEASE help by making sprites!
User avatar
Fojam
 
Posts: 513
Joined: Thu Mar 19, 2009 10:02 pm
Location: under your bed!!!
Score: 69 Give a positive score

Re: iPhone idea

Postby Hblade » Wed Nov 02, 2011 4:22 pm

genius.
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score

Re: iPhone idea

Postby akr » Wed Nov 02, 2011 5:30 pm

You can write a script in game-editor which loads other .dat files. Then you should get the same with minimum effort.

All the other files can be uploaded sequentially to geplayer once.

andreas
Co-Developer of GE engine

If u are interrested in new features of apple or android ge engines check the engine support website game-editor.net regulary.
akr
 
Posts: 453
Joined: Thu Feb 25, 2010 7:56 pm
Location: Germany, Ulm
Score: 40 Give a positive score

Re: iPhone idea

Postby Fojam » Wed Nov 02, 2011 7:34 pm

akr i want it to list all of the available files so people can choose which one to load
CLICK TO GIVE ME POINTS

My Latest Projects:
Super Smash Bros: viewtopic.php?f=6&t=12307 PLEASE help by making sprites!
User avatar
Fojam
 
Posts: 513
Joined: Thu Mar 19, 2009 10:02 pm
Location: under your bed!!!
Score: 69 Give a positive score

Re: iPhone idea

Postby Fojam » Thu Nov 03, 2011 12:11 am

ok the sh script is done i just need to make the game editor file. this is the hard part....

what i need to do is make it count the number of lines that are in the text and make that amount of text actors. each text actor will correspond with one of the lines in the text document. when clicked on, that text actor will launch whatever .dat file their line represents.
I need it to skip the first line though, because the first line just says the directory, but thats not super important i could use that to my advantage.

also, here is the apps to run this on iPhone. not yet working it just lists the dat files into a txt file. put your dat files in /geapp.app/games
http://dl.dropbox.com/u/8500676/geapp.zip

this does also require com.conradkramer.open installed on your iPhone
CLICK TO GIVE ME POINTS

My Latest Projects:
Super Smash Bros: viewtopic.php?f=6&t=12307 PLEASE help by making sprites!
User avatar
Fojam
 
Posts: 513
Joined: Thu Mar 19, 2009 10:02 pm
Location: under your bed!!!
Score: 69 Give a positive score

Re: iPhone idea

Postby skydereign » Thu Nov 03, 2011 12:49 am

You can use a function like this to get the number of lines. The rest is pretty straight forward. You can use fgets to set the text actors.
Code: Select all
#define MAX_LINE 255
int
file_num_lines (FILE* file)
{
    char temp[MAX_LINE];
    int count = 0;
    if(file != NULL)
    {
        while(fgets(temp, MAX_LINE, file)!=NULL)
        {
            count++;
        }
    }
    return count;
}
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: iPhone idea

Postby Fojam » Thu Nov 03, 2011 1:00 am

to use that, should i just add one text actor and set it to a create actor event or what?
CLICK TO GIVE ME POINTS

My Latest Projects:
Super Smash Bros: viewtopic.php?f=6&t=12307 PLEASE help by making sprites!
User avatar
Fojam
 
Posts: 513
Joined: Thu Mar 19, 2009 10:02 pm
Location: under your bed!!!
Score: 69 Give a positive score

Re: iPhone idea

Postby skydereign » Thu Nov 03, 2011 2:10 am

I'd make an array, and use the text actor's cloneindex to set the text (in their create actor event). But, that function wouldn't need to be run all the time. That was just for getting the number of lines.
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: iPhone idea

Postby Fojam » Thu Nov 03, 2011 2:12 am

im still learning a lot, so do you think you could make an example? sorry
CLICK TO GIVE ME POINTS

My Latest Projects:
Super Smash Bros: viewtopic.php?f=6&t=12307 PLEASE help by making sprites!
User avatar
Fojam
 
Posts: 513
Joined: Thu Mar 19, 2009 10:02 pm
Location: under your bed!!!
Score: 69 Give a positive score

Re: iPhone idea

Postby skydereign » Thu Nov 03, 2011 3:56 am

No, I'd rather not make an example, as this doesn't involve very much and and it would be better learning wise if you didn't just see the answer. Anyway, you have a file that you want to read in its lines. You can use a loop (using fgets) and an array of strings, and then you are done. fgets takes a FILE*, a string, and a max line size. It reads in until it reaches a newline (or max line size is met). Each loop increases the index, and so you keep writing in the strings until you reach the end of the file (fgets returns NULL).
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: iPhone idea

Postby Fojam » Thu Nov 03, 2011 4:20 pm

ok i tried to use your code and it gave me a ton of errors. im sorry i am still trying to learn a lot of GE's code so i didnt understand a lot of what was written.
CLICK TO GIVE ME POINTS

My Latest Projects:
Super Smash Bros: viewtopic.php?f=6&t=12307 PLEASE help by making sprites!
User avatar
Fojam
 
Posts: 513
Joined: Thu Mar 19, 2009 10:02 pm
Location: under your bed!!!
Score: 69 Give a positive score

Re: New iPhone GeLoader (Work in Progress)

Postby Fojam » Thu Nov 03, 2011 11:01 pm

ok i think i have it close, but im stuck on something
i want to keep creating new variables for each line in the text file (ie: line1, line2, line3 etc) but i dont know how to do that.

this is what i have so far
Code: Select all
fp = fopen("list.txt", "r");
while(!(feof(fp)))
{
    count++;
    for(i=1; i<=count; i++)
    {
        string sprintf("line%s", i) = fgets(fp);
    }
}
CLICK TO GIVE ME POINTS

My Latest Projects:
Super Smash Bros: viewtopic.php?f=6&t=12307 PLEASE help by making sprites!
User avatar
Fojam
 
Posts: 513
Joined: Thu Mar 19, 2009 10:02 pm
Location: under your bed!!!
Score: 69 Give a positive score

Re: New iPhone GeLoader (Work in Progress)

Postby skydereign » Fri Nov 04, 2011 12:04 am

The code I provided doesn't have any errors, so something about your setup is messing it up. It does exactly what it should do. Now to address the problems in your code, that isn't how sprintf works, nor are strings supported in C. Also what are you trying to do with that code? It looks like you are trying to read more and more lines from the file each iteration of the loop. If you wanted to read in the line from the file and have it use sprintf, you can do this.
Code: Select all
fgets(str_temp, MAX_LINE, fp);
sprintf(string_var, "line%s", str_temp);
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Next

Return to Game Development

Who is online

Users browsing this forum: No registered users and 1 guest