Game Development Community

Help with adding static objects

by Robert Southwell · in Torque Game Engine · 11/20/2007 (2:16 am) · 4 replies

Hello all. Let me preface this by saying that I am a newbie to the Torque engine. I just starting taking a class around two weeks ago that uses Torque. We are using the 3D Game Programming All-in-One book by Mr. Finney. I know programming fairly well so picking up the torquescript syntax was fairly easy. The problem I am having lies with the World Editor Creator.

I have a basic outline of a game already built that can be expanded upon (the game that 3DGPAIO has you build). My class deals mostly with level modification and design so I was trying to use the world editor creator to add objects (via their .dts files) to my level and move them to the appropriate location. I opened the mission my game uses so that I could add additional objects in it. Everything appears to work fine in the world editor. I move the objects to where I think they should go and then I save the mission to the appropriate directory where my game is. I then go and load up my game but none of the objects I created get loaded! So I check my console.log file and the message I get is:

Executing control/data/maps/book_ch5.mis.
TSStatic::onAdd: unable to load shape: control/Test/EMAGA5/control/data/shapes/trees/tree.dts
control/data/maps/book_ch5.mis (0): Register object failed for object (null) of class TSStatic.
TSStatic::onAdd: unable to load shape: control/Test/EMAGA5/control/data/shapes/trees/tree.dts
control/data/maps/book_ch5.mis (0): Register object failed for object (null) of class TSStatic.
TSStatic::onAdd: unable to load shape: control/Test/EMAGA5/control/data/shapes/trees/tree.dts
control/data/maps/book_ch5.mis (0): Register object failed for object (null) of class TSStatic.
TSStatic::onAdd: unable to load shape: control/Test/EMAGA5/control/data/shapes/trees/tree.dts
control/data/maps/book_ch5.mis (0): Register object failed for object (null) of class TSStatic.

That didn't tell me much. I am not experienced enough with torque to know how to hook objects to a scene properly. I tried a few different things. I opened up the book_ch5.mis file and the file showed that the items were created with the appropriate path to the model inserted.

I also tried messing around with the staticshapedata datablock and the TSStatic::create method but nothing seems to be working.

Anyone able to enlighten me as to what I am doing wrong? I just want to add some trees!

About the author

Recent Threads


#1
11/20/2007 (5:58 am)
Basically that message means it cant find the file "control/Test/EMAGA5/control/data/shapes/trees/tree.dts" so it cant create a TSStatic using that. It looks to me like you have the .mis in an odd directory possibly. Could you post the relevant section of the .mis file? Or just post the entire control/data/maps/book_ch5.mis so i can get a better idea of whats going on.
#2
11/20/2007 (4:02 pm)
Here is the entire .mis file in all its glory.

//--- OBJECT WRITE BEGIN ---
new SimGroup(MissionGroup) {

new ScriptObject(MissionInfo) {
name = "Book B - Chapter 5 version";
desc0 = "A map with lots of representative things that relate to gameplay.";
};
new MissionArea(MissionArea) {
Area = "-152 -352 1040 1056";
flightCeiling = "300";
flightCeilingRange = "20";
locked = "true";
};
new Sky(Sky) {
position = "-1088 -928 0";
rotation = "1 0 0 0";
scale = "1 1 1";
materialList = "./sky_day.dml";
cloudHeightPer[0] = "0.349971";
cloudHeightPer[1] = "0.25";
cloudHeightPer[2] = "0.199973";
cloudSpeed1 = "0.0002";
cloudSpeed2 = "0.0004";
cloudSpeed3 = "0.0006";
visibleDistance = "1100";
fogDistance = "1000";
fogColor = "0.82 0.828 0.844 1";
fogStorm1 = "0";
fogStorm2 = "0";
fogStorm3 = "0";
fogVolume1 = "500 0 100";
fogVolume2 = "0 0 0";
fogVolume3 = "0 0 0";
fogVolumeColor1 = "128 128 128 -2.22768e+038";
fogVolumeColor2 = "128 128 128 0";
fogVolumeColor3 = "128 128 128 -1.70699e+038";
windVelocity = "0.1 0.1 0";
windEffectPrecipitation = "1";
SkySolidColor = "0.547 0.641 0.789 0";
useSkyTextures = "1";
renderBottomTexture = "0";
noRenderBans = "0";
locked = "true";
};
new Sun() {
azimuth = "0";
elevation = "35";
color = "0.888 0.885 0.78 1";
ambient = "0.4 0.4 0.4 1";
rotation = "1 0 0 0";
scale = "1 1 1";
locked = "true";
direction = "0.635001 0.635001 -0.439941";
position = "0 0 0";
};
new TerrainBlock(terrain) {
rotation = "1 0 0 0";
scale = "1 1 1";
detailTexture = "./detail1";
terrainFile = "./book_ch5.ter";
squareSize = "8";
bumpScale = "1";
bumpOffset = "0.01";
zeroBumpScale = "8";
tile = "1";
locked = "true";
position = "-1024 -1024 0";
};
new WaterBlock(water) {
position = "-1024 -1024 0";
rotation = "1 0 0 0";
scale = "2048 2048 125";
UseDepthMask = "1";
surfaceTexture = "~/data/maps/water_center";
ShoreTexture = "~/data/maps/water_edge";
envMapOverTexture = "~/data/maps/storm_env";
specularMaskTex = "~/data/maps/water_spec";
liquidType = "OceanWater";
density = "1";
viscosity = "15";
waveMagnitude = "3";
surfaceOpacity = "0.2";
envMapIntensity = "1";
TessSurface = "50";
TessShore = "60";
SurfaceParallax = "1";
FlowAngle = "220";
FlowRate = "0.1";
DistortGridScale = "0.1";
DistortMag = "0.1";
DistortTime = "2";
ShoreDepth = "14";
DepthGradient = "1";
MinAlpha = "0.01";
MaxAlpha = "0.4";
tile = "1";
removeWetEdges = "0";
specularColor = "1 0.8 0.46 1";
specularPower = "10";
params1 = "0.63 -2.41 0.33 0.21";
params0 = "0.32 -0.67 0.066 0.5";
textureSize = "32 32";
params2 = "0.39 0.39 0.2 0.133";
locked = "true";
Extent = "100 100 10";
floodFill = "1";
seedPoints = "0 0 1 0 1 1 0 1";
params3 = "1.21 -0.61 0.13 -0.33";
};
new TSStatic() {
position = "251.069 125.566 128";
rotation = "1 0 0 0";
scale = "1 1 1";
shapeName = "~/data/shapes/trees/tree3.dts";
};
new TSStatic() {
position = "241.801 146.38 128.792";
rotation = "1 0 0 0";
scale = "1 1 1";
shapeName = "~/data/shapes/trees/tree3.dts";
};
new TSStatic() {
position = "245.498 191.882 126.6";
rotation = "1 0 0 0";
scale = "1 1 1";
shapeName = "~/data/shapes/trees/tree.dts";
};
new TSStatic() {
position = "266.596 132.841 129.201";
rotation = "1 0 0 0";
scale = "1 1 1";
shapeName = "~/data/shapes/trees/shrub.dts";
};
new TSStatic(aTree1) {
position = "290.401 140.954 128.01";
rotation = "1 0 0 0";
scale = "1 1 1";
shapeName = "~/data/shapes/trees/tree3.dts";
};
new TSStatic(aTree) {
position = "290.665 153.286 128.238";
rotation = "1 0 0 0";
scale = "1 1 1";
shapeName = "~/data/shapes/trees/tree3.dts";
};
new TSStatic() {
position = "259.054 151.9 128.881";
rotation = "1 0 0 0";
scale = "1 1 1";
shapeName = "~/data/shapes/campfires/campfire.dts";
};
new TSStatic() {
position = "262.921 148.218 129.881";
rotation = "1 0 0 0";
scale = "1 1.64084 1.60834";
shapeName = "~/data/shapes/player/player.dts";
};
new Lightning(myLightening) {
position = "183.4 0 157.881";
rotation = "1 0 0 0";
scale = "512 512 300";
dataBlock = "LightningStorm";
strikesPerMinute = "12";
strikeWidth = "2.5";
strikeRadius = "20";
color = "1 1 1 1";
fadeColor = "0.1 0.1 1 1";
chanceToHitTarget = "0.5";
boltStartRadius = "20";
useFog = "1";
};
new Precipitation(myPrecipitation) {
position = "183.4 0 157.881";
rotation = "1 0 0 0";
scale = "1 1 1";
dataBlock = "HeavyRain";
minSpeed = "1.5";
maxSpeed = "2";
minMass = "0.75";
maxMass = "0.85";
maxTurbulence = "0.1";
turbulenceSpeed = "0.2";
rotateWithCamVel = "1";
useTurbulence = "0";
numDrops = "5000";
boxWidth = "200";
boxHeight = "100";
doCollision = "1";
};
new TSStatic() {
position = "183.4 0 157.881";
rotation = "1 0 0 0";
scale = "1 1 1";
shapeName = "~/EMAGA5/control/data/models/items/healthKit.dts";
};
new TSStatic() {
position = "-7.45058e-009 -0.0380952 -0.204762";
rotation = "1 0 0 0";
scale = "1 1 1";
shapeName = "~/EMAGA5/control/data/models/items/healthKit.dts";
};
new TSStatic() {
position = "273.422 143.342 130.61";
rotation = "1 0 0 0";
scale = "1 1 1";
shapeName = "~/EMAGA5/control/data/models/items/healthKit.dts";
};
new TSStatic() {
position = "271.092 141.094 130.457";
rotation = "1 0 0 0";
scale = "1 1 1";
shapeName = "~/EMAGA5/control/data/models/weapons/crossbow.dts";
};
};
//--- OBJECT WRITE END ---
#4
11/20/2007 (10:21 pm)
You are a lifesaver :). After what you said I went back and too a long hard look at the paths that were specified and sure enough that was the problem. The difficulty I was having occured mainly because I ended up moving my entire game folder into the root torque/demo folder because that was the only way I could use the world editor on my level. So I moved my game folder back out to the root of my harddrive and changed the paths in the .mis file to reflect that. Now my level is showing trees!

The precipitation and lightening storm I added via the world editor is still not showing up. I am getting the message:

Object 'LightningStorm' is not a member of the 'GameBaseData' data block class
control/data/maps/book_ch5.mis (0): Register object failed for object myLightening of class Lightning.
Object 'HeavyRain' is not a member of the 'GameBaseData' data block class
control/data/maps/book_ch5.mis (0): Register object failed for object myPrecipitation of class Precipitation.

That may be a path issue as well since I moved my game folder but that is a problem for another day. I gained a level in my understanding of torque :). Thank you for your assistance!