About Store Forum Documentation Contact



Post Reply 
Problem Moving the Player
Author Message
mncoder Offline
Member

Post: #1
Problem Moving the Player
Hello,

I am the lead programmer on the Hedron team. I work with Dragonfly3.

I took the Teleport Worlds tutorial and extended it to try to find out where I was causing the problem.

The teleport was not in issue.

I extended World1 out about 300 units. I then put in a line of code to move the Player when the key was pressed to a hard-coded location.

Code:
if( Players.elms())
        {
            Players[0].pos(Vec(-16.655, 5.715, 350.809));
        }


If the Player is more than about 100 units from the destination, the move fails. I put in some debugging text -- it seems if you move the player too far, the Players structure is not re-populated.

Is there a different function that should be used for moving players/objects? Or is there a function to call to load the data structures for a newly entered area?


The only code changes I made were:
1) make it into a window instead of full screen.
2) added 2 clauses like that above to move on keypress.
3) added debugging clauses to print out player location, Players.elms, etc.


----------------

I have attached a zip file containing main.cpp and world1.
To reproduce:
1) Take the Teleport Worlds example from Tutorials
2) replace the main.cpp file with the one in my zip file
3) copy this world1 folder into the data\Worlds folder

If you press F7 from the starting location, the camera will move, but the player will not be there.

If you press F8, it does a "short" move putting you closer to the fail point.

I can give more details if required.



Thank you.


Attached File(s)
.zip  teleporttest2.zip (Size: 888.95 KB / Downloads: 10)
(This post was last modified: 12-15-2011 05:30 AM by mncoder.)
12-15-2011 05:17 AM
Find all posts by this user Quote this message in a reply
fatcoder Offline
Member

Post: #2
RE: Problem Moving the Player
I could be wrong but my initial guess would be that you are trying to move the player to a location outside the active area (i.e. the areas that are currently loaded in as active). This will most likely cause the move to fail. The world determines which areas are active based on the camera position that you pass into it in the update method.

Oh, and welcome to the forum. smile
12-15-2011 12:22 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #3
RE: Problem Moving the Player
Thanks, I was able to reproduce the issue when testing your provided data.
It will be fixed in next SDK
12-15-2011 03:22 PM
Find all posts by this user Quote this message in a reply
mncoder Offline
Member

Post: #4
RE: Problem Moving the Player
Thank you! smile

I'm still getting a handle on view/active area/updating things.

Thank you for the help.
12-16-2011 05:31 AM
Find all posts by this user Quote this message in a reply
dragonfly3 Offline
Member

Post: #5
RE: Problem Moving the Player
Thank you smile
12-17-2011 01:53 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply