Game Development Community

Using fxShapeReplicator

by Lee Latham · in Torque Game Engine Advanced · 09/23/2006 (1:24 pm) · 18 replies

Hello,

I'm attempting to use fxShapeReplicator, but I believe I must be doing something wrong, as TSE crashes when I try to load my mission. The way I'm trying to use it is by putting code like this:

new fxShapeReplicator(WhiteLocus) {
position = "108.886 487.07 137.906";
rotation = "1 0 0 0";
scale = "1 1 1";
HideReplications = "1";
ShowPlacementArea = "0";
PlacementAreaHeight = "25";
PlacementColour = "0.4 0 0.8 1";
shapeFile = "~/data/shapes/trees/White_Pine/Sharp_WhitePine01.dts";
Seed = "1376312589";
ShapeCount = "100";
ShapeRetries = "100";
InnerRadiusX = "0";
InnerRadiusY = "0";
OuterRadiusX = "300";
OuterRadiusY = "300";
AllowOnTerrain = "1";
AllowOnInteriors = "1";
AllowOnStatics = "0";
AllowOnWater = "0";
AllowWaterSurface = "0";
AlignToTerrain = "0";
Interactions = "1";
AllowedTerrainSlope = "90";
TerrainAlignment = "1 1 1";
FixShapeAspect = "1";
ShapeScaleMin = "5 5 5";
ShapeScaleMax = "7 7 7";
ShapeRotateMin = "0 0 0";
ShapeRotateMax = "0 0 0";
OffsetZ = "0";
};

(which I got from here: http://tdn.garagegames.com/wiki/WorldBuilding/MissionEditor/fxshapereplicator)

into my mission file. Like I said, it crashes TSE when I try to load the mission. So A) is there a better way to go about this and B) any ideas?

Any input would be greatly appreciated!

Best Regards,
Lee

#1
09/23/2006 (9:33 pm)
FxShapeReplicator isn't rolled into ms4 iirc. there might be a resource but i don't really remember.

Putting it in should be mildly trivial, as the foliage replicator code is there and you can steal its mission editor circle render bits ;)

[Ishbuu]
#2
09/24/2006 (3:05 am)
There is a resource here:

http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=10050

Be sure to use the fix at the bottom to get it working in MS4. I'm not sure if that is the best way of doing it but it's what I hacked in quickly to get it working.

Also be sure that you are initializing it in your missiondownload after you initialize fxfoliagereplicator.
#3
09/24/2006 (6:47 pm)
Yeah, I saw that and did it, and it build just fine. I've tried it with and without that patch, and with the version that comes with MS4.

BUT...I'm afraid I don't know what you mean about "initializing it in your missiondownload after you initialize fxfoliagereplicator". Could you please elaborate?

Ishbuu: How do you get to the foliage editor?
#4
09/24/2006 (7:49 pm)
Yeah, I'm sorry for the lack of updates. I should probably update that resource and port all that the the GFX layer.
#5
09/24/2006 (8:29 pm)
I just updated the resource. It now works with Milestone 4. The PrimBuild code is working though for some reason the rings still don't display. It's late so I'm heading in. I might fix it tomorrow.
#6
09/25/2006 (12:08 am)
Thanks! Certainly no apologies are necessary on your part.

If you have a moment, could you tell me if I'm doing something dumb? I'm adding the sample code I've found on the GG forums, using one of the test dts files straight from CVS. I've added this to the simple.mis, and TSE crashes when the mission loads. Is there anything else that one needs to do to use your resource?:

new fxShapeReplicator(Treerep) {
position = "224.263 20.6742 -53.7219";
rotation = "1 0 0 0";
scale = "0.1 0.1 0.1";
HideReplications = "1";
ShowPlacementArea = "0";
PlacementAreaHeight = "25";
PlacementColour = "0.4 0 0.8 1";
shapeFile = "~/data/shapes/test/smallsp'here.dts";
Seed = "1376312589";
ShapeCount = "100";
ShapeRetries = "100";
InnerRadiusX = "0";
InnerRadiusY = "0";
OuterRadiusX = "300";
OuterRadiusY = "300";
AllowOnTerrain = "1";
AllowOnInteriors = "1";
AllowOnStatics = "0";
AllowOnWater = "0";
AllowWaterSurface = "0";
AlignToTerrain = "1";
Interactions = "1";
AllowedTerrainSlope = "90";
TerrainAlignment = "1 1 1";
FixShapeAspect = "1";
ShapeScaleMin = ".1 .1 .1";
ShapeScaleMax = ".1 .1 .1";
ShapeRotateMin = "0 0 0";
ShapeRotateMax = "0 0 0";
OffsetZ = "0";
};
#7
09/25/2006 (6:53 am)
Hmm..nope. Why not create it in the world editor instead though?

The only possible guess I have is the shape file. You could have to add that to the missionload but for me it was already integrated.
#8
09/25/2006 (12:49 pm)
Dude! Everyone keeps saying to do this, but I cannot for the life of me see this option. I've been working in the editor for several months now...please tell me in what way I am retarded :-) How do you do that?
#9
09/25/2006 (2:29 pm)
F11->World Editor Creator->Mission Objects->Environment->fxShapeReplicator
#10
09/25/2006 (2:46 pm)
Doh. I've been messing with interiors, shapes, etc. all this time, and hadn't yet delved into that. Thanks.

But...at the risk of being quite tedious...when I try to place an fxShapeReplicator into the mission, it prompts me for a name, but then nothing shows up on the map or in the resource tree. I tried it with the foliage replicator and I got a nice box with a purple circle wizzing around, and a bunch of properties to edit. I tried selecting a static shape first, but that didn't seem to work.

Am I still being retarded?
#11
09/25/2006 (2:49 pm)
No, you're not. There will just be a small box though. No purple rings. Try entering a name with no spaces or odd characters.
#12
09/25/2006 (4:03 pm)
Did that, no joy. I did have the sense to check the console.log, this time:

Executing editor/newObject.cs.
editor/newObject.cs (0): Unable to instantiate non-conobject class fxshapereplicator.

Would be nice if it told us why...?
#13
09/25/2006 (4:15 pm)
That means that fxShapeReplicator isn't in your current exectuable's classes. Probably a build issue, or even a checkout issue (you may be working with an older version of TSE?).

Scanning back in the thread, I don't see anywhere where you mention adding the fxShapeReplicator c++ code to your c++ project, which is why you are getting the console error--to your build of Torque, fxShapeReplicator is not a class, and you will need to add it to your project and recompile.
#14
09/25/2006 (4:16 pm)
Thats bizzare. I have a new version and it already supported fxShapeReplicator
#15
09/25/2006 (5:27 pm)
Ok, I think I may know where this is going. I did a fresh clean checkout and rebuilt, and had the same problem. I checked the build log, and it is ignoring the fxShapeReplicator files. I am not a programmer. But I'm guessing the compiler has to be told to include the file?

I'm using VS 2005 Express, and I'd appreciate if it someone could point me the right direction, if indeed this is the case.

BTW I built using both the Torque Shader Engine and TSE SDK solutions with the same results.
#16
09/25/2006 (6:11 pm)
There's an expandable treeview in VC++. You go into game->fx-> then right-click on the fx folder->Add->Add Existing Item
#17
09/25/2006 (11:00 pm)
Ok, I'm a replicating fool! Woohoo thanks! My goodness, I love the way it works with terrain!

A couple of notes:

The version in CVS references dgl.h. I noticed discussion about this on your resource page (Matt Vitelli's), and put in the "fixed" version from there, and everything was hunky dory. Don't know if this is a bug, or a temporary state of affairs until openGL is implemented in TSE.

Wow. That makes it sound so fast. :-) Thanks a bunch for your help. I really think this discussion will be useful to others...there doesn't seem to be much basic discussion about it already.
#18
09/26/2006 (6:06 am)
No, it has nothing to do with future openGL support. A few features in TSE still haven't been ported.