Game Development Community

Help at my trigger problem

by D Fasel · in Torque 3D Professional · 07/19/2014 (4:18 pm) · 10 replies

Hello,

I always get problems with the trigger in the new MIT versions. I have set up a Mission with 2 teleport triggers to test that. One trigger work but not the other one. I get the same problems in other Mit version and with game's i made that have a lot more triggers. Alwys some of the trigger make problems.

I'm not sure the issue is in the engine code, or some thing other cause that trigger problem.

To find out i have the test file here for download, so anyone how have a bit time can test it.

I wondering how this 2 Teleport trigger works, when you try out my test level. How i told, i get a problem by testing it. The test level is made with version 3.5.1

P.S. I got a solution to make the triggers work, but is a bit hacky :) I posted this in the resources, some months ago.

Here the link to the download of the test level with the 2 teleporter: Click Here

About the author

Working in the team of Winterleaf Entertainment as an Lead Level Designer and Environmental Artist. Selling content and art packs ready for T3D at my shop www.game3d.ch/shop


#1
07/20/2014 (5:05 pm)
I've had this happen to me before. I just copy the three default trigger functions from server\triggers.cs and paste them into the same file or a new file and just rename DefaultTrigger to what I need.


function DefaultTrigger::onEnterTrigger(%this,%trigger,%obj)
{
   // This method is called whenever an object enters the %trigger
   // area, the object is passed as %obj.
}

function DefaultTrigger::onLeaveTrigger(%this,%trigger,%obj)
{
   // This method is called whenever an object leaves the %trigger
   // area, the object is passed as %obj.
}

function DefaultTrigger::onTickTrigger(%this,%trigger)
{
   // This method is called every tickPerioMS, as long as any
   // objects intersect the trigger.

   // You can iterate through the objects in the list by using these
   // methods:
   //    %trigger.getNumObjects();
   //    %trigger.getObject(n);
}
#2
07/20/2014 (6:28 pm)
I get the problem also when I make new triggers, not only with the teleport trigger. The weird thing is, when i use other numbers for the polyhedron, and switch it back to the old value, the trigger work, as long i don't restart the mission.

I made a solution, where a function do the same I has described before. This function runs after 10 second the mission has start, and only change the polyhedron ,and change it back to the old value. This happens to all triggers with this function.

When I use this solution, all triggers work well.

But I try to find out, where the bug really is, and I wondering that it seems that I be alone with that problem.

Ok, i can life with my solution, but it is not the propper way!

here is the link to the solution i made: www.garagegames.com/community/resources/view/22600

#3
07/22/2014 (10:42 pm)
last day i did some work on trigger.and it worked just fine.
i have tested it in t3d v2.0+v3.0+v3.5.1

may be the problem is in your modefied c++ part
or
in your game play code.
in that case u will have to debug all of the scripts + cpp code.
***********************
u better do a test.

create a new project based on Full template.
copy your mis files on that project.
do not copy assets files.
it will show some error.but your game should be loaded without any problem.(but if u have added any environmental sound clip then that could make problem as i have found some on my projects.in that case u have to disable that)

build the source or use dll and exe from stock one.
place those triggers.
and test.

if work ok then move your trigger definations and related code in this project.
and test again.
if this time does not work then problem is in your trigger code.
but if it works fine,then problem is in your other gameplay code.

that is it for now


#4
07/22/2014 (10:55 pm)
I did test all that you tell in your post. also with fresh not modified instalation and the stock trigger code with stock teleporter. This way is the test level i have in first post.

The only solution is my solution that make the triggers work. No matter i uses a fresh installation or a game or a modified installation. Always i get this trigger problem. It don't happens in Version 1.2 !

The only thing i never tested is a new instalation of my PC. It seems i be the only one get this weird thing.
#5
07/25/2014 (10:25 am)
"also with fresh not modified instalation and the stock trigger code with stock teleporter."

" No matter i uses a fresh installation or a game or a modified installation. Always i get this trigger problem. It don't happens in Version 1.2 !"

this just does not make any sense.
nobody is having any problem in that stock code.
only you.
the only thing that can be happen is that your hardware/system or something does not like t3d's trigger part.

i will see if i can download that zip file.it will take more than an hour to download.
#6
07/25/2014 (10:49 am)
Yea, how i told, it seems i be the only one getting that. Maybe time to make a fresh window installation and all needed SDKs.

But always it is weird how this only happens in MIT version and not in version 1.2, Some thing must be different.

Im searching since months, what couse this problem.

Thank for download and test!
#7
07/28/2014 (4:25 pm)
I made a little video to show you what i mean about this weird bug. The video show you this downloadable test demo i made with the 2 triggers (teleport trigger) .

In the video you see how the trigger work, i do noting other as switch between the polyhedron and an other parameter, but i change noting. You can see one time the trigger work, and after new switching, the trigger dont work.

This happens in all new MIT versions, also the latest fresh installed version. No matter it is a teleport stock trigger or triggers i made, all the time this happens, that some trigger not works.

When i use my bug fix it works, aslong i dont use the editor. (see the link above about my bug fix)

#8
07/29/2014 (11:45 am)
I had similar problems in 3.5, so i rolled back to 3.0 and it worked. I have not tried 3.5.1, but the issue was suppose to be fixed.
#9
07/29/2014 (12:12 pm)
The video shows version 3.5.1

I did also a new test. I used the trigger engine code from version 1.2 in the new version. but same thing happens. So im pretty sure the issue is not in the engine code to find, about the version 1.2 triggers work well.

It must be some thing while the mission is start and read the mission file, and a lot other things also get inizialized in the same time. Also switchin to the editor seems to have a influenze to the trigger. Most weird is, that it seems not everyone get this bug! What is different at my system, that it cause this problem?

I more and more think, that in the start sequenz of the mission and inizializing of other things to the same time, happens bad things. An example, when i have animated doors, and the level gets large, i need to delay the doors in the onAdd function and set all doors to close, otherwise the doors looks open, but are close. If the level is smal this not happens. So the larger your level is the more such problems you will get.

Maybe the game start and mission start sequenze overwrite things, espezial in large levels.
#10
07/30/2014 (5:35 am)
I had a similiar problem, in my case the problems were two:

- The %obj i supposed to be in trigger was not the only one(solved with checking if has a client)

- The polyhedron messed up. I solved by pasting a working trigger polyhedron directly in .mis file in my trigger.

Anyway, is quite a while that i don't see trigger problems in my game, probably since i'm using 3.5.1