Particle Emitters, Vehicles, and Crashes.
by Harold "LabRat" Brown · in Torque Game Engine · 08/14/2001 (2:18 am) · 13 replies
OK.. being one of the many people who decided to play with the vehicles from Tribes 2 I'm sure I'm not the only one who has experianced the lovely crashes when you try to turn on the Dust and Tire emitters.
Well I did find how to fix that problem, but in doing so I discovered another.
To fix the crashes you need to add Material Mapping for the terrain files (files listed below). This will allow you to turn on the Tire and Dust emitters (hoverbike is a good sample from T2) without causing the game to crash.
New Problem:
The dust emitters don't appear to be using the color / size properties of the particle definitions.
-------
data/main.cs
=============
exec("~/terrains/grassland/grasslandPropMap.cs");
data/terrains/grassland/grasslandPropMap.cs
============================================
addMaterialMapping("sand", "sound: 0");
addMaterialMapping("grass", "sound: 0");
addMaterialMapping("patchy", "sound: 0");
Well I did find how to fix that problem, but in doing so I discovered another.
To fix the crashes you need to add Material Mapping for the terrain files (files listed below). This will allow you to turn on the Tire and Dust emitters (hoverbike is a good sample from T2) without causing the game to crash.
New Problem:
The dust emitters don't appear to be using the color / size properties of the particle definitions.
-------
data/main.cs
=============
exec("~/terrains/grassland/grasslandPropMap.cs");
data/terrains/grassland/grasslandPropMap.cs
============================================
addMaterialMapping("sand", "sound: 0");
addMaterialMapping("grass", "sound: 0");
addMaterialMapping("patchy", "sound: 0");
#2
Fixed it...
Look in terrData.cc about line 696, it currently reads:
mMPMIndex[0] = pMatMap->getIndexFromName(nameBuff);
Change that to:
mMPMIndex[0] = pMatMap->getIndexFromName(fn);
Compile so you have a test Application.
Add in a footprint image named "player.png" (I used one from T2) put it in:
data/special/footprints/
Copy the particleTest.png from Tribes 2 and put it in:
data/special/
Then edit the server/scripts/player.cs, search for particleTest and replace it with data/special/particleTest (lines 478 and 514)
Next you will need to create material property files for each of the maps. And create a main.cs file in the data directory to run them. My files are listed below.
data/main.cs
============
exec("~/terrains/grassland/grasslandPropMap.cs");
exec("~/terrains/scorched/scorchedPropMap.cs");
data/terrains/grassland/grasslandPropMap.cs
===========================================
addMaterialMapping("sand" , "sound: 0" , "color: 0.46 0.36 0.26 0.4 0.0");
addMaterialMapping("grass" , "sound: 0" , "color: 0.46 0.36 0.26 0.4 0.0");
addMaterialMapping("patchy" , "sound: 0" , "color: 0.46 0.36 0.26 0.4 0.0");
data/terrains/scorched/scorchedPropMap.cs
=========================================
addMaterialMapping("scorched_lt", "sound: 0" , "color: 0.46 0.36 0.26 0.4 0.0");
addMaterialMapping("scorched_dk", "sound: 0" , "color: 0.46 0.36 0.26 0.4 0.0");
08/16/2001 (1:22 am)
Update #2Fixed it...
Look in terrData.cc about line 696, it currently reads:
mMPMIndex[0] = pMatMap->getIndexFromName(nameBuff);
Change that to:
mMPMIndex[0] = pMatMap->getIndexFromName(fn);
Compile so you have a test Application.
Add in a footprint image named "player.png" (I used one from T2) put it in:
data/special/footprints/
Copy the particleTest.png from Tribes 2 and put it in:
data/special/
Then edit the server/scripts/player.cs, search for particleTest and replace it with data/special/particleTest (lines 478 and 514)
Next you will need to create material property files for each of the maps. And create a main.cs file in the data directory to run them. My files are listed below.
data/main.cs
============
exec("~/terrains/grassland/grasslandPropMap.cs");
exec("~/terrains/scorched/scorchedPropMap.cs");
data/terrains/grassland/grasslandPropMap.cs
===========================================
addMaterialMapping("sand" , "sound: 0" , "color: 0.46 0.36 0.26 0.4 0.0");
addMaterialMapping("grass" , "sound: 0" , "color: 0.46 0.36 0.26 0.4 0.0");
addMaterialMapping("patchy" , "sound: 0" , "color: 0.46 0.36 0.26 0.4 0.0");
data/terrains/scorched/scorchedPropMap.cs
=========================================
addMaterialMapping("scorched_lt", "sound: 0" , "color: 0.46 0.36 0.26 0.4 0.0");
addMaterialMapping("scorched_dk", "sound: 0" , "color: 0.46 0.36 0.26 0.4 0.0");
#3
exec("~/terrains/grassland/grasslandPropMap.cs");
in the main file?
Anthony
08/16/2001 (5:33 pm)
does it matter where you put exec("~/terrains/grassland/grasslandPropMap.cs");
in the main file?
Anthony
#4
08/16/2001 (5:47 pm)
Yes, the order of the exec commands DOES matter. Not sure where it should go, but I know it does matter.
#5
08/16/2001 (6:02 pm)
There isn't a main.cs in the data directory by default. So it doesn't really make a difference. You will be making the file and the only 2 lines will be the ones I mentioned
#6
08/16/2001 (6:25 pm)
Sorry, i was just skimming. I thought he was putting them in the real main.cs, not the mod one. But my point is still valid: The order of exec does matter (it is the order in which the scripts are executed, so you cant exec say, vehicle_wildcat.cs before vehicle.cs.) However, Harold, you are right, in this instance it makes no difference because the files dont depend on each other. Sorry about that! :)
#7
08/16/2001 (7:51 pm)
Thanks guy s will be picking your brains later I'm SURE !!! :-)
#8
08/17/2001 (7:17 am)
Ok one more easy question that I know I'm being lazy about (but today is my dad's 80th bday so I'm not gonna waste any more time in code or on the forum) so the big question is WHERE do you TURN on the dust/tire emmiters . . I'm sure I read it once, and I'm sut all I do is change the result to true I just can't find it. Did all that work above only to forget the 1st part silly me anyway. if you tell me the filename I will praise you endlessly Thanks Anthony
#9
So, make the (x)PropMap.cs for the map, add the lines Harold/LabRat said, add the exec to the main.cs, copy the player.png footprint from Tribes 2, and the particletest.png also from Tribes 2 (as per the instructions in the many previous emails...). Once that's done, launch v12 and you should have footprints and dust puffs from anything that should have them.
-bw
08/17/2001 (8:23 am)
There is nothing to 'turn on'. The emitters are functional as is, they just need those extra files to be added for it to display properly.So, make the (x)PropMap.cs for the map, add the lines Harold/LabRat said, add the exec to the main.cs, copy the player.png footprint from Tribes 2, and the particletest.png also from Tribes 2 (as per the instructions in the many previous emails...). Once that's done, launch v12 and you should have footprints and dust puffs from anything that should have them.
-bw
#10
I'm so close and yet so far . . . .
thanks Anthony
08/17/2001 (12:00 pm)
I guees I'm lost on the "making the PropMap.cs" when I made the main.cs in data, I just copied and pasted a main from another directory and removing everything and putting in the executes. . . . I did the same process for the PropMaps . . . I know that the main works cause the console looks for the other two file when I check with "~" in the game, but it says that the two propmaps are missing!!! They ARE there, the compiler doesn't see them. Did I do something wrong, should I make fresh files with vs c++ ? I'm so close and yet so far . . . .
thanks Anthony
#12
You should have made three new *.cs files called:
data/main.cs
data/terrains/grassland/grasslandPropMap.cs
data/terrains/scorched/scorchedPropMap.cs
In those directories.
Yeouchy this got posted after you figured it out.
The footprints are pretty nifty.
08/17/2001 (12:27 pm)
Start a new text file called what he called them above (you will make three new *.cs files from three new *.txt files), then add the lines he stated to the files, and save them as *.cs (this needs to be a script file *.cs) instead of *.txt in the directories he indicated above.You should have made three new *.cs files called:
data/main.cs
data/terrains/grassland/grasslandPropMap.cs
data/terrains/scorched/scorchedPropMap.cs
In those directories.
Yeouchy this got posted after you figured it out.
The footprints are pretty nifty.
#13
Next step - Detail texture per texture and sounds..
Not only footstep sounds but wheel sounds per texture as well. err, this could get really complex though if you had a game with lots of different sound types needed (walking mech, Fast wheel, skidding wheels, running walking person etc)
Footstep puff colour, is that supposed to modify the wheel dust colour too? How would you turn off the dust on grass/concrete and still have it work on sand?
03/31/2002 (6:03 pm)
Yo, this is an important aspect which should go into CVS =D (well anything which SHOULD work but only needs a fewe tweaked lines should go straight in)Next step - Detail texture per texture and sounds..
Not only footstep sounds but wheel sounds per texture as well. err, this could get really complex though if you had a game with lots of different sound types needed (walking mech, Fast wheel, skidding wheels, running walking person etc)
Footstep puff colour, is that supposed to modify the wheel dust colour too? How would you turn off the dust on grass/concrete and still have it work on sand?
Torque Owner Harold "LabRat" Brown
This only appears to be a problem with the Tire and Lift emitters.
They are supposed to pull the color setting from the material property list, but it doesn't seem to be doing so.
Even after adding the color commands to the Material Property list.