Page 1 of 1

Super Mario Bros 3

PostPosted: Wed Jan 28, 2009 10:20 pm
by Camper1995
Yo Yo, finaly! My game is finished! I think, this is good game. Graphic is very good... I think :D
My game have 5 levels, i make this game CCA 2 weeks. Controls: Left, Right, Up, Space to climb
In my game, there is only one problem. There are 2 .exe files. World 1 and World 2..and I dont know,
how to load score between World 1 and World 2. If can anyone help me? Please. I can post .ged file here.
But now: Screens:
Image 1.jpg
Image 1.jpg (28.08 KiB) Viewed 7532 times



And the game:
exe.zip
(7.78 MiB) Downloaded 769 times


size=150]Enjoy[/size] :D

Re: Super Mario Bros 3

PostPosted: Wed Jan 28, 2009 11:02 pm
by makslane
Great Mario version :-) Can you post the sources? (You need post the ged and data files in the Game Demos forum)

Re: Super Mario Bros 3

PostPosted: Thu Jan 29, 2009 1:57 am
by jimmynewguy
nice :D
oh and use the load game function to go between exe's

Edit: a few notes:
Yoshi sounds on mario;
moon walkling
water(?) sound instead of coin

other than those few easy fixes: = great :D

Re: Super Mario Bros 3

PostPosted: Thu Jan 29, 2009 12:48 pm
by Camper1995
Thanks guys. Yes, I know how to load game, but you dont understand me. I need, this: That total score from first world, is loaded in second world...I know, I must do it with
variables (loadVars and saveVars), but can anyone write me, that script, how to do this?
I dont understand that variables little bit :cry:

P.S.: here's .ged file :D

Re: Super Mario Bros 3

PostPosted: Thu Jan 29, 2009 2:17 pm
by makslane
Thank you for the codes :-)
Can someone help here?

Re: Super Mario Bros 3

PostPosted: Thu Jan 29, 2009 3:10 pm
by DST
Easy way to save/load vars:

In variables tab, create a new global integer array, size 10. Give it a savegroup ( i'll say gstats, savegroup 'all' ).

Now here's the saving script:

Code: Select all
gstats[0]=level;
gstats[1]=score;
gstats[2]=lives;
gstats[3]=poweruplevel;
gstats[4]=time;
saveVars("stats.txt", "all");


That saves all the important variables about the game in one array;

Now the loadscript:
Code: Select all
loadVars("stats.txt", "all");
level=gstats[0];
score=gstats[1];
lives=gstats[2];
poweruplevel=gstats[3];
time=gstats[4];
if(gstats[0]!=thislevel){
LoadGame("otherfile");}


Now what the 'level' variable does is make sure that the file can't be started incorrectly; i used 'thislevel' to tag the dat file that's being opened. If you open level 6.dat but you never made it to level 6, then it reloads (otherfile) which in this case could be level 5, or whatever. You may not need this in your file, but its nice to have that safety check.

In my game arcade, i made it so the dstgames logo only appears the first time you play the arcade; after that it loads without the intro.

Re: Super Mario Bros 3

PostPosted: Thu Jan 29, 2009 3:16 pm
by Camper1995
Um ok, if I understand:
I have score variable and Score actor.
now I make: gstats0=score;
saveVars ("stats.txt", "all")

And my score is saved?

and then: loadVars("stats.txt" , "all")
score=gstats0;

is this right?
My score will be loaded in lvl 2?

Thnx
:wink:

Re: Super Mario Bros 3

PostPosted: Thu Jan 29, 2009 3:25 pm
by Kalladdolf
Nice! I love mario fangames.

Re: Super Mario Bros 3

PostPosted: Thu Jan 29, 2009 3:38 pm
by DST
yes, that is correct, as long as gstats[] exists in both files, and is set to the same savegroup in both files, your score will be loaded upon opening level 2.

You could save 'score' by itself, but using the array is much easier because you can load all the stats into the array, and not have to chase them down. Arrays are the bread and butter of games, whereas single lonely variables get confusing when there's a lot of them, and actor variables are nearly impossible to call from any actor but the owner of the variable.

There is nothing a lone variable can do that an array variable can't, but there's plenty an array variable can do that a normal variable can't.

Re: Super Mario Bros 3

PostPosted: Thu Jan 29, 2009 5:19 pm
by Camper1995
Yea DST, I try to do this,..but I think, I cant do this :D :D

But, thanks. I will try :wink:

P.S.: First, I must to learn to speak perfect english, and then to make some experiments with variables :mrgreen:

Thnx

Re: Super Mario Bros 3

PostPosted: Thu Jan 29, 2009 6:18 pm
by Camper1995
Umm, it doesnt work...I made it step by step. But,...No
Can you please make me this? :D You have here .ged file...pls..i dont know why this dont work..so I need
between Super Mario Bros 3.ged (or .exe) and w2.ged (or .exe). I need that between this two levels, is my Score loaded.
(Score is that big black score in middle up of view.... :D
So when you are in LVL 1 (Super Mario Bros 3) and when you are loaded in w2, you Score, will be loaded...
Do you understand? :D

Thnx...

Re: Super Mario Bros 3

PostPosted: Thu Jan 29, 2009 6:55 pm
by Game A Gogo
I haven't looked over your game yet to determine if this solution will work for you.
And guessing you have no variable holding the score.
Go on your text actor for the score, Add a "Draw Actor" event, then select script editor.
Now go on the button named "Variables" and not "Variables/functions", click Add, enter a name for this variable (Like
"ScoreHold", it cannot be the same as a function or an actor), and type in a save group (Like "Scores"). Now your variable is made and ready to hold a value!
untitled.JPG
variable

Now you want it to keep track of your score... So in that script (That I suppose, and hopefully, you haven't closed) window, type in this:
Code: Select all
ScoreHold=textNumber;
(Replace ScoreHold by whatever you have named your variable)
and click Add>Immediate action.
--
Now your variable is holding a value! yay!
but let's not celebrate yet.
You still haven't saved this poor little critter to be loaded in your next game.
Simply add a timer, that is about 1-4 seconds and make it infinite loop. Now whenever this timer will trigger, do this script
Code: Select all
saveVars("score.scr", "Scores");
(Replace Scores by whatever you have named the variable group)
This will save your score to an external file. The usage of the timer is to simply crunch down the CPU needing in a general time-lime of the game.
--
Now this is pretty and all... but we need to load this variable into your world 2!
Create this same variable (Make sure everything is the same, save group and all)
and on the event "Create Actor", do this script:
Code: Select all
loadVars("score.scr", "Scores");
textNumber=ScoreHold;
(Replace ScoreHold by whatever you have named your variable and replace Scores by whatever variable group you named)
--
That should be a quick and dirty way to save/load your variable and transfer your score to one game to another. Hope this helped!

Re: Super Mario Bros 3

PostPosted: Thu Jan 29, 2009 7:31 pm
by Camper1995
OOoooou man! Tháánksss.... thanks thanks thanks! :mrgreen:

You help me realy much! Thanks. :D

Re: Super Mario Bros 3

PostPosted: Thu Jan 29, 2009 7:37 pm
by Game A Gogo
glad to be of help :)

Re: Super Mario Bros 3

PostPosted: Thu Jan 29, 2009 7:56 pm
by Camper1995
So, its here. :D Super Mario Bros 3 with loading score between World 1 and World 2...

Thank you Game a Gogo :wink:

Here are EXE files:
Super Mario Bros 3 EXE.zip
(7.78 MiB) Downloaded 318 times


And heres SOURCE:
Super Mario Bros 3 GED.zip
(5.37 MiB) Downloaded 438 times


Enjoy :D