Frictional Games Forum (read-only)
[split] Need help! - 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: [split] Need help! (/thread-19420.html)



[split] Need help! - DanielRand47 - 12-03-2012

Hello. I'm currently working on the opening map for custom story/mod called "Mansion of Doom", and I have used the AddPlayerBodyForce function, and it does not work when the last parameter is set to true, which wherever the player faces, is where he is pushed. Here is my script, or the last quarter of it.



void PushPlayer(string &in asParent, string &in asChild, int alStat)
{
SetPlayerActive(false);
StartPlayerLookAt("AreaLookAt", 3.0f, 3.0f, "");
AddTimer("Timer_22", 1.5f, "stoplook");
}

void stoplook(string &in asTimer)
{
StopPlayerLookAt();
AddTimer("Timer_23", 0.5f, "LookAtArea");
}

void LookAtArea(string &in asTimer)
{
StartPlayerLookAt("AreaLookAt_1", 3.0f, 3.0f, "");
AddTimer("Timer_24", 1.5f, "stoplook2");
}

void stoplook2(string &in asTimer)
{
StopPlayerLookAt();
AddTimer("Timer_25", 0.5f, "LookAtArea2");
}

void LookAtArea2(string &in asTimer)
{
StartPlayerLookAt("AreaLookAt_2", 3.0f, 3.0f, "");
AddTimer("Timer_26", 1.5f, "stoplook3");
}

void stoplook3(string &in asTimer)
{
StopPlayerLookAt();
AddTimer("Timer_27", 1.5f, "LookAtArea3");
}

void LookAtArea3(string &in asTimer)
{
StartPlayerLookAt("AreaLookAt_3", 3.0f, 3.0f, "");
AddTimer("Timer_28", 1.5f, "stoplook4");
}

void stoplook4(string &in asTimer)
{
StopPlayerLookAt();
AddTimer("Timer_29", 0.5f, "LookAtArea4");
}

void LookAtArea4(string &in asTimer)
{
StartPlayerLookAt("AreaLookAt_4", 12.0f, 12.0f, "");
AddTimer("Timer_30", 0.5f, "stoplook5");
}

void stoplook5(string &in asTimer)
{
StopPlayerLookAt();
SetPlayerActive(true);
AddTimer("Timer_31", 1.0f, "beginpush");
}

void beginpush(string &in asTimer)
{
AddPlayerBodyForce(50000, 0, 0, true);
}

The area in which it happens, is an open area, and it works when the bool is set to false, which is the world coordinates. If any one knows how to fix this, please let me know. I have tried different values.

Thanks abunch!!



RE: [split] Need help! - The chaser - 12-03-2012

If I'm not wrong, that "true" should be "world".


RE: [split] Need help! - FlawlessHappiness - 12-03-2012

No, it's supposed to be true, or false.

Maybe try launching the player at the Y axis too... The problem would just be if the player faced upwards, and the Y is positive, he will be launched downwards...
I would set the bool to false.
Then it's much easier to control.


RE: [split] Need help! - TheGreatCthulhu - 12-03-2012

[/quote]
(12-03-2012, 05:53 AM)Daniel47 Wrote: [font=Times New Roman][size=medium]I have used the AddPlayerBodyForce function, and it does not work when the last parameter is set to true
When you say "it doesn't work", what do you mean by it? It works incorrectly, or nothing happens at all, or what?

(12-03-2012, 05:53 AM)Daniel47 Wrote: when the last parameter is set to true, which wherever the player faces, is where he is pushed.
That is not correct, the documentation doesn't say that - it says that the coordinate system will be local to the player, with one of the axes always pointed to the direction the player is facing (it doesn't say which one, so you'll have to do some tests to find out).

This means that you can still push the player in any direction, you just have to specify your vector in a different coordinate system (world vs local).

So try all of these to find out how the axes are oriented.

AddPlayerBodyForce(50000, 0, 0, true);
AddPlayerBodyForce(0, 50000, 0, true);
AddPlayerBodyForce(0, 0, 50000, true);

One will be directed to the side, one up, one to the front (but maybe not in that order, I don't know of the top of my head).