Game Development Community

Creating trigger with new editor

by David Dougher · in Torque Game Engine · 01/01/2002 (12:15 pm) · 26 replies

I think this one may be for Mark. I created a new trigger for my demo level and did the following things...
1. It created a new subdirectory under torque/example called editor. Into this subdirectory it created a file called newObject.cs. The contents of this file were...

ObjectBuilderGui.newObject = new Trigger(Gateroom) {
dataBlock = "gameTrigger";
polyhedron = "0 0 0 1 0 0 0 -1 0 0 0 1";
}

2. It then compiled this object into a .dso and placed the .dso into the same torque/example/editor subdirectory.

3. When I saved my mission it inserted the following code into my mission file...

new Trigger(Gateroom) {
position = "-458.3 162 324.356";
rotation = "1 0 0 0";
scale = "2.5 2.5 13";
dataBlock = "gameTrigger";
polyhedron = "0.0000000 0.0000000 0.0000000 1.0000000 0.0000000 0.0000000 0.0000000 0.0000000 1.0000000 0.0000000 -1.0000000 0.0000000";
};

Note that I positioned and sized the trigger after it was created all in one session.

Two questions.

First, do I need to retain the newObject file for any reason or is is just some intermediate step that is not being properly cleaned up?

Second, (and the reason I filed this in the bug section) If you look carefully at the parameters in the polyhedron code you will notice that they are not the same.

When you eliminate the extra zeroes they are basically

newObject
polyhedron = "0 0 0 1 0 0 0 -1 0 0 0 1";

Mission
polyhedron = "0 0 0 1 0 0 0 0 1 0 -1 0";

About the author

Owner - Pariah Games, Adjunct Professor - Bristol Community College, Mentor - Game Design - Met School Newport, Mentor - Game Design - Met School Providence

Page«First 1 2 Next»
#21
08/09/2004 (5:26 am)
Can someone really tell the exact problem here ?
I have huge maps with over 25 trigger on some maps with triggers inside other triggers,triggers that open doors and turn switches at the same time.
And all are working every time !!
#22
08/09/2004 (5:52 am)
You can't reproduce this bug as you want. They brake sometimes, and sometimes they rework alone like that. My triggers have broken after 3 months of dev... don't know why. Sometimes they are broken on a PC, and they work on the other, but that's the same code! But it seems to work better with the change of the edges 4 and 8.
#23
08/16/2004 (4:16 am)
I'm experiencing the same at the moment.

When I add a trigger to the level it works fine. When I save and reload the mission, all my triggers are just dead.

I've checked and the polyhedron is not changed (old bug that might have surfaced, but it doesnt look like it). I'm really stumped and frustrated.

I _think_ that this has been introduced at the time when I added the pathed interior resource to my code, but I'm not sure. Its a hunch though. Did you guys add that resource also?
#24
08/16/2004 (11:45 am)
I dont know if this help but you can always try !

In the staticshape.cs
i have this function

function StaticShape::onTrigger(%this, %obj, %state)
{
      %this.getDatablock().onTrigger(%this, %state);
}

But this is for the state triggers i have .
If i remove this one non of my gates,switches are working !
#25
08/17/2004 (12:55 am)
I just ran a few tests, and the polyhedron was messed up from saving in the mission editor. I repatched a new head with all patches except the pathed interior, and now it works.

So it seems my problem was somehow connected to the pathed interior that must have reintroduced the old polyhedron bug
#26
09/25/2004 (12:30 pm)
I still have this problem, the trigger is creatable from the ingame editor but when clicked on in the menu, it doesn't spawn. Maybe this was fixed in 1.3?

Nevermind. Without a datablock called, it doesn't spawn. My bad.
Page«First 1 2 Next»