Frictional Games Forum (read-only)
Need some 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)
+--- Thread: Need some help :) (/thread-25986.html)



Need some help :) - Catalyst - 08-29-2014

Greetings to all forum members,
I have a newbie question,how to make on startup player to lie down? like in the original Amnesia in the Rain Hall. It's very important for me and more for my custom story.

Thanks for wiewing anyway Smile


RE: Need some help :) - Radical Batz - 08-29-2014

(08-29-2014, 10:12 AM)Catalyst Wrote: Greetings to all forum members,
I have a newbie question,how to make on startup player to lie down? like in the original Amnesia in the Rain Hall. It's very important for me and more for my custom story.

Thanks for wiewing anyway Smile

You can use
Code:
SetPlayerCrouching(bool abCrouch);

To make the player look like he's lying down as you said.

Do you want like a wakeup kinda scenerio?


RE: Need some help :) - Catalyst - 08-29-2014

"Do you want like a wakeup kinda scenerio?"- Yes ,like this,now i should test it)

Not working


RE: Need some help :) - Mudbill - 08-29-2014

As a beginner it might take a lot of practise and adjusting to get right, but it isn't too difficult.

You need to make a sequence of events that trigger different movement with the player. First of all, you need to use a bunch of timers. Use AddTimer to add an effect, then place the effect script in the callback for when that timer is called. You can either add all the timers in the same place with slight time differences, or add another timer within the previous timer's callback.

You need to adjust the time to match what you want. Play around with it.

As for the effects themselves, use scripts like these:

PHP Code:
FadePlayerRollTo(float afXfloat afSpeedMulfloat afMaxSpeed); 
- Will make the camera rotate.
PHP Code:
MovePlayerHeadPos(float afXfloat afYfloat afZfloat afSpeedfloat afSlowDownDist); 
- Will move the camera up or down, or any other direction relative to the player.
PHP Code:
StartPlayerLookAt(stringasEntityNamefloat afSpeedMulfloat afMaxSpeedstringasAtTargetCallback); 
- Will make the player look at a certain point (use areas with these, don't forget StopPlayerLookAt when you're done).

There are many others you can use. Test different values in them. You can find more of these scripts under the Player section on the script page: https://wiki.frictionalgames.com/doku.php?id=hpl2/amnesia/script_functions#player


RE: Need some help :) - Catalyst - 08-29-2014

can you give a example? I first time see these scripts...


RE: Need some help :) - Artsy - 08-29-2014

Example for making player lie on the floor:
Code:
FadePlayerRollTo(50, 220, 220);

Usage of LookAt:
Code:
StartPlayerLookAt("PlayerLookAtArea_1", 0.5f, 0.5f, "FunctionName");

PlayerLookAtArea_1 - can be named anything, just make sure it matches the name of the area box or entity you want the player to look at.

0.5f and 0.5f - speed of looking at the area box/entity; maximum speed.

FunctionName - you also name this one whatever you want. It's basically the function to call when the player looks at the area box/entity.
I believe it's like this:
Code:
FunctionName()
{
     // stuff you want to happen
}

And don't forget to use StopPlayerLookAt(); when the player's done looking or else it will make you force look at the area box/entity.


RE: Need some help :) - Catalyst - 08-29-2014

thanks,its working) +1 for reputation


RE: Need some help :) - Radical Batz - 08-29-2014

When getting something solved, don't forget to name your thread [SOLVED]"Your thread name" so people don't have to come here since it's already has been solved. okay? Wink