instead of seperate map

Started by MisterN, March 21, 2011, 10:56:48 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

MisterN

ok i learned how to export to map but that didn't help anything :S so since i have to do fpg's, id like to know if i can easily translate this code:
Player_graph[12]=load_png(".\sprites\player\Stand.png");
can i simply go?
Player_graph[12]=graph(1);
i tried it but i got an error. all the images are addressed in the Begin after global of my program code. i dont want to reinvent my long lines of code since ive come this far already, is there anything that can easily turn:
Player_graph[12]=load_png(".\sprites\player\Stand.png");
into a code that involves graphs? not .pngs? thanks
werg

Drumpi

Emmm, i don't know what are you trying to do.
First, you must load graphics with load_png, load_map or load_fpg, if you didn't, the program don't know what file are you talking about.

If you want to load several images, you can use a FPG file. You can put 999 graphics on every FPG, and use a single line to load all.
Hala, como con 1001 procesos sólo va a 9 FPS, vamos a meterle 32 veces más, a ver si revienta.
(Drumpi epic moment)

MisterN

I did this and got no errors but what happened was:
*you didnt see the player, instead you got the background level (weird)
[code language="fenix"]
    Player_graph[0]=load_fpg(3);
    Player_graph[1]=load_fpg(3);
    Player_graph[2]=load_fpg(3);
    Player_graph[3]=load_fpg(4);
    Player_graph[4]=load_fpg(4);
    Player_graph[5]=load_fpg(4);
    Player_graph[6]=load_fpg(5);
    Player_graph[7]=load_fpg(5);
    Player_graph[8]=load_fpg(5);
    Player_graph[9]=load_fpg(4);
    Player_graph[10]=load_fpg(4);
    Player_graph[11]=load_fpg(4);
    Player_graph[12]=load_fpg(1);
    Player_graph[13]=load_fpg(2);[/code]

so what am i doing wrong now?
werg

SplinterGU

load_fpg need a string argument... you don't must use a numeric value.

graph(N) requiere a function named graph... bennugd don't have it.
Download Lastest BennuGD Release: http://www.bennugd.org/node/2

MisterN

im using fenix first for the dreamcast
werg

SplinterGU

my response is valid for fenix too.
Download Lastest BennuGD Release: http://www.bennugd.org/node/2

Drumpi

You are doing it wrong, you must do:

file_id=load_fpg("my_dir/my_file.fpg");
then you can use FILE_ID in every FILE process variable, and any value between 1 and 999 in his graph value.

Or if you want:
loaded_graph1=load_png(".\sprites\player\Stand.png");
loaded_graph2=load_png(".\sprites\player\Jump.png");
loaded_graph3=load_png(".\sprites\player\Walk1.png");
loaded_graph4=load_png(".\sprites\player\Walk2.png");
loaded_graph5=load_png(".\sprites\player\Walk3.png");
loaded_graph6=load_png(".\sprites\player\Fall.png");

Player_graph[0]=loaded_graph3;
Player_graph[1]=loaded_graph3;
Player_graph[2]=loaded_graph3;
Player_graph[3]=loaded_graph4;
Player_graph[4]=loaded_graph4;
Player_graph[5]=loaded_graph4;
Player_graph[6]=loaded_graph5;
Player_graph[7]=loaded_graph5;
Player_graph[8]=loaded_graph5;
Player_graph[9]=loaded_graph4;
Player_graph[10]=loaded_graph4;
Player_graph[11]=loaded_graph4;
Player_graph[12]=loaded_graph1;
Player_graph[13]=loaded_graph2;
Hala, como con 1001 procesos sólo va a 9 FPS, vamos a meterle 32 veces más, a ver si revienta.
(Drumpi epic moment)

MisterN

the or code game me an error saying it doesnt know what loaded_graph is

and with the file_id=load_fpg("my_dir/my_file.fpg"); do i have to put it on top of everything or just type it once then do all the status=graph things?
werg

SplinterGU

loaded_graph2, are sample vars that use drumpi for explain this to you.

the local var file must be set with the fpg's id (previous loaded) of you graph collection.
Download Lastest BennuGD Release: http://www.bennugd.org/node/2

Drumpi

Again, don't read the code literally, loaded_graph is a variable that you define with the name you want.

I don't understand the second part. You can use LOAD_FPG to load the file, this give you an ID number similar as FOPEN on C, this number is used on FILE local variable of every process to know what set of graphics must use.
Inside this set, you can found lots of images, they are numerated, and you can use their numbers in GRAPH variables on every process that uses this FILE.
Hala, como con 1001 procesos sólo va a 9 FPS, vamos a meterle 32 veces más, a ver si revienta.
(Drumpi epic moment)

MisterN

oierjvowiejrv
frustrating...

with that whole file_id thing, where do i put it? ive already got eh fpg loaded, now what. just show me, so i cna do this for everything else. how can i convert
[code language="bennu"]
Player_graph[0]=load_png(".\sprites\player\Walk1.png"); 
    Player_graph[1]=load_png(".\sprites\player\Walk1.png"); 
    Player_graph[2]=load_png(".\sprites\player\Walk1.png"); 
    Player_graph[3]=load_png(".\sprites\player\Walk2.png"); 
    Player_graph[4]=load_png(".\sprites\player\Walk2.png"); 
    Player_graph[5]=load_png(".\sprites\player\Walk2.png"); 
    Player_graph[6]=load_png(".\sprites\player\Walk3.png"); 
    Player_graph[7]=load_png(".\sprites\player\Walk3.png"); 
    Player_graph[8]=load_png(".\sprites\player\Walk3.png"); 
    Player_graph[9]=load_png(".\sprites\player\Walk2.png"); 
    Player_graph[10]=load_png(".\sprites\player\Walk2.png"); 
    Player_graph[11]=load_png(".\sprites\player\Walk2.png"); 
    Player_graph[12]=load_png(".\sprites\player\Stand.png"); 
    Player_graph[13]=load_png(".\sprites\player\Jump.png");
[/code]

to fpg code, words arent going to help me that well on this one unless it is so finely detailed cause im stuck in a pickle
werg

MisterN

#11
hmmm i know i can do it easily if each fpg is one image... nope scratch that
werg

FreeYourMind

Karma: -3  !!!!

You have new world record  ;D

MisterN

I dont even think that karma can go negative XD
werg