Frictional Games Forum (read-only)
Move the Player and Vomit - 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 - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: Move the Player and Vomit (/thread-9441.html)



Move the Player and Vomit - convolution223 - 07-28-2011

How do I move my inactive player? I tried this:

Code:
void Jump (string &in asTimer){
SetEntityActive("AltarGrunt1", false);
SetEntityActive("AltarGrunt2", false);
  TeleportPlayer("PlayerStartEnd2");
  AddTimer("",5.2f,"Ending");
}
void Ending(string &in asTimer){
AddPlayerBodyForce(10000, 3000, 2500, true);
FadeOut(3.2f);
AddTimer("",3.3f,"startcredits");
}

and I tried this line of code instead of the AddPlayerBodyForce with coordinates I found in the map that'd be a good place to drop the player in the air and hopefully make it look like they jumped:
Code:
AddBodyForce("Player", -24.5f, 13.25f, -1.5f, "world");

Also, I was wondering how I might simulate the player vomiting. blood. yes, bloody vomit. I got the player to look down at a script area that calls a function that makes a particle system but the particle system doesnt look right if the player isn't standing at the exact right spot when he triggers the event. I also thought of making the particle effect on the player himself instead of the floating script area, but that doesn't work at all. In fact, I didn't see any part of the particle effect when I tried that. And sorry for all the threads i've been making lately in the forum, this is my first mod.


RE: Move the Player and Vomit - Tanshaydar - 07-28-2011

Typing is wrong.

void AddPlayerBodyForce(float afX, float afY, float afZ, bool abUseLocalCoords);

Pushes the player into a certain direction. Note that you need values above ~2000 to see any effects.

afX - amount along the X-axis
afY - amount along the Y-axis
afZ - amount along the Z-axis
abUseLocalCoords - If true, axes are based on where the player is facing, not the world.


Also, use 6000 or more to move player and do not use local coordinates.


RE: Move the Player and Vomit - convolution223 - 07-28-2011

Thanks, that worked! not sure why the other attempts didn't though. And I think I might have to give up on the blood vomit since there doesn't seem to be a really good way of doing it.