I need some help... :(

Game Editor comments and discussion.

I need some help... :(

Postby RippeR7420 » Mon Feb 20, 2012 9:25 pm

So, I have a problem with my players Lives. I have it set to when you start the game, the player has 3 lives. and if you die, you lose one(Obviously).
I have it set to if you lose all your lives(Lives.textNumber=0), it will load the GameOver.dat file. And then takes you back to the title screen. but my
problem is, when you start the game again, you still have 0 lives?? I know this is because it's a global variable, and I am using LoadVars and SaveVars,
but I have no idea how to fix this.. I need the variable in the first level, because I have it set that if you die and, (Lives.textNumber >= 1) it reloads the
level and minus's a life.. Any help would be GREATLY appreciated.. :)

Thanks again for looking :D
CURRENT PROJECTS:

-Olo: The Sword Shaman http://game-editor.com/forum/viewtopic.php?f=4&t=12919

-The Wrath of Blob: (On the back burner)

-StickMcGee - Blast to the Future http://game-editor.com/forum/viewtopic.php?f=4&t=13660
User avatar
RippeR7420
 
Posts: 391
Joined: Mon Apr 27, 2009 4:16 pm
Location: Salt Lake City, Utah.
Score: 23 Give a positive score

Re: I need some help... :(

Postby RippeR7420 » Mon Feb 20, 2012 9:44 pm

So, I think I just have to do it with MoveTo... and just have the variable transfer at the end of the level maybe?
CURRENT PROJECTS:

-Olo: The Sword Shaman http://game-editor.com/forum/viewtopic.php?f=4&t=12919

-The Wrath of Blob: (On the back burner)

-StickMcGee - Blast to the Future http://game-editor.com/forum/viewtopic.php?f=4&t=13660
User avatar
RippeR7420
 
Posts: 391
Joined: Mon Apr 27, 2009 4:16 pm
Location: Salt Lake City, Utah.
Score: 23 Give a positive score

Re: I need some help... :(

Postby Fojam » Mon Feb 20, 2012 10:06 pm

the problem is, your saving the variable as zero, and its loading the fact that its saved as zero when you start the game. what you should probably do is when the titlescreen appears, you should set player lives to 3, then use saveVars to save it
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: I need some help... :(

Postby RippeR7420 » Tue Feb 21, 2012 2:04 am

Thanks for the advice Fojam :)
but what I ended up doing was only making it save when I finished the level. Used Lives.textNumber = Lives.textNumber -1; and had it load the GameOver.dat
file if the lives reached 0.
CURRENT PROJECTS:

-Olo: The Sword Shaman http://game-editor.com/forum/viewtopic.php?f=4&t=12919

-The Wrath of Blob: (On the back burner)

-StickMcGee - Blast to the Future http://game-editor.com/forum/viewtopic.php?f=4&t=13660
User avatar
RippeR7420
 
Posts: 391
Joined: Mon Apr 27, 2009 4:16 pm
Location: Salt Lake City, Utah.
Score: 23 Give a positive score

Re: I need some help... :(

Postby Antxion » Tue Apr 10, 2012 11:41 am

if your still using move to you should probably change that to a separate game, easier saves and space :D
"Only through fire is a strong sword forged."
May the force be with you.
User avatar
Antxion
 
Posts: 22
Joined: Sun Mar 25, 2012 1:04 am
Score: 0 Give a positive score


Return to GE - General

Who is online

Users browsing this forum: No registered users and 1 guest