Game Development Community

Point me in the right direction, plz.

by Brian Chaon · in Torque Game Builder · 01/28/2009 (1:59 pm) · 3 replies

I am a designer by trade not so much a scriptor or a programer. I undersand it and GG has a lot of great tutorials and information.
We are working on a project that is going well. Some how I got
put in charge of scripting. It has not been to bad with TGB and
I'm learning a lot as i go.

ANYWAY, I am coming up to the point where i need to make a game save feature. Is there a tutorial on this or further information?

What my goal is, is to beable to have unlockable levels. When the player
starts up the game the levels they have previously unlocked will be unlocked.

I'm sure someone has asked this before, but i havent found an answer just yet. Or possibly this is really easy and I'm just missing it.

#1
01/29/2009 (2:41 pm)
It's actually surprisingly easy to do this. You will need to use an object called "simGroups". etc. I'm not at home right now so I can't copy you the solution.. but you will need to create a simGroup and fill it with the info you want.

psuedo code here, ghasp!
$levelGroup = new simGroup(levelGroup);

function InitializeLevelGroup()


  %newlevel=new simObject()
  {
    %levelname="level1"
    %finished="false"
  }

  %newlevel=new simObject()
  {
    %levelname="level2"
    %finished="false"
  }

  levelGroup.add(%newlevel1);
  levelGroup.add(%newlevel2);

  levelGroup.save;
}

function startGame()
{
  exec(levelGroup);
}

Before people go and say "oh no don't hardcode the level names, make a helper class!" I shall say poo-poo to you sir, that's all you get for free! Just kidding.. that's not complete but it shows you most of the elements.. and typos i'm sure.. now keep on keepin kinky turtle!
-nic
#2
01/29/2009 (2:47 pm)
Oh and you'll need a function that checks to see if you're level is complete by finding the name of the level, pulling the object out and checking the "finished" field. The level name should actually probably be put in the generic field given to all simGroups called something like "objectName" or something. then you can actually call a helper class of "simObject's" that will say like:
%levelObj = getObject(level1);

if (levelObj.finished)
{
  //allow you to go to this level
}

PS, I would love it if I could just be a designer as for me that's certainly the funnest part for me. Sadly if I just designed all day, I would just have a notebook full of ideas. Go team!
#3
02/12/2009 (2:11 pm)
I just noticed the reply. Thanks a ton. I will try it out in the next day or so.

As for the designer end of me. I was a full time graphic designer and also worked in advertising. Then I went back to school for game design. I love doing level design and asset design. If I could get paid to sit with a notebook and come up with game ideas all day, that would be a dream job. But I haven't seen a guy on couch with notebook job opening yet. I will let you know, maybe we could compete for the position.