Rain/lightning problems
by Damian Connolly · in Torque Game Engine · 03/23/2005 (3:34 pm) · 13 replies
Can anyone help me with some problems to do with the rain and lightning. when i run the game i get a message in the console window saying that the precipitationData and lightningData datablocks aren't members of the shapeBaseData blocks. i don't think the program is meant to be taking them for that so obviously im doing something wrong. any hints?
#2
==========================================
*** LOADING MISSION: control/data/maps/book_ch5.mis
*** Stage 1 load
*** Stage 2 load
Executing control/data/maps/book_ch5.mis.
Object 'HeavyRain' is not a member of the 'GameBaseData' data block class
control/data/maps/book_ch5.mis (0): Register object failed for object RainStorm of class Precipitation.
Object 'LightningStorm' is not a member of the 'GameBaseData' data block class
control/data/maps/book_ch5.mis (0): Register object failed for object ElectricalStorm of class Lightning.
===========================================
heavyRain and lightningStorm are supposed to be the datablocks for the rain and lightning. how do i go about fixing this so it'll work?
thanks
03/25/2005 (5:49 am)
Ok, mistake on my part, it wasn't shapeBaseData but GameBaseData. heres the part of my log that concerns it. ==========================================
*** LOADING MISSION: control/data/maps/book_ch5.mis
*** Stage 1 load
*** Stage 2 load
Executing control/data/maps/book_ch5.mis.
Object 'HeavyRain' is not a member of the 'GameBaseData' data block class
control/data/maps/book_ch5.mis (0): Register object failed for object RainStorm of class Precipitation.
Object 'LightningStorm' is not a member of the 'GameBaseData' data block class
control/data/maps/book_ch5.mis (0): Register object failed for object ElectricalStorm of class Lightning.
===========================================
heavyRain and lightningStorm are supposed to be the datablocks for the rain and lightning. how do i go about fixing this so it'll work?
thanks
#3
03/25/2005 (6:01 am)
Can you post one of the DB's?
#4
==============================================
datablock LightningData(LightningStorm){
strikeTextures[0] = "~/data/maps/lightning.dml";
thunderSounds[0] = ThunderCrash1Sound;
thunderSounds[1] = ThunderCrash2Sound;
thunderSounds[2] = ThunderCrash3Sound;
thunderSounds[3] = ThunderCrash4Sound;
};
datablock PrecipitationData(HeavyRain){
type = 1;
materialList = "~/data/maps/rain.dml";
soundProfile = "HeavyRainSound";
sizeX = 0.1;
sizeY = 0.1;
movingBoxPer = 0.35;
divHeightVal = 1.5;
sizeBigBox = 1;
topBoxSpeed = 20;
frontBoxSpeed = 30;
topBoxDrawPer = 0.5;
bottomDrawHeight = 40;
skipIfPer = -0.3;
bottomSpeedPer = 1.0;
frontSpeedPer = 1.5;
frontRadiusPer = 0.5;
};
==============================================
then when i go into the mission file to activate them, i use this code
==============================================
new Precipitation(RainStorm){
position = "-45 -29 244";
rotation = "1 0 0 0";
scale = "1 1 1";
nameTag = "rs";
dataBlock = "HeavyRain";
offsetSpeed = "0.25";
minVelocity = "1.5";
maxVelocity = "3";
color1 = "1.0 1.0 1.0 1.0";
color2 = "-1.0 0.0 0.0 1.0";
color3 = "-1.0 0.0 0.0 1.0";
percentage = "1";
maxNumDrops = "5000";
maxRadius = "60";
};
new Lightning(ElectricalStorm){
position = "200 100 300";
rotation = "1 0 0 0";
scale = "250 400 500";
datablock = "LightningStorm";
strikesPerMinute = "30";
strikeWidth = "2.5";
chanceToHitTarget = "100";
strikeRadius = "250";
boltStartRadius = "20";
color = "1.0 1.0 1.0 1.0";
fadeColor = "0.1 0.1 1.0 1.0";
useFog = "1";
locked = "true";
};
===============================================
they're pretty much set out as in the book, unless i did something that im missing. that probably doesn't read well, how do you wrap the text so its formatted for easy reading?
thanks
03/25/2005 (6:59 am)
Heres the datablocks as defined in weather.cs. they're in the same position as described in the book==============================================
datablock LightningData(LightningStorm){
strikeTextures[0] = "~/data/maps/lightning.dml";
thunderSounds[0] = ThunderCrash1Sound;
thunderSounds[1] = ThunderCrash2Sound;
thunderSounds[2] = ThunderCrash3Sound;
thunderSounds[3] = ThunderCrash4Sound;
};
datablock PrecipitationData(HeavyRain){
type = 1;
materialList = "~/data/maps/rain.dml";
soundProfile = "HeavyRainSound";
sizeX = 0.1;
sizeY = 0.1;
movingBoxPer = 0.35;
divHeightVal = 1.5;
sizeBigBox = 1;
topBoxSpeed = 20;
frontBoxSpeed = 30;
topBoxDrawPer = 0.5;
bottomDrawHeight = 40;
skipIfPer = -0.3;
bottomSpeedPer = 1.0;
frontSpeedPer = 1.5;
frontRadiusPer = 0.5;
};
==============================================
then when i go into the mission file to activate them, i use this code
==============================================
new Precipitation(RainStorm){
position = "-45 -29 244";
rotation = "1 0 0 0";
scale = "1 1 1";
nameTag = "rs";
dataBlock = "HeavyRain";
offsetSpeed = "0.25";
minVelocity = "1.5";
maxVelocity = "3";
color1 = "1.0 1.0 1.0 1.0";
color2 = "-1.0 0.0 0.0 1.0";
color3 = "-1.0 0.0 0.0 1.0";
percentage = "1";
maxNumDrops = "5000";
maxRadius = "60";
};
new Lightning(ElectricalStorm){
position = "200 100 300";
rotation = "1 0 0 0";
scale = "250 400 500";
datablock = "LightningStorm";
strikesPerMinute = "30";
strikeWidth = "2.5";
chanceToHitTarget = "100";
strikeRadius = "250";
boltStartRadius = "20";
color = "1.0 1.0 1.0 1.0";
fadeColor = "0.1 0.1 1.0 1.0";
useFog = "1";
locked = "true";
};
===============================================
they're pretty much set out as in the book, unless i did something that im missing. that probably doesn't read well, how do you wrap the text so its formatted for easy reading?
thanks
#5
These are the old precipitation blocks !
03/25/2005 (8:37 am)
What version of Torque is 3DGPA using ?These are the old precipitation blocks !
#6
03/25/2005 (8:53 am)
Are you exec'in the file that contains the datablocks, and if so are you sure there are no compile errors?
#7
thanks
03/25/2005 (9:00 am)
It says 1.1.2 when i run the demo app and go to the about section. i don't get it though. if these are the old blocks then shouldn't they still work on the old version? thats the one im using to learn the engine, tho i have the latest head. if it's the case that when i go to use the full version that i can't use this code, then what are the latest blocks? i take it the code in that link you sent will work tho? i havent had a chance to try it yetthanks
#8
03/25/2005 (9:04 am)
As Owen suggested.. do you have a exec() for weather.cs?
#9
as far as i can tell the datablocks are getting called in the .mis file and so should start up when i enter the mission, though maybe thats wrong. i think that going by the errors above the datablocks aren't being processed properly or something and that's why it's not working. the question is why they aren't working
thanks
03/25/2005 (9:04 am)
Hi owen,as far as i can tell the datablocks are getting called in the .mis file and so should start up when i enter the mission, though maybe thats wrong. i think that going by the errors above the datablocks aren't being processed properly or something and that's why it's not working. the question is why they aren't working
thanks
#10
thanks
03/25/2005 (9:21 am)
Alright, i apologise for being an idiot. it now rains and lightning is flying left right and asunder. still can't get the sound working, though that doesn't work for anything except the button over sound. thanks everyone for the help in the other problem, perhaps i should go learn some common sense before tackling programming.thanks
#11
03/25/2005 (10:48 am)
What was the issue?
#12
still no sound tho - working on that
03/25/2005 (1:25 pm)
No exec. sometimes you look for something that wrong so hard that you miss the obvious. you can be blind in more ways than one...still no sound tho - working on that
#13
05/01/2005 (6:34 pm)
About the sound, I ran into the same issue, got frustrated, gave up and just continued on through the book. I just recently got to a chapter (either 19 or 20, they both deal with sound) and due to the inclusion of some file, the sounds of thunder and rain suddenly started working. Perhaps you should just move on or skip to those chapters.
Ben