Game Development Community

Mission selection does not switch main character

by John Burch · in Torque Game Engine · 01/01/2006 (2:21 am) · 6 replies

Hi, I've tried my best to figure this out and searched the forum. Sorry if I missed something.

Maybe I'm just not clear on the difference between a mod and a game.

I'm trying to clean up how a game is started in version 1.4. I have several mods in separate directorys under "examples". I consider each mod to be a different game with different characters and equipment. That is, I intend to deliver several games to the user and he/she can select which game to play by choosing individual icons on his system or selecting from a mod list in the game. I did not want to deliver a complete Torque installation for each game if I could make it run all these games from one installation.

Let's say I have game1 with a gun carring character and game2 with a non-gun carrying character.

A problem is that if I use -mod game1, but then choose to run game2 from the Mission selection list, I will see game2 but with the game1 character. The nongun character will then be carring a gun. And this is very bad behavior in my games.

Another problem is that if I use -mod "game1" in a bat file, the game code looks for all the other missions it can find in all the mods and presents a partial list in the mod selection gui. I see the script in startMissionGui.gui that looks for all the missions. I'll have to figure out what $Server::MissionFileSpec means and how it affects what mods are seen.

Some mods show up in the list no matter what game is launched with -mod argument. Some games only show up in the list if they are called with the -mod argument. Very wierd to never see the starter.fps or the starter.racing mod show up, but always see a few of the other mods that I have created.

I need to launch one mod from a bat file and prevent the user from choosing a different mod by not giving him the choices he sees now OR I need to be able to pick any mod from the selection list gui and get things to run right (the player playing game1 will have a gun and the player playing game2 will never have a gun). I suspect a lot of things could get switched here so I need a clean switch of everything from one mod to the other.

I'm certainly a newbie in using the engine.

If I can figure out MissionFileSpec, I can probably control what mods it finds but that may mean I always see more than one mod in the list. Or do I have to separate each mod into it's own Torque game installation? If a racing mod can coexist with a fps mod, I should not be having this problem. But maybe they both assume the same character will play them.

Thanks, any comments are appreciated,
John

#1
01/01/2006 (3:17 pm)
The feature demo has some trickery to allow racing and FPS behavior to get swapped according to mission type. This is completely different from the mod functionality in the engine, which controls what directories and in what order get loaded. Perhaps that explains your confusion?
#2
01/01/2006 (4:25 pm)
I believe the key to my confusion is understanding if it is possible to launch Torque and THEN decide which mod is to be played and have that mod use ALL it's characteristics instead of using the player from one mod and the terrain from the other. No matter which one was the "default game".

Thanks,
John
#3
01/01/2006 (5:44 pm)
The rule is pretty simple - setModPaths is called in the root main.cs with a list of mod directories. Files from each mod are scanned, in the order given. Each mod is executed and initialized in turn.

If you want to do runtime swapping of game behavior you're better off not trying to use setModPaths and related functionality to do it - that's solely for letting things get cleanly overridden, ie, replacing a set of textures or models with another, or added to, ie, adding extra functionality to an existing mod by having some additional script code run. There's no way to "rollback" a mod. If you were clever you might be able to write a simple stub script that would prompt the user for what mod they want, and then load the appropriate code and assets based on that, but that could get very tricky and it could only happen once - ie, at the very start of the app, before the main menu came up.

It's your responsibility to make sure that your datablocks & such are named properly so one mod doesn't clobber another, if that's what you want.
#4
01/01/2006 (6:00 pm)
Ben, thanks for taking the time. That tells me I need to take the simple route and install a new Game for each type that needs to boot up with specific characters.
Thank's, glad I don't have to figure it out myself from scratch. :-)
John
#5
01/01/2006 (6:27 pm)
It is possible to load all the directories in your main directory using setModPaths if you wanted to. However you wouldn't want to load all the mods(ie. exec the main.cs).

You can do this by simply tagging the directorys onto the $userMods when setModPaths is called like so:

(In this case I've eliminated the common mod, but need to set it as a mod path so the hard coded paths for certain things in the C++ don't cry)

setModPaths("common;"@$userMods);

I'm sure the functionality you want is totaly possible, but I'm not sure exactly what you want to do.

Sorry if this doesn't add anything or confuses you even more. :/
#6
01/01/2006 (7:23 pm)
Josh, no problem, I've got it finding the right mods (at least the ones that are similar enough to use the same characters and have similar tools) and will create another game installation for radically different game play.

I'm glad you guys jumped in to help.
I hope to get to the point I have something to give back to the group.

Thanks,
John