Amnesiaplayer
Senior Member
Posts: 539
Threads: 105
Joined: Jun 2014
Reputation:
0
|
Addpropforce to player?
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?!
|
|
04-12-2015, 06:57 PM |
|
Neelke
Senior Member
Posts: 668
Threads: 82
Joined: Apr 2013
Reputation:
26
|
RE: Addpropforce to player?
If you're gonna push the player, there's a seperate function to use instead.
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.
Derp.
|
|
04-12-2015, 07:02 PM |
|
Amnesiaplayer
Senior Member
Posts: 539
Threads: 105
Joined: Jun 2014
Reputation:
0
|
RE: Addpropforce to player?
(04-12-2015, 07:02 PM)Neelke Wrote: If you're gonna push the player, there's a seperate function to use instead.
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
(This post was last modified: 04-12-2015, 07:08 PM by Amnesiaplayer.)
|
|
04-12-2015, 07:04 PM |
|
Neelke
Senior Member
Posts: 668
Threads: 82
Joined: Apr 2013
Reputation:
26
|
RE: Addpropforce to player?
When do you use AddPlayerBodyForce? In what function and so on.
Derp.
|
|
04-12-2015, 07:41 PM |
|
FlawlessHappiness
Posting Freak
Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation:
171
|
RE: Addpropforce to player?
If you keep doing it, it's because you told the script to do so.
Show the script, so it can be changed.
Trying is the first step to success.
|
|
04-12-2015, 07:57 PM |
|
Amnesiaplayer
Senior Member
Posts: 539
Threads: 105
Joined: Jun 2014
Reputation:
0
|
RE: Addpropforce to player?
My script for only the function etc.
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,"BOOM"); AddPlayerBodyForce(0, 0, 100000, true); 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...
|
|
04-13-2015, 01:19 PM |
|
FlawlessHappiness
Posting Freak
Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation:
171
|
RE: Addpropforce to player?
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);
}
Trying is the first step to success.
|
|
04-13-2015, 01:31 PM |
|
Amnesiaplayer
Senior Member
Posts: 539
Threads: 105
Joined: Jun 2014
Reputation:
0
|
RE: Addpropforce to player?
(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 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)...
(This post was last modified: 04-13-2015, 01:51 PM by Amnesiaplayer.)
|
|
04-13-2015, 01:35 PM |
|
|