Frictional Games Forum (read-only)

Full Version: Addpropforce to player?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Does AddPropForce work for "player" ?

AddPropForce("Player", 100000, 0, 0, "world");

This doesn't work. while the other 6 Functions work.
is it possible to push the Player, i'm sure i saw this happening in, Troll story or something like that, the player got PUSHED through a LONG corridor.
if this doesn't work, my whole map is made for nothing...
or is there another script for add prop force?!
If you're gonna push the player, there's a seperate function to use instead.

Code:
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.
(04-12-2015, 07:02 PM)Neelke Wrote: [ -> ]If you're gonna push the player, there's a seperate function to use instead.

Code:
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.

Oh, Thanks!!

I'm jumping the whole time... is there a stop Script?! xd
When do you use AddPlayerBodyForce? In what function and so on.
If you keep doing it, it's because you told the script to do so.

Show the script, so it can be changed.
My script for only the function etc.


PHP Code:
void Explosion(string &in asEntity)
{
StartPlayerLookAt("Water"510"");
SetEntityActive("Monster"true);
SetEntityActive("Lamp"true);
SetPlayerMoveSpeedMul(0.01);
SetPlayerRunSpeedMul(0.01);
SetMessage("Messages""Hint2"1);
StartPlayerLookAt("Monster"510"");
SetPlayerJumpDisabled(true);
AddTimer(""1.5,"BOOM");
}

void BOOM(string &in asTimer)
{
AddTimer(""6,"BOOM");
AddPlayerBodyForce(00100000true);
SetPlayerFallDamageDisabled(true);


also SetplayerFallDamageDisabled doesn't work, it needs to be in there, but it says : no matchign signatures to Setplayerfalldamage blabla Etc, I really need it then, and also, i only need the prop force 1 time, he just needs to "fly" 1 time, and then it needs to be disabled (and the SetplayerfalldamageDisabled must be activated...
You need to update to v1.3 to use SetPlayerFallDamageDisabled.

void BOOM(string &in asTimer)
{
AddTimer("", 6,"BOOM");
AddPlayerBodyForce(0, 0, 100000, true);
SetPlayerFallDamageDisabled(true);
}

Look at this timer.
Do you see, that you're adding another timer in it?

AddTimer("", 6,"BOOM");

You're saying, "When I call this timer, call it again in 6 seconds". And then it repeats.

"When I call this timer, call it again in 6 seconds"
"When I call this timer, call it again in 6 seconds"
"When I call this timer, call it again in 6 seconds"

And so on. All you have to do it remove the add timer.

void BOOM(string &in asTimer)
{
AddPlayerBodyForce(0, 0, 100000, true);
SetPlayerFallDamageDisabled(true);
}
(04-13-2015, 01:31 PM)FlawlessHappiness Wrote: [ -> ]You need to update to v1.3 to use SetPlayerFallDamageDisabled.

void BOOM(string &in asTimer)
{
AddTimer("", 6,"BOOM");
AddPlayerBodyForce(0, 0, 100000, true);
SetPlayerFallDamageDisabled(true);
}

Look at this timer.
Do you see, that you're adding another timer in it?

AddTimer("", 6,"BOOM");

You're saying, "When I call this timer, call it again in 6 seconds". And then it repeats.

"When I call this timer, call it again in 6 seconds"
"When I call this timer, call it again in 6 seconds"
"When I call this timer, call it again in 6 seconds"

And so on. All you have to do it remove the add timer.

void BOOM(string &in asTimer)
{
AddPlayerBodyForce(0, 0, 100000, true);
SetPlayerFallDamageDisabled(true);
}

oh.. thanks didn't know it xD stupid me Tongue i tohught the first timer didn't worked well. but yeah, i hope the update doesn't break my game, like a month ago..

Huh?! it still give me the same message... my script :

void Explosion(string &in asEntity)
{
StartPlayerLookAt("Water", 5, 10, "");
SetEntityActive("Monster", true);
SetEntityActive("Lamp", true);
SetPlayerMoveSpeedMul(0.01);
SetPlayerRunSpeedMul(0.01);
SetMessage("Messages", "Hint2", 1);
StartPlayerLookAt("Monster", 5, 10, "");
SetPlayerJumpDisabled(true);
AddTimer("", 1.5,"BOOM");
}

void BOOM(string &in asTimer)
{
AddTimer("", 6,"kaboom");
}

void kaboom(string &in asTimer)
{
AddPlayerBodyForce(0, 0, 100000, true);
SetPlayerFallDamageDisabled(true);
}

It must be good?!
I installed the game update in Games> Amnesia the dark descent.
yes i don;'t have a "redist" folder..
and i have a 1.3 update Folder inside so that' means i have the update, but it keep saying
No matchign signatures to blabla ( CONST BOOL ) instead of (true)...