Unlocking and locking Mission levels
by Will Zettler · in Torque Game Engine Advanced · 09/30/2008 (4:49 am) · 2 replies
Hey everyone,
How do you go about making a script that locks all the missions at the start of a game and unlocks them one by one as the player progresses through the game and completes each level? I want all levels to be listed in the mission area when loading up the game but just don't want them to get access to any mission but the first when the game is run for the first time or until they complete each level. I don't mind them level jumping after they completed the game, but til they do, I want to have all missions locked and unlock them as they compleye each mission area. I thought about having a trigger of sorts when they hit the trigger it auto unlocks it (?). The only thing I found even close is http://tdn.garagegames.com/wiki/TGB/BreakoutTutorial5#Unlocking_the_Next_Level but that isn't easy to convert over to TGE(A) can someone please help?
Thanks for any help someone can give me on this... I'm not a scripting guy mainly thats why I'm asking for help. Thanks much...
Will Zettler
dlstorminc@yahoo.com
Waskom, Tx
How do you go about making a script that locks all the missions at the start of a game and unlocks them one by one as the player progresses through the game and completes each level? I want all levels to be listed in the mission area when loading up the game but just don't want them to get access to any mission but the first when the game is run for the first time or until they complete each level. I don't mind them level jumping after they completed the game, but til they do, I want to have all missions locked and unlock them as they compleye each mission area. I thought about having a trigger of sorts when they hit the trigger it auto unlocks it (?). The only thing I found even close is http://tdn.garagegames.com/wiki/TGB/BreakoutTutorial5#Unlocking_the_Next_Level but that isn't easy to convert over to TGE(A) can someone please help?
Thanks for any help someone can give me on this... I'm not a scripting guy mainly thats why I'm asking for help. Thanks much...
Will Zettler
dlstorminc@yahoo.com
Waskom, Tx
About the author
- Ambient sound artist since 2004 - Texture artist since 2001 - Terrain designer since 2006 - Android app design since 2016 - Game design (Sky Fall, A_Clone) 2018
#2
10/19/2008 (5:02 am)
Maybe adding something database related, or a flat encrypted file with a series of different states that it checks for in a GUI, is Level1 Completed = Yes, if So Unlock Level 2, allow GUI option 2 on Level Selection to show a coloured image instead of a grey'd out one, and make button clickable to load up level , and so on.
Associate Steve Acaster
[YorkshireRifles.com]
If you just want to load a new level with a trigger, look at this thread and it's links.
If you want something a bit more fancy, like unlocking levels that you can then replay (in effect add levels to the load level GUI selection box) it might go something like this.
1. Create a Master Game File (textfile type cs) which is used to store all the game info (like level progression).
2. In game when a level is completed (via a trigger), have a script write to the Master Game File to update the info and effectively unlock a level. e.g. change %level2 =0; to %level2 =1;
3. On accessing your load level GUI (from the main menu) have a script read the Master Game File, which will then display what levels have been unlocked and are thus available to play. e.g. if(%level2) = 1; display %level2 button, else hide %level2 button.
4. Loop 2 and 3 for other levels.
Currently I'm fully immersed in the problems (if it ain't one thing it's a million bloody things!) of world design and so don't have my Scripting Head on at the moment, but there's the general idea.
How to create, read and write to files can be found in the resources/forums. Don't be afraid of the search function.