![]() |
Problem With "AddPlayerBodyForce" Func - 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: Problem With "AddPlayerBodyForce" Func (/thread-5168.html) |
Problem With "AddPlayerBodyForce" Func - Kyle - 10-23-2010 I made this awesome script and everything works except the player does not change position... ![]() The "AddPlayerBodyForce(float afX, float afY, float afZ, bool abUseLocalCoords);" doesn't work. ![]() Any tips or answers? If you wanted to see the whole script... here you go. Code: //////////////////////START: ALTARLAMP ROOM Edit: By the way, the room I put it in keeps on dissapearing... like, wtf? RE: Problem With "AddPlayerBodyForce" Func - Entih - 10-24-2010 You're using values like 2.0, and -4.0. To get any significant result, I needed to go as high as 500.0, or 2000.0 (in some cases, 4500.0). Not only that, but i had to apply that value every twentieth of a second! Essentially, you're giving the player a very light breeze every second for a brief instant of a moment. You need to apply a much, much higher force over the course of a longer period of time. Also, while this is a matter of preference, I prefer using the same function for timer situations like that, and just tell them apart using the timer name. "if(asTimer == "PlayerMoveTimer4"){...}" kind of deal. It keeps the code less cluttered for me, in more ifs and less functions. For example, this would apply a force of 500 whatever's to the player in the X axis every twentieth of a second for 1 second: Code: void PushPlayer(string &in asTimer) It's your job as a script writer to find a way to work in that idea though, always the hard part. As per the room... mind clarifying a little? RE: Problem With "AddPlayerBodyForce" Func - Kyle - 10-24-2010 Thanks, I thought the "-4" and the "2" actually move you on the grid that much. The problem about the room is that whenever the altar_lamp_1 and the ScriptArea_5 (which was in the callback) are in the same room, it disapears from the last time I edited the place... Edit: Is it all right to remove the cache file? I don't know, it's just that it won't show anything that was from the last save I did in the editor! Nothing changed... ![]() RE: Problem With "AddPlayerBodyForce" Func - anzki - 10-24-2010 Yes it is all right to remove cache file. RE: Problem With "AddPlayerBodyForce" Func - nofsky - 10-24-2010 Kyle, you might want to check out this thread http://www.frictionalgames.com/forum/thread-4822.html if you're having trouble with changes you make not being visible in the game. RE: Problem With "AddPlayerBodyForce" Func - Kyle - 10-24-2010 It shows the altar_lamp, the door, and the scriptarea_5 but whenever I make another room, it just disapears... ![]() Any idea? Is there a boundary that goes to the edge of the editing area? -_- RE: Problem With "AddPlayerBodyForce" Func - Kyle - 10-25-2010 Cool! I fixed it! Thanks guys for all your help and suggestions! ![]() |