![]() |
Making Player Walk (Please Help Me) The Labyrinth? - Printable Version +- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum) +-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html) +--- Forum: Custom Stories, TCs & Mods (https://www.frictionalgames.com/forum/forum-35.html) +--- Thread: Making Player Walk (Please Help Me) The Labyrinth? (/thread-8209.html) |
RE: Making Player Walk (Please Help Me) The Labyrinth? - nemesis567 - 05-23-2011 Option 1: You can use teleports and fading. Option 2: You can use the function AddPlayerBodyForce(float afX, float afY, float afZ, bool abUseLocalCoords); with a timer, you give a small push every second. Option 3: You use Justine Functions; Option 4: You create an invisible floor that moves bellow the player. RE: Making Player Walk (Please Help Me) The Labyrinth? - Simpanra - 05-23-2011 that fourth option, is that possible? How would i do that? Also, what kind of force are we talking about to move the player a short distance? 50? 100? 1000? RE: Making Player Walk (Please Help Me) The Labyrinth? - nemesis567 - 05-23-2011 2000 is the minimum force to move the player. To make a movable floor, create an entity with a collision mesh only that moves along an axis with a constaint, then attach a prop valve to the floor by script, apply a moveforce onto the valve someway and the floor will move along the axis. It's the hardest way, and probably not the most efficient one. RE: Making Player Walk (Please Help Me) The Labyrinth? - MrBigzy - 05-23-2011 Actually, I used two methods for the cutscene in the labyrinth. The first time he walked, I didn't use the justine function; I had it so he spawned on the ground above the hole, and he started off with MovePlayerPosHead or whatever so it was positioned near the wooden beam. Then I just used that function to emulate him climbing and walking forward; look at the script for the last level. RE: Making Player Walk (Please Help Me) The Labyrinth? - Simpanra - 05-23-2011 ah awesome!!! So...what is the defualt head position and what would be say...one step forwards? RE: Making Player Walk (Please Help Me) The Labyrinth? - Apjjm - 05-23-2011 (05-23-2011, 09:32 PM)Simpanra Wrote: ah awesome!!! So...what is the defualt head position and what would be say...one step forwards? Default head position is 0,0,0. You can then just make a timer that updates once every frame (1/60 seconds) which increments this value. Might be worth creating some speed variables though and decoupling changing the speed from the first timer, otherwise you will end up with one monster switch/case statement in the timer. Instead create several timers (1 is your main loop timer, changing the head position based on speed) the others can then change the speed at set intervals. RE: Making Player Walk (Please Help Me) The Labyrinth? - Simpanra - 05-23-2011 hmmm, what is the furthest the head can move from body? Can i make it go a few steps? RE: Making Player Walk (Please Help Me) The Labyrinth? - Apjjm - 05-23-2011 (05-23-2011, 09:57 PM)Simpanra Wrote: hmmm, what is the furthest the head can move from body? Can i make it go a few steps? Limited by the largest number a float can represent, which is very, very big. You can totally ignore how far you are moving the head - just remember to set it back to 0,0,0 at the end, otherwise the player will have trouble doing stuff ![]() RE: Making Player Walk (Please Help Me) The Labyrinth? - Simpanra - 05-23-2011 Brilliant! =D Thank you! ^_^ One final question, lets say i want him to take one step forward along the x axis, how large is that float value? =) RE: Making Player Walk (Please Help Me) The Labyrinth? - nemesis567 - 05-23-2011 Don't forget that in the end you must teleport the player to his final position, or he will return to the place where he was in the beggining. |