Level realisation
by Dirk Hoffmann · in Torque Game Engine · 09/10/2005 (9:52 am) · 12 replies
Hello,
Anyone out there who knows, how to realise different Levels with Torque. Lets say, at a certain score of points level 2 is reached and so one ...
Until now I havent found a way.
Thanks in advance
Dirk
Anyone out there who knows, how to realise different Levels with Torque. Lets say, at a certain score of points level 2 is reached and so one ...
Until now I havent found a way.
Thanks in advance
Dirk
#2
--
Hans
09/10/2005 (10:49 am)
Hmm, are you talking about levels as in experience points and advancement?--
Hans
#3
You can change a mission with the command
schedule(0,0,loadMission,\"starter.fps/data/missions/mission2.mis\");
So if you track the score somewhere you could call a command like that and change the mission if a certain amount of points is exceeded.
09/10/2005 (10:56 am)
I think you are talking about changing a mission (a.k.a a level) when certain conditions are met?You can change a mission with the command
schedule(0,0,loadMission,\"starter.fps/data/missions/mission2.mis\");
So if you track the score somewhere you could call a command like that and change the mission if a certain amount of points is exceeded.
#4
Dirk, yes you are right, under certain circumstances i want to change the mission file. I will try out your proposal and let you know if it worked!!
p.s. sorry for my rookie-questions as i am new to torque programming
Dirk H.
09/11/2005 (2:55 am)
Thanks to all!!Dirk, yes you are right, under certain circumstances i want to change the mission file. I will try out your proposal and let you know if it worked!!
p.s. sorry for my rookie-questions as i am new to torque programming
Dirk H.
#5
09/11/2005 (4:35 am)
Im sure everyone who has come in here has been new to torque programming at one time or another^_~ keep it up and youll soon be like the rest of em :).
#6
I tried out your suggestion.
I use the following:if(%val>1000)
{
schedule(0,0,loadMission,\"control/data/maps/book_ch5.mis\",true);
}
The machine loads something but then freezes. I had a look in the several common modules, but wasnt able to fix the problem yet. Perhaps someone out there already encountered the same problem of freezin the game when trying to load a new level(map)
Thanks
Dirk
09/11/2005 (11:40 pm)
Dirk,I tried out your suggestion.
I use the following:if(%val>1000)
{
schedule(0,0,loadMission,\"control/data/maps/book_ch5.mis\",true);
}
The machine loads something but then freezes. I had a look in the several common modules, but wasnt able to fix the problem yet. Perhaps someone out there already encountered the same problem of freezin the game when trying to load a new level(map)
Thanks
Dirk
#7
09/12/2005 (12:03 am)
Hmmm, not really, altough I was using a trigger. What does console log says?
#8
@dirk: in what routine do you call this? Did you check that it is not called several times in a row? And (just to make sure) does the level load ok when selected from the mission select box at startup?
09/12/2005 (3:07 am)
Yes, from a trigger this should work fine.@dirk: in what routine do you call this? Did you check that it is not called several times in a row? And (just to make sure) does the level load ok when selected from the mission select box at startup?
#9
console log says:
*** ENDING MISSION
*** LOADING MISSION: control/data/maps/mymissionfile.mis
*** Stage 1 load
*** Stage 2 load
Executing control/data/maps/mymissionfile.mis
*** Mission loaded
*** Sending mission load to client: control/data/maps/mymissionfile.mis
then it stops, music still running, everything else freezes, i even cant deactivate console log.
I also tried it from a trigger, same result.
There the function is as follows:
function TempleOfEvilTrigger::onLeaveTrigger( %this, %trigger, %obj )
{
echo( "The player has just left the Temple of Evil! - The player lives to fight another day!");
schedule(0,0,loadMission,"control/data/maps/book_ch5.mis",true);
Parent::onLeaveTrigger( %this, %trigger, %obj );
}
09/12/2005 (1:40 pm)
Hi,console log says:
*** ENDING MISSION
*** LOADING MISSION: control/data/maps/mymissionfile.mis
*** Stage 1 load
*** Stage 2 load
Executing control/data/maps/mymissionfile.mis
*** Mission loaded
*** Sending mission load to client: control/data/maps/mymissionfile.mis
then it stops, music still running, everything else freezes, i even cant deactivate console log.
I also tried it from a trigger, same result.
There the function is as follows:
function TempleOfEvilTrigger::onLeaveTrigger( %this, %trigger, %obj )
{
echo( "The player has just left the Temple of Evil! - The player lives to fight another day!");
schedule(0,0,loadMission,"control/data/maps/book_ch5.mis",true);
Parent::onLeaveTrigger( %this, %trigger, %obj );
}
#10
Me once again.
Perhaps it is necessary to start the mission once again via a certain function, but i didnt find a hint.
Dirk
09/12/2005 (1:43 pm)
Hi,Me once again.
Perhaps it is necessary to start the mission once again via a certain function, but i didnt find a hint.
Dirk
#11
I just tried it, and everything works fine.
a) the short version:
the name of the mission file is wrong, or the mission file is missing.
b) the long version:
- download the tutorial base and the triggers example. follow the steps in the triggers readme (a.k.a. place a trigger somewhere on the plateau).
- create a second mission file by copying test1.mis to test2.mis. Open the test2.mis with notepad and delete the terrain block (so you can see a difference between the two missions)
- in the event onEnterTrigger enter the command:
schedule(0,0,loadMission,"tutorial.base/data/missions/test2.mis",true);
So when loading the mission, go to the trigger and - voila - the new mission will be loaded.
09/12/2005 (2:07 pm)
Obviously you follow the examples at codesamplers.com (which is a good thing).I just tried it, and everything works fine.
a) the short version:
the name of the mission file is wrong, or the mission file is missing.
b) the long version:
- download the tutorial base and the triggers example. follow the steps in the triggers readme (a.k.a. place a trigger somewhere on the plateau).
- create a second mission file by copying test1.mis to test2.mis. Open the test2.mis with notepad and delete the terrain block (so you can see a difference between the two missions)
- in the event onEnterTrigger enter the command:
schedule(0,0,loadMission,"tutorial.base/data/missions/test2.mis",true);
So when loading the mission, go to the trigger and - voila - the new mission will be loaded.
#12
Yes you are right, i tried it out exactly the way you explained. It works.
Thank you so much!!!
Regards
Dirk
09/17/2005 (2:59 am)
Dirk,Yes you are right, i tried it out exactly the way you explained. It works.
Thank you so much!!!
Regards
Dirk
Associate David Montgomery-Blake
David MontgomeryBlake