About Store Forum Documentation Contact



Post Reply 
Using a waypoint as a destination
Author Message
Kobaltic Offline
Member

Post: #1
Using a waypoint as a destination
I added the teleport code to the MMO. It works fine. I am trying to change the output destination of the player. I saw some code for placing the player at an exact location in the world. I wanted to know if there was any information on how to use a waypoint with a custom name as the destination instead of having hard values.
04-03-2011 05:43 PM
Find all posts by this user Quote this message in a reply
menajev Offline
Member

Post: #2
RE: Using a waypoint as a destination
What is wrong with waypoint tutorial?
(This post was last modified: 04-03-2011 09:30 PM by menajev.)
04-03-2011 09:29 PM
Find all posts by this user Quote this message in a reply
Kobaltic Offline
Member

Post: #3
RE: Using a waypoint as a destination
Forgot about it. I got so hung up on the teleportation it slipped my mind. I will check it out. Thanks.
04-03-2011 10:25 PM
Find all posts by this user Quote this message in a reply
dragonfly3 Offline
Member

Post: #4
RE: Using a waypoint as a destination
The waypoint tutorial doesn't explain anything about combining teleportation with waypoints. He's askimg about how to do it from a programmimg standpoint. Kobaltic is a programmer on my team & we would like to make it so a player can teleport to a specific named waypoint. How can we do that?
04-04-2011 02:18 PM
Visit this user's website Find all posts by this user Quote this message in a reply
menajev Offline
Member

Post: #5
RE: Using a waypoint as a destination
In tutorial there is how to take position from waypoint, don't understand what else do you need.
04-04-2011 04:38 PM
Find all posts by this user Quote this message in a reply
Zervox Offline
Member

Post: #6
RE: Using a waypoint as a destination
Threw some lines together just to show basics on how it can be done.

Code:
void TeleWaypoints(Str name)
{
   if(Game::Waypoint *waypoint=Game::World.findWaypoint(name)) // if waypoint exists
   {  
           if(Dist(waypoint->points[0].pos, player.pos)<1.0)
           {
                //Teleport code
           }
   }
}

if you want to jump inside the current world
Code:
void TeleWaypoints(Str name)
{
   if(Game::Waypoint *waypoint=Game::World.findWaypoint(name)) // if waypoint exists
   {  
           if(Dist(waypoint->points[0].pos, player.pos)<1.0)
           {
                Player.pos(Vec(0,0,0));
           }
   }
}

if you want to jump to another .world
Code:
void TeleWaypoints(Str name,worldname)
{
   if(Game::Waypoint *waypoint=Game::World.findWaypoint(name)) // if waypoint exists
   {  
           if(Dist(waypoint->points[0].pos, player.pos)<1.0)
           {
                // Taken from the 03 - Multiple Worlds
                SG.changeWorld(worldname);
           }
   }
}
(This post was last modified: 04-04-2011 07:26 PM by Zervox.)
04-04-2011 05:17 PM
Find all posts by this user Quote this message in a reply
Kobaltic Offline
Member

Post: #7
RE: Using a waypoint as a destination
Thanks for the feedback.

I was trying to resolve the waypoint name in the teleport code as opposed to resolving the teleport code in the waypoint name.
04-04-2011 08:19 PM
Find all posts by this user Quote this message in a reply
dragonfly3 Offline
Member

Post: #8
RE: Using a waypoint as a destination
Thank you Zervox smile
04-05-2011 01:29 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply