Author Topic: Need a Trigger Area Transition...  (Read 350 times)

Legacy_Leurnid

  • Sr. Member
  • ****
  • Posts: 473
  • Karma: +0/-0
Need a Trigger Area Transition...
« on: April 26, 2012, 01:42:55 am »


               I am looking for a good, lightweight on-enter trigger based area edge transition that doesn't need any extras to run, that will preserve character orientation and relative location on the transition.  I have found a few in the vault, but they all have odd requirements or are glitchy.  I am going to assume that there is probably a really good one bundled into a PW kit someplace, that isn't documented on the DL page.

If you can help me out, a bucket of virtual fish shall be yours!
               
               

               
            

Legacy_WhiZard

  • Hero Member
  • *****
  • Posts: 2149
  • Karma: +0/-0
Need a Trigger Area Transition...
« Reply #1 on: April 26, 2012, 04:27:56 am »


               Not sure what you are looking for.  Below I have posted a bare bones one which assumes the connecting triggers are of the same size and are in parallel alignment.

location GetTransitionLocation()
{
object oPC = GetEnteringObject();
float fFace = GetFacing(oPC);
vector vWay = GetPosition(OBJECT_SELF);
vector vPC = GetPosition(oPC);
object oTarget = GetObjectByTag("TAG_OF_DESTINATION_TRIGGER");
vector vDestination = GetPosition(oTarget) + vPC - vWay;
return Location(GetArea(oTarget), vDestination, fFace);
}
               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Need a Trigger Area Transition...
« Reply #2 on: April 26, 2012, 12:04:58 pm »


               

Leurnid wrote...

I am looking for a good, lightweight on-enter trigger based area edge transition that doesn't need any extras to run, that will preserve character orientation and relative location on the transition.  I have found a few in the vault, but they all have odd requirements or are glitchy.  I am going to assume that there is probably a really good one bundled into a PW kit someplace, that isn't documented on the DL page.

If you can help me out, a bucket of virtual fish shall be yours!

Connect your area transition with waypoints and character will appear on the location of waypoint with waypoint orientation. One exception to this is that in few environments it does still turn your camera to opposite since you appeared too close to cliff or something.
               
               

               
            

Legacy_WhiZard

  • Hero Member
  • *****
  • Posts: 2149
  • Karma: +0/-0
Need a Trigger Area Transition...
« Reply #3 on: April 26, 2012, 12:25:05 pm »


               

ShaDoOoW wrote...
Connect your area transition with waypoints and character will appear on the location of waypoint with waypoint orientation. One exception to this is that in few environments it does still turn your camera to opposite since you appeared too close to cliff or something.


Yes, this works under the assumption of each trigger having one waypoint to send the object to.  A continuous side won't have relative location when you jump areas (unless you use a very large number of triggers).  Again I don't know the effect the OP wants, more information would be helpful.
               
               

               
            

Legacy_Leurnid

  • Sr. Member
  • ****
  • Posts: 473
  • Karma: +0/-0
Need a Trigger Area Transition...
« Reply #4 on: April 26, 2012, 04:37:02 pm »


               I am using this script from the vault for the time being.

I am using it not entirely as specified though, for a seamless edge transition several tiles wide to another part of the same area.

What I am noticing is that relative location on enter and exit are not uniform... sometimes dramatically off, and I am particularly fussy about details, so I was hoping there was a newer, cleaner solution to the problem.

There are a few other similar systems, most of which require way points and invisible objects, or specifically sized areas or triggers with overly complex naming schemes to track their size and location, and I was really hoping to avoid a lot of those hassles.

As an excercise in figuring the script out and hoping to find the issue with it out of the tin, I parsed it down as best I could, refined the suffix/prefix identifier sequence (which seems arbitrarily awkward), and pitched the log messages altogether, along with the action check. Naturally, my trimmed down version is even buggier than the original, but I was expecting no less. Mine was a journey of discovery, I didn't expect to find the golden fleece. Unfortunately, I didn't find a way to make the destination location more accurate either
               
               

               
            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
Need a Trigger Area Transition...
« Reply #5 on: April 26, 2012, 05:27:10 pm »


               What is wrong with this?

http://nwvault.ign.c...ts.Detail&id=89
               
               

               
            

Legacy_Leurnid

  • Sr. Member
  • ****
  • Posts: 473
  • Karma: +0/-0
Need a Trigger Area Transition...
« Reply #6 on: April 26, 2012, 08:58:07 pm »


               

henesua wrote...

What is wrong with this?

http://nwvault.ign.c...ts.Detail&id=89


That one claims to require areas of certain shapes and sizes... the demo mod runs very smoothly though.

I was considering cobbling it for my needs, but got into it and balked. It takes me a while to deconstruct a script that uses stuff I am familiar with, and that one went way off my map. I may come back to it later.
               
               

               
            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
Need a Trigger Area Transition...
« Reply #7 on: April 26, 2012, 09:29:00 pm »


               It does require areas of a certain size, and for you to embed grid coordinates in the tag.

it is self contained and runs on its own. I am sure it could be written more efficiently, but it does as advertised so I haven't needed to modify it much. The only thing you need to know is how to adjust the various settings it has which are well commented.
               
               

               
            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
Need a Trigger Area Transition...
« Reply #8 on: April 27, 2012, 12:05:27 am »


               

Leurnid wrote...

What I am noticing is that relative location on enter and exit are not uniform... sometimes dramatically off, and I am particularly fussy about details, so I was hoping there was a newer, cleaner solution to the problem.


Are you sure that it is the script that is the problem?   My guess is the problen is the terrain that you are jumping the Creature to.   If the Terrain can not have a creature land there, it will be jumped to a location that is near by.  

Perhaps if you replaced your jump to location with something like.  

void JumpAndFlagLocation(location lDest)
{
 JumpToLocation(lDest);
 ApplyEffectAtLocation
   (
    DURATION_TYPE_TEMPORARY,
    EffectVisualEffect( VFX_DUR_FLAG_RED),
    lDest,
    60.0
   );
}


You will be able to tell if it is the location the script is selecting that is the problem or the location you have selected as the jump point.   If the PC does not show uip at the same point as the flag your terrain is the problem and no script change will correct your problem.  
               
               

               
            

Legacy_Leurnid

  • Sr. Member
  • ****
  • Posts: 473
  • Karma: +0/-0
Need a Trigger Area Transition...
« Reply #9 on: April 27, 2012, 12:19:50 am »


               

Lightfoot8 wrote...

Leurnid wrote...

What I am noticing is that relative location on enter and exit are not uniform... sometimes dramatically off, and I am particularly fussy about details, so I was hoping there was a newer, cleaner solution to the problem.


Are you sure that it is the script that is the problem?   My guess is the problen is the terrain that you are jumping the Creature to.   If the Terrain can not have a creature land there, it will be jumped to a location that is near by.  

Perhaps if you replaced your jump to location with something like.  

void JumpAndFlagLocation(location lDest)
{
 JumpToLocation(lDest);
 ApplyEffectAtLocation
   (
    DURATION_TYPE_TEMPORARY,
    EffectVisualEffect( VFX_DUR_FLAG_RED),
    lDest,
    60.0
   );
}


You will be able to tell if it is the location the script is selecting that is the problem or the location you have selected as the jump point.   If the PC does not show uip at the same point as the flag your terrain is the problem and no script change will correct your problem.  


After my last post, I headed out for the daily grind, and that very thought occured to me on the road.  I just got back in, going to try that out.  

Thank you!