Game Development Community

FxSwarm

by Sam3d · in Torque Game Engine · 06/28/2004 (11:11 am) · 20 replies

Hope this is the correct forum...

I copied the fxSwarm cc & h files to:
C:\torque\engine

Added this to main.cc #include "fxSwarm.h"

Recompiled, and fxSwarm shows up in the World Creator.

But when I try to add an instance of it, nothing happens and nothing shows up in the Inspector.

Suggestions?

#1
06/28/2004 (11:37 am)
Did you add the functions in objectbuilder.gui & editorgui.cs ?
#2
06/28/2004 (12:07 pm)
Yes.

Using VC++, when I do Rebuild All, I don't see it showing up in the build list...?
#3
06/28/2004 (12:13 pm)
Do you have all files on right place.
Because its only to add them to the list and do a rebuild ,there is nothing strange about fxswarm it works fine in head.
Or do you mean that you dont see them when you are in the game ?
#4
06/28/2004 (12:41 pm)
I don't see them in the game.

fxSwarm shows up in the list of objects available in World Creator, but selecting it & assigning a name doesn't do anything, nothing is added.


Tried adding
new fxSwarmObject(fxSwarm) { etc
manually to the mis file as well.
#5
06/28/2004 (1:19 pm)
Ok did you add this in objectbuildergui.gui

function ObjectBuilderGui::buildfxSwarmObject(%this);
{
%this.classname = "fxSwarmObject";
%this.process();
}

and look in console so you dont get any errors.
Stupid question :)
Did you add the fxswarm.cc and fxswarm.h to the fx folder in vc++ ?
#6
06/28/2004 (1:41 pm)
Console error:
Warning: (c:\torque\engine\console\consoleobject.cc @ 62) Couldn't find class rep for dynamic class: fxSwarmObject
editor/newObject.cs (0): Unable to instantiate non-conobject class fxSwarmObject.

>Did you add the fxswarm.cc and fxswarm.h
>to the fx folder in vc++ ?

They are in: C:\torque\engine\game\fx

Do I need to add an #include line somewhere?

(First go with C++, no compile experience)

thanks.
#7
06/28/2004 (2:46 pm)
Ok sam

No includes or something is needed.

>They are in: C:\torque\engine\game\fx

You must add the files in vc++ to

So in vc++
Choose fileview right click on the fx folder icon and choose add files to folder.
Add fxswarm.cc and fxswarm.h so you can see them in the fx folder in vc++.

rebuild.
#8
06/28/2004 (3:10 pm)
Got it, thanks for your patience.
#9
08/07/2006 (6:07 pm)
Has anyone got this to work in tge 1.4??

I have everything modded correctly, but when I add the swarm thru the mission editor, I get the following error in the console log:

pushDialog(): Invalid control: DemoEditorAlert
exec: Warning! Found a DSO from the future! (editor/newObject.cs.dso)
Compiling editor/newObject.cs...
Loading compiled script editor/newObject.cs.
editor/newObject.cs (0): Unable to instantiate non-conobject class fxSwarmObject.

I have followed the instructions to a "T". Everything compiles fine. No errors on compile, no errors in the console until I add a swarm, then I get the error above. What's already posted in this thread I've done.
Just so you know, I've already added the aiGuard resource successfully to my build.

Oh, and where in the world is newObject.cs?? I can't find it in editor, or any other folder.
#10
08/07/2006 (6:13 pm)
Delete the ObjectBuilderGui.gui.dso and relaunch Torque. Fxswarm work with TGE 1.4.0.
#11
08/07/2006 (6:29 pm)
Whenever I make a change, I always delete the dso files. This time, I deleted all the dso files, but it still gives me the same error.
I did however find the editor/newObject.cs
It's a very short file.
ObjectBuilderGui.newObject = new fxSwarmObject(mySwarm) {
};

Looking at the code, it looks like it should work. Unfortunately, it isn't for me.
#12
08/07/2006 (6:56 pm)
Here way i did it, there no problems.
Copy fxSwarm.cc and fxSwarm.h to engine/game/fx.
Add the following line in the function Creator::init( %this ) in
example/create/editor/EditorGui.cs.

%Environment_Item[] = "fxSwarmObject";

Add the following after this line } (about line 456) above the this line // Environment
in example/create/editor/ObjectBuilderGui.gui.

function ObjectBuilderGui::buildfxSwarmObject(%this)
{
%this.className = "fxSwarmObject";
%this.process();
}

Do clean the Rebuild all.

Where you find newObject.cs, i think that your problem and the function does not look complete. Follow what have here and you should not have any problems.
#13
08/07/2006 (7:16 pm)
Did you have to change any other files in the engine?
When using the debug exe, I get the following in the console:
Warning: (c:\torque\sdk\engine\console\consoleobject.cc @ 62) Couldn't find class rep for dynamic class: fxSwarmObject
editor/newObject.cs (0): Unable to instantiate non-conobject class fxSwarmObject.

It looks like fxSwarmObject needs to be added to consoleobject.cc

Edit to add: I've done 3 clean rebuild Alls thus far in attempting to get this to work.
Deleted all dsos as well.
#14
08/08/2006 (5:16 am)
What version of the engine you using. No I did not have to do any engine. Did you put the function in ObjectBuilderGui.gui. I will do install on clean TGE 1.4.
#15
08/08/2006 (6:11 am)
I'm using a clean install of tge 1.4 (I always add mods to a clean build before merging with my dev engine)

Here is where the code is in sdk/example/creator/editor/ObjectBuilderGui.gui:
function ObjectBuilderGui::addField(%this, %name, %type, %text, %value)
{
   %this.field[%this.numFields, name] = %name;
   %this.field[%this.numFields, type] = %type;
   %this.field[%this.numFields, text] = %text;
   %this.field[%this.numFields, value] = %value;

   %this.numFields++;
}
 //FX SWARM===================================================
  function ObjectBuilderGui::buildfxSwarmObject(%this)
	{
		%this.className = "fxSwarmObject";
		%this.process();
	}
 //END FX SWARM================================================
//------------------------------------------------------------------------------
// Environment
//------------------------------------------------------------------------------

function ObjectBuilderGui::buildfxFoliageReplicator(%this)
{

and in sdk/example/creator/editor/EditorGui.cs:
// *** OBJECTS - do the objects now...
   %objGroup[0] = "Environment";
   %objGroup[1] = "Mission";
   %objGroup[2] = "System";
   //%objGroup[3] = "AI";

   %Environment_Item[0]  = "Sky";
   %Environment_Item[1]  = "Sun";
   %Environment_Item[2]  = "Lightning";
   %Environment_Item[3]  = "Water";
   %Environment_Item[4]  = "Terrain";
   %Environment_Item[5]  = "AudioEmitter";
   %Environment_Item[6]  = "Precipitation";
   %Environment_Item[7]  = "ParticleEmitter";
   %Environment_Item[8]  = "fxSunLight";
   %Environment_Item[9]  = "fxShapeReplicator";
   %Environment_Item[10] = "fxFoliageReplicator";
   %Environment_Item[11] = "fxLight";
   
     //FX SWARM==================================
 %Environment_Item[12] = "fxSwarmObject";
 //END FX SWARM=============================
 
   %Mission_Item[0] = "MissionArea";
   %Mission_Item[1] = "Path";
   %Mission_Item[2] = "PathMarker";
I put fxSwarm.cc and h in engine/game/fx added them to my project and did a clean rebuildAll
#16
08/08/2006 (8:10 am)
I just did on TGE 1.4.0, there no compile or engine errors in the console.
I put fxSwarm.cc and h in engine/game/fx added them to my project and did a clean rebuildAll.
Here the code in sdk/example/creator/editor/ObjectBuilderGui.gui: (about line 458).
//------------------------------------------------------------------------------
// Environment
//------------------------------------------------------------------------------
function ObjectBuilderGui::buildfxSwarmObject(%this)
{
%this.className = "fxSwarmObject";
%this.process();
}

function ObjectBuilderGui::buildfxFoliageReplicator(%this)
{
%this.className = "fxFoliageReplicator";
%this.process();
}

Here the code in sdk/example/creator/editor/EditorGui.cs: (about line 1246)

%Environment_Item[7] = "ParticleEmitter";
%Environment_Item[8] = "fxSunLight";
%Environment_Item[9] = "fxShapeReplicator";
%Environment_Item[10] = "fxFoliageReplicator";
%Environment_Item[11] = "fxLight";
%Environment_Item[12] = "fxSwarmObject";

%Mission_Item[0] = "MissionArea";
%Mission_Item[1] = "Path";
%Mission_Item[2] = "PathMarker";
%Mission_Item[3] = "Trigger";
%Mission_Item[4] = "PhysicalZone";
#17
08/09/2006 (7:36 pm)
I think I have other problems dealing with vs2005. I'm getting the same error after compiling the lighting kit with the aiguard/aipatrol resource, and I know they work becouse I have them working in regular tge.
I'm going to have to debug this to figure out what's going on. Thanks for your help.
#18
08/09/2006 (7:48 pm)
You are welcome. You right there, with VC6 the aiguard and aipatrol compile with no problem at all. If using a clean version of TLK I can send the exe with them in it.
#19
08/10/2006 (6:50 pm)
Quote:I can send the exe with them in it.
Thankyou for the offer. It's much appreciated. :) but...if I accept, then what do I learn?? :-)
I uninstalled code::blocks and I think it deleted a file that was being used by vs2005. I'm going to reinstall 2005 and see if that fixes the problems.
#20
08/10/2006 (7:13 pm)
Ok, You right there, I would agreed you. You very welcome. Have fun.