Author Topic: Effect at location ported to?  (Read 402 times)

Legacy_Knight_Shield

  • Hero Member
  • *****
  • Posts: 812
  • Karma: +0/-0
Effect at location ported to?
« on: October 12, 2010, 10:04:51 pm »


               I have a book that teleports you to a waypoint where a portal is ..then the portal can teleport you to where you last used the book.

Question: How do you put an effect on PC when they arrive at their destination.Right now I just do the effect twice with delay command ..doesnt always work with different maps taking longer to load .
               
               

               
            

Legacy_Mudeye

  • Full Member
  • ***
  • Posts: 238
  • Karma: +0/-0
Effect at location ported to?
« Reply #1 on: October 12, 2010, 10:34:32 pm »


               You can probably put a trigger at the destination and assign the effect in the OnEnter script.
               
               

               
            

Legacy_Knight_Shield

  • Hero Member
  • *****
  • Posts: 812
  • Karma: +0/-0
Effect at location ported to?
« Reply #2 on: October 12, 2010, 10:42:26 pm »


               Yes I thought about that but wouldnt it go off when anyone enters?
               
               

               
            

Legacy_Mudeye

  • Full Member
  • ***
  • Posts: 238
  • Karma: +0/-0
Effect at location ported to?
« Reply #3 on: October 12, 2010, 10:45:27 pm »


               Ah I see.  Here's a solution for that.  When someone it getting ported, set a local variable on the PC called "GettingPorted".  Set it to 1.  Check for that variable in the OnEnter script at the destination. If you find the variable then set it to 0 and apply the effect.  



That way only a PC that is being ported can receive the effect and the variable is set back to 0 when they arrive so they can't trigger it again. Unless they are ported again that is.
               
               

               
            

Legacy_Knight_Shield

  • Hero Member
  • *****
  • Posts: 812
  • Karma: +0/-0
Effect at location ported to?
« Reply #4 on: October 12, 2010, 10:54:55 pm »


               ahh very good I will try to make em if not I will post my script so you can help ...thanks

               
               

               
            

Legacy_420

  • Sr. Member
  • ****
  • Posts: 370
  • Karma: +0/-0
Effect at location ported to?
« Reply #5 on: October 14, 2010, 01:25:53 am »


               On my server, if the PC is teleporting into another part of the same area I just apply the "teleport in" effect with a set delay but if the PC teleports to a different area I run a pseudo-heartbeat script that checks every second to see if the PC is in a valid area using GetIsObjectValid() with GetArea(). While the PC object is transitioning it will return an invalid area, as soon as the area becomes valid have the heartbeat script apply the VFX.

-420
               
               

               


                     Modifié par 420, 14 octobre 2010 - 12:26 .
                     
                  


            

Legacy_ffbj

  • Hero Member
  • *****
  • Posts: 1097
  • Karma: +0/-0
Effect at location ported to?
« Reply #6 on: October 14, 2010, 02:45:26 am »


               Some what of a side note: I had an area, 'The Fortress of Iron' which had multiple teleporters in it.  Once the PC teleports to a random location in the area they could look and see the teleportation effect going off at the location they just teleported from.  Sort of an orientation cue.  It was also really cool to look back and see the effect from a distance.  Also I had npc's in the area, chaos warriors who would also use the teleporters.  One of my tougher areas.