TGE Noob: #2 Empty Places
by Richard Bottoms · in Torque Game Engine · 03/13/2005 (5:04 pm) · 3 replies
I am starting a series of posts called TGE Noob. I'll try to give answers to some of the more maddening things if you are just coming to TGE.
#2. Empty Places.
New users often want to create an clean slate to practice on. Unfortunately there's no script yet to create an empty world so you have strip stuff out of an existing one.
Fire up the starter.fps demo. Launch Stronghold.
Press F11
Press F7
Set Min Terrain Height ot 5 meters, Height Range to 30 meters.
Click Apply
Click Operation
Click Smooth Ridges/Valleys
Click Apply
File ->Save Mission As.mis
Press F11
Press Escape, Exit the Mission
Fire up your text editor and fined. Open SDK/example/starter.fps/data/missions/.mis
Delete stuff so you end up like this:
//--- OBJECT WRITE BEGIN ---
new SimGroup(MissionGroup) {
new ScriptObject(MissionInfo) {
name = "";
desc0 = "Cool game.";
};
new MissionArea(MissionArea) {
...
}
new Sky(Sky) {
...
}
new Sun() {
...
}
new fxSunLight(sunflare1) {
...
}
new fxSunLight(sunflare2) {
...
}
new TerrainBlock(Terrain) {
...
}
};
//--- OBJECT WRITE END ---
Change this line so it reads like so:
fogVolume1 = "0 0 0";
Save the file.
Go back to the starter.fps game, Click Start and choose your mission
The Ogre will fall out of the sky onto empty ground.
The bottom line:
Unfortunatey you have to scrape stuff out instead of working with a blank scene generatorwritten in Python (strong hint). But now you have an empty game.
Big brains:
Okay who knows how to make the Orge spawn at ground level?
#2. Empty Places.
New users often want to create an clean slate to practice on. Unfortunately there's no script yet to create an empty world so you have strip stuff out of an existing one.
Fire up the starter.fps demo. Launch Stronghold.
Press F11
Press F7
Set Min Terrain Height ot 5 meters, Height Range to 30 meters.
Click Apply
Click Operation
Click Smooth Ridges/Valleys
Click Apply
File ->Save Mission As
Press F11
Press Escape, Exit the Mission
Fire up your text editor and fined. Open SDK/example/starter.fps/data/missions/
Delete stuff so you end up like this:
//--- OBJECT WRITE BEGIN ---
new SimGroup(MissionGroup) {
new ScriptObject(MissionInfo) {
name = "
desc0 = "Cool game.";
};
new MissionArea(MissionArea) {
...
}
new Sky(Sky) {
...
}
new Sun() {
...
}
new fxSunLight(sunflare1) {
...
}
new fxSunLight(sunflare2) {
...
}
new TerrainBlock(Terrain) {
...
}
};
//--- OBJECT WRITE END ---
Change this line so it reads like so:
fogVolume1 = "0 0 0";
Save the file.
Go back to the starter.fps game, Click Start and choose your mission
The Ogre will fall out of the sky onto empty ground.
The bottom line:
Unfortunatey you have to scrape stuff out instead of working with a blank scene generatorwritten in Python (strong hint). But now you have an empty game.
Big brains:
Okay who knows how to make the Orge spawn at ground level?
#2
Also, referencing my OP, does this affect the default character spawned in the game or add a completely new one?
Thanks.
03/13/2005 (6:26 pm)
Thanks for the post, but this is also an opportunity to suggest how this resource will work best. You posted some code, but I don't know where to put it. Assume Noobs need path names and or file names for anything you post.Also, referencing my OP, does this affect the default character spawned in the game or add a completely new one?
Thanks.
#3
SDK/example/starter.fps/data/missions/.mis:
new SimGroup(PlayerDropPoints) {
new SpawnSphere() {
position = "0 0 72";
rotation = "0 0 -1 161";
scale = "1 1 1";
dataBlock = "SpawnSphereMarker";
radius = "1";
sphereWeight = "100";
indoorWeight = "100";
outdoorWeight = "100";
lockCount = "0";
locked = "false";
homingCount = "0";
};
};
He still lands 5 or ten feet off the ground.
Bottom line:
This entry is processed in:
SDK/example/starter.fps/server/scripts/games.cs
function pickSpawnPoint()
{
%groupName = "MissionGroup/PlayerDropPoints";
%group = nameToID(%groupName);
if (%group != -1) {
%count = %group.getCount();
if (%count != 0) {
%index = getRandom(%count-1);
%spawn = %group.getObject(%index);
return %spawn.getTransform();
}
else
error("No spawn points found in " @ %groupName);
}
else
error("Missing spawn points group " @ %groupName);
// Could be no spawn points, in which case we'll stick the
// player at the center of the world.
return "0 0 300 1 0 0 0";
}
Big brains:
What needs to change to make him spawn exactly on the ground?
03/13/2005 (7:02 pm)
Here's what you add to tell your character where to spawn. It's in:SDK/example/starter.fps/data/missions/
new SimGroup(PlayerDropPoints) {
new SpawnSphere() {
position = "0 0 72";
rotation = "0 0 -1 161";
scale = "1 1 1";
dataBlock = "SpawnSphereMarker";
radius = "1";
sphereWeight = "100";
indoorWeight = "100";
outdoorWeight = "100";
lockCount = "0";
locked = "false";
homingCount = "0";
};
};
He still lands 5 or ten feet off the ground.
Bottom line:
This entry is processed in:
SDK/example/starter.fps/server/scripts/games.cs
function pickSpawnPoint()
{
%groupName = "MissionGroup/PlayerDropPoints";
%group = nameToID(%groupName);
if (%group != -1) {
%count = %group.getCount();
if (%count != 0) {
%index = getRandom(%count-1);
%spawn = %group.getObject(%index);
return %spawn.getTransform();
}
else
error("No spawn points found in " @ %groupName);
}
else
error("Missing spawn points group " @ %groupName);
// Could be no spawn points, in which case we'll stick the
// player at the center of the world.
return "0 0 300 1 0 0 0";
}
Big brains:
What needs to change to make him spawn exactly on the ground?
Torque 3D Owner Ted Southard
Works pretty well too. Enjoy.