Frictional Games Forum (read-only)
Addpropforce to player? - 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: Addpropforce to player? (/thread-29815.html)



Addpropforce to player? - Amnesiaplayer - 04-12-2015

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?!


RE: Addpropforce to player? - Neelke - 04-12-2015

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.



RE: Addpropforce to player? - Amnesiaplayer - 04-12-2015

(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


RE: Addpropforce to player? - Neelke - 04-12-2015

When do you use AddPlayerBodyForce? In what function and so on.


RE: Addpropforce to player? - FlawlessHappiness - 04-12-2015

If you keep doing it, it's because you told the script to do so.

Show the script, so it can be changed.


RE: Addpropforce to player? - Amnesiaplayer - 04-13-2015

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


RE: Addpropforce to player? - FlawlessHappiness - 04-13-2015

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);
}


RE: Addpropforce to player? - Amnesiaplayer - 04-13-2015

(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)...