Need Help...

Non-platform specific questions.

Need Help...

Postby RippeR7420 » Fri Sep 02, 2011 1:37 am

is it possible to save a score from one GED file(levelOne.exe). And load it into another GED(levelTwo.exe)? I've tried using saveVars/loadVars but I can't seem to get it to work.... please help!!!

Plus 1 to anyone who helps :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: Need Help...

Postby ikarus » Fri Sep 02, 2011 2:18 am

It's easy, just make some variables and give them a group with the add variable dialog, and make sure they're all in the same group. Then use saveVar() to save the group to a file, like level.buf, whatever can be any name you wish and then in the next level use loadVars() to load the same group from the same file in the next level^-^
>>>>>>>>>>>>>>>>>>>>> http://www.code1011.com <<<<<<<<<<<<<<<<<<<<<<<
ikarus
 
Posts: 143
Joined: Fri Aug 12, 2011 3:06 am
Score: 11 Give a positive score

Re: Need Help...

Postby RippeR7420 » Fri Sep 02, 2011 2:32 am

Iv'e been trying that but it isn't working...

this is what i've been doing:



In LVL1.exe i put this code in:
Code: Select all
saveVars("score.file", "nscore");
Score=SCORE.textNumber;




then in LVL2.exe I put this code in:
Code: Select all
loadVars("score.file", "nscore");


I'm not sure Where exactly I need to put the codes in at though...
Where would I need to put in my saveVars in LVL1.exe? and where would I put the loadVars in LVL2?

Thank you so much for your help :)
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: Need Help...

Postby RippeR7420 » Fri Sep 02, 2011 2:34 am

and the variables don't transfer .GED files... So I would have to make new ones in each game, with the same name(NAME: score GROUP: savescore) right?
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: Need Help...

Postby Jagmaster » Fri Sep 02, 2011 3:12 am

Yes, you need them to be exactly the same in order for it to work. So what I like to do is actually copy and paste the variable names into the new ged to make sure there were no typos. (Or if it was a small project, I just save as, or merge into a new doc.)
Another thing, you need to reverse the order of your lvl1 script. If I understand correctly, you're trying save the textnumber to a global variable. Right now you have it so it will save the vars and then get the vars, but you'd probably want to get the var (from score textnumber) and then save the vars.
Hope this helped a little. :)
User avatar
Jagmaster
 
Posts: 875
Joined: Sun May 08, 2011 4:14 pm
Location: Not where you think.
Score: 82 Give a positive score

Re: Need Help...

Postby ikarus » Fri Sep 02, 2011 3:36 am

saveVars("score.file", "nscore");
Score=SCORE.textNumber;


Is that the actual code? You should probably set the variable before saving it. It looks like you're saving it then setting it

[edit]
Jagmaster beat me :P
>>>>>>>>>>>>>>>>>>>>> http://www.code1011.com <<<<<<<<<<<<<<<<<<<<<<<
ikarus
 
Posts: 143
Joined: Fri Aug 12, 2011 3:06 am
Score: 11 Give a positive score

Re: Need Help...

Postby RippeR7420 » Fri Sep 02, 2011 4:41 am

oh, okay:)

When I put it in the First GED(LVL1.exe) where do I put it?
right now I have it set like this:

Player->Collision->any side of Exit Door->Reapeat(No)->Script Editor->
Code: Select all
hscore=SCORE.textNumber;
 saveVars("h.file", "nscore");



and then In the second GED(LVL2.exe) like this:


Score(text)->Create Actor->Script Editor:
Code: Select all
SCORE.textNumber = hscore;
 loadVars("h.file", "nscore");


and it still won't work...

Am I putting it in the wrong places? i.e( Collision, Create, etc...)

Thank you guys soooo much!!
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: Need Help...

Postby ikarus » Fri Sep 02, 2011 4:46 am

SCORE.textNumber = hscore;
loadVars("h.file", "nscore");


Flip those two there to:

Code: Select all
loadVars("h.file", "nscore");
SCORE.textNumber = hscore;


See you're setting the score before you load it
>>>>>>>>>>>>>>>>>>>>> http://www.code1011.com <<<<<<<<<<<<<<<<<<<<<<<
ikarus
 
Posts: 143
Joined: Fri Aug 12, 2011 3:06 am
Score: 11 Give a positive score

Re: Need Help...

Postby RippeR7420 » Fri Sep 02, 2011 6:12 am

ahhh!! Thank you SOOOO much! another +1!!!

:) :D :)

You just saved my life and didn't even know it! haha
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: Need Help...

Postby Jagmaster » Fri Sep 02, 2011 2:22 pm

All things in any kind of programming are done in order form left to right and top to bottom. There is a little paragraph on inheritance in this article that might be interesting to you. http://game-editor.com/Advanced_programming_logic One can do many things with little script with the power of inheritance! :D
User avatar
Jagmaster
 
Posts: 875
Joined: Sun May 08, 2011 4:14 pm
Location: Not where you think.
Score: 82 Give a positive score

Re: Need Help...

Postby RippeR7420 » Mon Sep 05, 2011 4:11 am

Awesome :D thanks Jag! Plus 1!
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


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest