How to Load a Level
by Crimson Rum Khulay Gin · in Technical Issues · 09/24/2007 (6:42 pm) · 12 replies
Hello guys! I'm actually very new to torque. I'm currently using the demo version finding out if I should be buying Torque. Anyway, I'm from 3DGS where concept of levels exists so I am wondering if there is a simmilar intrinsic function here in torque that simply loads levels (or missions). I tried the documents but I had no access to it. Thanks a lot in advance guys.
#2
Thank you so much in advance everyone.
09/24/2007 (8:12 pm)
Thanks a lot for the quick reply. I was just wondering if there is one (just one) ready made function that loads a level you made using the mission editor. It's just that i want to create a game from scratch (not modify the demo) using the torque script. Would there be a function in Torque Script that simply loads a .MIS file just like that?Thank you so much in advance everyone.
#3
Load_Mission ("resource/missions/sample_mission.mis");
Thank you so much... :-)
09/24/2007 (9:58 pm)
BTW... the function or code I'm referring to is something that takes a filename as a parameter. Perhaps something like:Load_Mission ("resource/missions/sample_mission.mis");
Thank you so much... :-)
#4
Where GameDirectory = your games base directory and MissionName.mis = the name of the level's .mis file.
09/24/2007 (10:14 pm)
Yes Crimson, there is, and it is called loadMission. You would use it like this:loadMission("GameDirectory/data/missions/MissionName.mis");Where GameDirectory = your games base directory and MissionName.mis = the name of the level's .mis file.
#5
09/24/2007 (10:20 pm)
OMG!!! Thanks a lot Ethan.... I've been looking for this one!!! Thank thank thanks a lot!!!
#6
Well, the way I'm currently trying to learn things now is by doing stuff from ground up. I found these really great tutorials written by Sir Patterson. For the first time, with his tutorial, I learned how TorqueScript really works. I also learned that .mis and .gui files are nothing more than code themselves.
The LoadMission() function apparently was defined through Torquescript in the common folder and as it turns out, there is no hardcoded way of invoking levels since they too are mere scripts. Thus LoadMission didn't work.
okay, I already learned how to define Missions manually including the terrain, sun and sky. The question is, HOW DO I MAKE THEM VISIBLE?
Well... the usuall definition here doesn't seem to display anything.
new simGroup(MissionGroup) {
new missionArea(MissionArea) {
};
new sky(Sky) {
};
new terrainBlock(Terrain) {
};
};
Asuming I have all the dependencies (picture files, .ter files) up to speed, how do I load them? Or at least, what are the prerequisites (aside from declaring them) that I need to accomplish? There doesn't seem to be .visible property/flag that I can set to TRUE to display them. After defining the MissionGroup (and terrain, sun, sky, etc) object/s, what do I do next?
Thanks a lot in advance :)
10/18/2007 (10:50 am)
Hello again guys :)Well, the way I'm currently trying to learn things now is by doing stuff from ground up. I found these really great tutorials written by Sir Patterson. For the first time, with his tutorial, I learned how TorqueScript really works. I also learned that .mis and .gui files are nothing more than code themselves.
The LoadMission() function apparently was defined through Torquescript in the common folder and as it turns out, there is no hardcoded way of invoking levels since they too are mere scripts. Thus LoadMission didn't work.
okay, I already learned how to define Missions manually including the terrain, sun and sky. The question is, HOW DO I MAKE THEM VISIBLE?
Well... the usuall definition here doesn't seem to display anything.
new simGroup(MissionGroup) {
new missionArea(MissionArea) {
};
new sky(Sky) {
};
new terrainBlock(Terrain) {
};
};
Asuming I have all the dependencies (picture files, .ter files) up to speed, how do I load them? Or at least, what are the prerequisites (aside from declaring them) that I need to accomplish? There doesn't seem to be .visible property/flag that I can set to TRUE to display them. After defining the MissionGroup (and terrain, sun, sky, etc) object/s, what do I do next?
Thanks a lot in advance :)
#7
I suggest you trace the LoadMission function. it's may not do exactly what you want, but as you mentioned, it's in script and it works with the default folder setup. you need to fish through this function and all the functions called subsequently and try to differentiate between the things which are required, and the things that would be considered game-specific. It's not easy but it's possible.
10/18/2007 (11:35 am)
Crimson I commend you attempting to do things from the ground up. Thats really the best way to learn torque.I suggest you trace the LoadMission function. it's may not do exactly what you want, but as you mentioned, it's in script and it works with the default folder setup. you need to fish through this function and all the functions called subsequently and try to differentiate between the things which are required, and the things that would be considered game-specific. It's not easy but it's possible.
#8
10/18/2007 (3:45 pm)
Whenever I use the loadMission function, It always trys to load the Barebones mission and then just sits there and says "waiting for server" . I am sure I am giving it the correct path to my mission. Anyone else had this issue?
#9
10/18/2007 (7:49 pm)
Yost check the console.log file to see at what point during mission load that the game is hanging.
#10
10/19/2007 (8:11 am)
Thanks, I looked in the log and It said that it couldn't find the mission file, I fixed it by changing the path from ~/data/missions/test.mis to starter.fps/data/missions/test.mis. I thought the tilde meant to start in the base directory but I must have been wrong! thanks for your help
#11
10/21/2007 (2:57 pm)
I think to start in the base directory you use a period? "./data/missions/test.mis" But I haven't tried using either way, heh.
#12
Is there at least anyone here who has made a custom mission loading function. Perhaps something that works without all of the default scripts?
Thanks...
10/22/2007 (3:15 am)
Hello again guys :)Is there at least anyone here who has made a custom mission loading function. Perhaps something that works without all of the default scripts?
Thanks...
Torque Owner Johnny Hill
You can build assets externally buildings, players, items etc., Then once you load torque you can use those assets to design a mission using the built-in world editor. You can save that level (mission) you design within torque. And using scripts you can launch that mission (level) during runtime. Missions, levels, zones its all means the same thing the playfield enviroment. :)
The lion-share of the info is definitely in the owner forums. hope this small bit of info helps.