Kobaltic
Member
|
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 |
|
menajev
Member
|
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 |
|
Kobaltic
Member
|
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 |
|
dragonfly3
Member
|
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 |
|
menajev
Member
|
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 |
|
Zervox
Member
|
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 |
|
Kobaltic
Member
|
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 |
|