Lightning has stopped working in the editor
by David Dougher · in Torque Game Engine · 04/03/2004 (5:41 am) · 18 replies
Not sure when this occurred. Take a new version of torque, compile it, and go into the fps starter mission. Hit f11 to call up the editor. Hit F4 to go into the World Editor Creator. From the lower panel choose Mission Objects -> environment -> lightning. A dialog will pop up asking you for a name. Give it one - "Fred", and the dialog box goes away.
Looks like it works at this point.
But go to the upper box and you will see that no object has appeared in the list for your lightning object. Check the pop-up console and you will find the messages,
Object DefaultStorm is not a member of GameBaseData data block class
editor newobject.cs (0) Register object for object Fred of class Lightning.
Looks like the DefaultStorm datablock has been removed from the game. I notice that the datablock for the lightning storm created in the demo version is created within a function.
Does anyone remember where the original datablock was located and its content so it can be put back. Thought I would ask before I go hunting through old versions to find it. It seems to me that there are several of these datablocks that should be gathered in a default datablock .cs file - perhaps in /common so that they will be available to the editor?
Looks like it works at this point.
But go to the upper box and you will see that no object has appeared in the list for your lightning object. Check the pop-up console and you will find the messages,
Object DefaultStorm is not a member of GameBaseData data block class
editor newobject.cs (0) Register object for object Fred of class Lightning.
Looks like the DefaultStorm datablock has been removed from the game. I notice that the datablock for the lightning storm created in the demo version is created within a function.
Does anyone remember where the original datablock was located and its content so it can be put back. Thought I would ask before I go hunting through old versions to find it. It seems to me that there are several of these datablocks that should be gathered in a default datablock .cs file - perhaps in /common so that they will be available to the editor?
About the author
Owner - Pariah Games, Adjunct Professor - Bristol Community College, Mentor - Game Design - Met School Newport, Mentor - Game Design - Met School Providence
#2
I just downloaded a fresh copy of the Release 1 2 1 and compiled it. It stil has the same problem. Further the problem extends to the precipitation and fxLight functions as well.
Can someone verify that I am not the only person seeing this as a problem?
Pretty easy to check.
Just follow the directions above and see if you get a new lightning object in your mission. Try the same for precipitation and fxLight.
Thx.
04/05/2004 (4:10 pm)
Hmmm. Did you check?I just downloaded a fresh copy of the Release 1 2 1 and compiled it. It stil has the same problem. Further the problem extends to the precipitation and fxLight functions as well.
Can someone verify that I am not the only person seeing this as a problem?
Pretty easy to check.
Just follow the directions above and see if you get a new lightning object in your mission. Try the same for precipitation and fxLight.
Thx.
#3
You'll have to create your own datablock and manually add it to the script file to get around it I'm afraid.
Edit: Didn't read your full post. Precipiation has been working for me, Fxlight didn't though.
04/05/2004 (4:31 pm)
Yes David, or I wouldn't have replied with the answer.Quote:editor/newObject.cs (0): Register object failed for object fred of class Lightning.Is the only error I get when using the editor, with HEAD.
You'll have to create your own datablock and manually add it to the script file to get around it I'm afraid.
Edit: Didn't read your full post. Precipiation has been working for me, Fxlight didn't though.
#4
04/05/2004 (4:36 pm)
I get it all the time, i try to make lighning, or particles, and it doesn't do anything!
#5
So objects, such as fxFoliageReplicator, fxSunLight will work while fxLight, Lightning and Particles do not.
While a workaround solution is to add the datblocks yourself this is not the correct solution since I wish for my customers to be able to use the editor to create and enhance their own missions.
Does anyone have any additional information on the problem?
Stefan, thanks for checking again. Cameron, I had missed particles. Makes it a bit easier to see a pattern here.
04/06/2004 (8:00 am)
OK. I have done a bit of preliminary checking. It seems that those objects which are created with a parent class of SceneObject work correctly. Those with a parent class of GameBaseData do not.So objects, such as fxFoliageReplicator, fxSunLight will work while fxLight, Lightning and Particles do not.
While a workaround solution is to add the datblocks yourself this is not the correct solution since I wish for my customers to be able to use the editor to create and enhance their own missions.
Does anyone have any additional information on the problem?
Stefan, thanks for checking again. Cameron, I had missed particles. Makes it a bit easier to see a pattern here.
#6
That basically means that it is the datablock way to go for this one and switching the fxLight.cc/.h will get the result you're looking for...
Could it be that this is reflected in Lightning and particles as well ??
Take a look in Melvs resource on fxLight to get the low-down ...
04/06/2004 (8:06 am)
Hmm, I'm no expert on these matters but as far as the fxLight goes it has been changed in HEAD (and possibly 1.2.1 too) to fit the official demo requirments.That basically means that it is the datablock way to go for this one and switching the fxLight.cc/.h will get the result you're looking for...
Could it be that this is reflected in Lightning and particles as well ??
Take a look in Melvs resource on fxLight to get the low-down ...
#7
Np. And Of course! The workaround for this problem is pretty obvious, but it's *only* a workaround and it does not look any good when customers are trying to use the editor supplied and it does not work. I fully agree with you.
04/06/2004 (8:13 am)
David DougherNp. And Of course! The workaround for this problem is pretty obvious, but it's *only* a workaround and it does not look any good when customers are trying to use the editor supplied and it does not work. I fully agree with you.
#8
04/06/2004 (8:35 am)
Hmmm. Confounding problems. I have successfully gotten the particles to work from the current version, version 1_2_1 and version 1_2_0. So, there is at least one instance where a GameBaseData system works. I am backtracking now on particles to see how they are created. Perhaps there are default datablocks in place and all we need to do is create and submit some default datablocks for lightning and precipitation that can be properly placed into the game for permanent use.
#9
From the mission file...
new Lightning(storm) {
position = "-8.85962 154.24 95.0548";
rotation = "1 0 0 0";
scale = "512 512 300";
dataBlock = "DefaultStorm";
strikesPerMinute = "12";
strikeWidth = "2.5";
strikeRadius = "20";
color = "1.000000 1.000000 1.000000 1.000000";
fadeColor = "0.100000 0.100000 1.000000 1.000000";
chanceToHitTarget = "0.5";
boltStartRadius = "20";
useFog = "1";
};
-----------------------------------------------------------
From ObjectBuilderGui.gui - the function which placed it.
function ObjectBuilderGui::buildLightning(%this)
{
%this.className = "Lightning";
%this.addField("dataBlock", "TypeDataBlock", "Data Block", "LightningData DefaultStorm");
%this.process();
}
---------------------------------------------------------------
The datablock I created - there is more but you get the idea...
//-- Default Storm ------------------
datablock LightningData(DefaultStorm)
{
strikeTextures[0] = "~/common/editor/defaults/lightning.dml";
// The following parameters reference the sound effects in the first section.
strikeSound = LightningHitSound;
// There are 8 slots for thunder sounds. Make sure all 8 slots are filled.
// If necessary, duplicate the sounds/textures into the extra slots.
thunderSounds[0] = thunderCrash1;
thunderSounds[1] = thunderCrash2;
thunderSounds[2] = thunderCrash3;
thunderSounds[3] = thunderCrash4;
thunderSounds[4] = thunderCrash1;
thunderSounds[5] = thunderCrash2;
thunderSounds[6] = thunderCrash3;
thunderSounds[7] = thunderCrash4;
};
------------------------------------------------
And the error I get from the console log...
Executing game/data/missions/Swamp.mis.
Object 'DefaultStorm' is not a member of the 'GameBaseData' data block class
game/data/missions/Swamp.mis (0): Register object failed for object storm of class Lightning.
-------------------------------------------------
Finally the snippet from Lightning.h which shows that LightningData is parented by GameBaseData...
class LightningData : public GameBaseData
{
typedef GameBaseData Parent;
public:
enum Constants {
MaxThunders = 8,
MaxTextures = 8
};
//-------------------------------------- Console set variables
public:
AudioProfile* thunderSounds[MaxThunders];
AudioProfile* strikeSound;
StringTableEntry strikeTextureNames[MaxTextures];
//-------------------------------------- load set variables
public:
S32 thunderSoundIds[MaxThunders];
S32 strikeSoundID;
TextureHandle strikeTextures[MaxTextures];
U32 numThunders;
protected:
bool onAdd();
public:
LightningData();
~LightningData();
void packData(BitStream*);
void unpackData(BitStream*);
bool preload(bool server, char errorBuffer[256]);
DECLARE_CONOBJECT(LightningData);
static void initPersistFields();
};
-----------------------------------
OK people any ideas why this is not working?
04/06/2004 (10:34 am)
Sorry for the double post. Might as well make use of the space. I have placed datablocks into the game and the error still occurs. Now the objects are created in the mission file properly, but the system refuses to see that they are part of the GameBaseData class. Here is a typical example.From the mission file...
new Lightning(storm) {
position = "-8.85962 154.24 95.0548";
rotation = "1 0 0 0";
scale = "512 512 300";
dataBlock = "DefaultStorm";
strikesPerMinute = "12";
strikeWidth = "2.5";
strikeRadius = "20";
color = "1.000000 1.000000 1.000000 1.000000";
fadeColor = "0.100000 0.100000 1.000000 1.000000";
chanceToHitTarget = "0.5";
boltStartRadius = "20";
useFog = "1";
};
-----------------------------------------------------------
From ObjectBuilderGui.gui - the function which placed it.
function ObjectBuilderGui::buildLightning(%this)
{
%this.className = "Lightning";
%this.addField("dataBlock", "TypeDataBlock", "Data Block", "LightningData DefaultStorm");
%this.process();
}
---------------------------------------------------------------
The datablock I created - there is more but you get the idea...
//-- Default Storm ------------------
datablock LightningData(DefaultStorm)
{
strikeTextures[0] = "~/common/editor/defaults/lightning.dml";
// The following parameters reference the sound effects in the first section.
strikeSound = LightningHitSound;
// There are 8 slots for thunder sounds. Make sure all 8 slots are filled.
// If necessary, duplicate the sounds/textures into the extra slots.
thunderSounds[0] = thunderCrash1;
thunderSounds[1] = thunderCrash2;
thunderSounds[2] = thunderCrash3;
thunderSounds[3] = thunderCrash4;
thunderSounds[4] = thunderCrash1;
thunderSounds[5] = thunderCrash2;
thunderSounds[6] = thunderCrash3;
thunderSounds[7] = thunderCrash4;
};
------------------------------------------------
And the error I get from the console log...
Executing game/data/missions/Swamp.mis.
Object 'DefaultStorm' is not a member of the 'GameBaseData' data block class
game/data/missions/Swamp.mis (0): Register object failed for object storm of class Lightning.
-------------------------------------------------
Finally the snippet from Lightning.h which shows that LightningData is parented by GameBaseData...
class LightningData : public GameBaseData
{
typedef GameBaseData Parent;
public:
enum Constants {
MaxThunders = 8,
MaxTextures = 8
};
//-------------------------------------- Console set variables
public:
AudioProfile* thunderSounds[MaxThunders];
AudioProfile* strikeSound;
StringTableEntry strikeTextureNames[MaxTextures];
//-------------------------------------- load set variables
public:
S32 thunderSoundIds[MaxThunders];
S32 strikeSoundID;
TextureHandle strikeTextures[MaxTextures];
U32 numThunders;
protected:
bool onAdd();
public:
LightningData();
~LightningData();
void packData(BitStream*);
void unpackData(BitStream*);
bool preload(bool server, char errorBuffer[256]);
DECLARE_CONOBJECT(LightningData);
static void initPersistFields();
};
-----------------------------------
OK people any ideas why this is not working?
#10
04/20/2004 (11:04 pm)
Where did you put the datablock? Are sure it's being Exec'd. that all i can think of.
#11
need todo is to add the defaultstorm info in a cs file.
example
weather.cs
and exec the weather.cs from somewhere
Or
Use the environment files from the demo folder
there you have all lightning information and texture files.
04/21/2004 (4:25 am)
I tested the head version with lightning, the only thing youneed todo is to add the defaultstorm info in a cs file.
example
weather.cs
datablock LightningData(DefaultStorm)
{
strikeTextures[0] = "~/data/weather/lightning.dml";
// The following parameters reference the sound effects in the first section.
strikeSound = LightningHitSound;
// There are 8 slots for thunder sounds. Make sure all 8 slots are filled.
// If necessary, duplicate the sounds/textures into the extra slots.
//thunderSounds[0] = Thunder1;
//thunderSounds[1] = Thunder2;
//thunderSounds[2] = thunder1;
//thunderSounds[3] = thunder2;
//thunderSounds[4] = thunder1;
//thunderSounds[5] = thunder2;
//thunderSounds[6] = thunder1;
//thunderSounds[7] = thunder2;
};and exec the weather.cs from somewhere
Or
Use the environment files from the demo folder
there you have all lightning information and texture files.
#12
04/21/2004 (5:07 am)
I did this too worked fine with me.
#13
OK. Did you do it by using the editor to create the lightning storm or did you do it by adding the lightning storm to your mission file directly? My problem has been that it does not create a lightning storm from the editor.
This is the case for several features using the editor - not just lightning.
ps. Thx for all the feedback, it does help a lot.
04/21/2004 (6:08 pm)
Hmmm. As you can see from my post above I did create a default datablock and I double checked to verify that it was added to the startup chain correctly.OK. Did you do it by using the editor to create the lightning storm or did you do it by adding the lightning storm to your mission file directly? My problem has been that it does not create a lightning storm from the editor.
This is the case for several features using the editor - not just lightning.
ps. Thx for all the feedback, it does help a lot.
#14
the map it works to .
I did not edit the missionfile !
Try to use the enviroment files from the demo folder.
04/22/2004 (3:30 am)
I used the editor and placed the lightning and if i restartthe map it works to .
I did not edit the missionfile !
Try to use the enviroment files from the demo folder.
#15
04/22/2004 (6:20 am)
Thanks, I'll try that next.
#16
except for the name it is copied from the demo game. it works for me. :S
04/23/2004 (11:04 am)
Well here is what i had for my lightning datablockdatablock AudioProfile(ThunderCrash1Sound)
{
filename = "~/data/sound/environment/ambient/thunder1.ogg";
description = Audio2d;
};
datablock AudioProfile(ThunderCrash2Sound)
{
filename = "~/data/sound/environment/ambient/thunder2.ogg";
description = Audio2d;
};
datablock AudioProfile(ThunderCrash3Sound)
{
filename = "~/data/sound/environment/ambient/thunder3.ogg";
description = Audio2d;
};
datablock AudioProfile(ThunderCrash3Sound)
{
filename = "~/data/sound/environment/ambient/thunder4.ogg";
description = Audio2d;
};
//datablock AudioProfile(LightningHitSound)
//{
// filename = "~/data/sound/crossbow_explosion.ogg";
// description = AudioLightning3d;
//};
datablock LightningData(DefaultStorm)
{
strikeTextures[0] = "~/data/environment/lightning.dml";
//strikeSound = LightningHitSound;
thunderSounds[0] = ThunderCrash1Sound;
thunderSounds[1] = ThunderCrash2Sound;
thunderSounds[2] = ThunderCrash3Sound;
thunderSounds[3] = ThunderCrash4Sound;
};except for the name it is copied from the demo game. it works for me. :S
#17
Guess i will keep on searching and cuting and pasting until i have the whole thing.
12/01/2012 (12:16 pm)
wow , you guys are having that problem back in 2004. its 2012 now and i have afx 2.0 for t3d 1.2 and i dont have the lightning storm datablocks ethier.i crash when i try to put in any storm. i have the environmental.cs, it was in my script server files. i have to move it art shapes datablocks, and run from there. but i still have to find the old datablock with the lightning textures and sounds.Guess i will keep on searching and cuting and pasting until i have the whole thing.
#18
12/01/2012 (12:28 pm)
@Thomas: lightning in T3D does not use the lightning textures, only the sounds. Strikesound should be a 3D sound and isn't demonstrated in stock; thundersounds[n] are 2D sounds. If AFX is misplacing the default lightning datablock that is a fault of AFX. It is located properly in art/datablocks/environment.cs in stock T3D, Full Template... but I just noticed that it is missing from the Empty Template, which is something that will be rectified in the upcoming template restructuring for open source T3D.
Torque Owner Stefan Lundmark