Frictional Games Forum (read-only)
[SCRIPT] Easy Cuestion - 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: [SCRIPT] Easy Cuestion (/thread-24812.html)

Pages: 1 2


Easy Cuestion - Straxedix - 03-11-2014

Just to ask what script does turn player oround (automaticly) i mean behind him :

This one:void AddPlayerBodyForce(float afX, float afY, float afZ, bool abUseLocalCoords);

Or This one:void FadePlayerRollTo(float afX, float afSpeedMul, float afMaxSpeed);

Or this one:void MovePlayerHeadPos(float afX, float afY, float afZ, float afSpeed, float afSlowDownDist);

I just ask if somebody can answer if know what i mean


Smile

Ugh edit:


It can be this one i think ^.^

void StartPlayerLookAt(string& asEntityName, float afSpeedMul, float afMaxSpeed, string& asAtTargetCallback);
void StopPlayerLookAt();


RE: Easy Cuestion - Neelke - 03-11-2014

AddPlayerBodyForce = Pushes the player into a certain direction. Note that you need values above ~2000 to see any effects.

FadePlayerRollTo = Rotates the position of the camera on the player's body. (not turning the player around)

MovePlayerHeadPos = Changes the position of the camera on the player's body. (For example, making it look like the player is lying on the floor)

The last ones are the functions you need.

I hope at least you know how to use those.


RE: Easy Cuestion - Straxedix - 03-11-2014

Yeah i'l find way thanks a lot it means me and sorry for taking you'r time Smile

I forgot to say solved thread and you solved it Tongue Neelke.

Ughhhhh

I think i DON'T understand THIS

void StartPlayerLookAt(string& asEntityName, float afSpeedMul, float afMaxSpeed, string& asAtTargetCallback);
void StopPlayerLookAt();
Forces the player to look at a certain entity until StopPlayerLookAt is used.

asEntityName - the entity to look at
afSpeedMul - how fast should the player look at the entity
afMaxSpeed - maximum speed allowed
asAtTargetCallback - function to call when player looks at target

it's a script but i don't get it... it should got some Area when he enter to look there or he just when he spawn he will look in it... not really sure what gonna happen


RE: Easy Cuestion - Neelke - 03-11-2014

He will just look into it, nothing else. Then use StopPlayerLookAt() to making him stop.


RE: Easy Cuestion - Mudbill - 03-11-2014

What you'd do here is to make a script area where you want the player to start looking behind, then add the AddEntityCollideCallback("Player", "AreaName", "FunctionName", true, 1); inside OnStart(). Don't forget to edit the AreaName to your area, and the FunctionName to whatever you'd like to name the event.

Then add this:
Code:
void FunctionName(string &in asParent, string &in asChild, int alState)
{
    StartPlayerLookAt("DoorName", 20, 25, "CallbackName");
}
Again, don't forget to edit it to your DoorName and another CallbackName. You can edit the numbers to change the speed at which the player turns.

Lastly:
Code:
void CallbackName()
{
    StopPlayerLookAt();
}



RE: Easy Cuestion - Straxedix - 03-11-2014

Like this ?
void OnStart()

{

AddUseItemCallback("", "Key123", "Door123", "UseKeyOnDoor", true);
AddUseItemCallback("", "Study123", "Doors122", "UseKeyOnDoor2", true);
AddEntityCollideCallback("Player", "Area1", "LookBack, true, 1)
}

void UseKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("Door123", false, true);
PlaySoundAtEntity("", "unlock_door", "Door123", 0, false);
RemoveItem("Key123");
}

void UseKeyOnDoor2(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("Doors122", false, true);
PlaySoundAtEntity("", "unlock_door.snt", "Doors122", 0, false);
RemoveItem("Study123");
}

void FunctionName(string &in asParent, string &in asChild, int alState)
{
StartPlayerLookAt("Door123", 20, 25, "CallbackName");
}

void CallbackName()
{
StopPlayerLookAt();
}



RE: Easy Cuestion - Mudbill - 03-11-2014

Yeah, try that, although you'd want more details to it to make it more smooth. It should work as it is though.


RE: Easy Cuestion - Straxedix - 03-11-2014

Ugh i have BAD news not working for this...
void CallbackName()
{
StopPlayerLookAt();
}

it have no end file... what should i type there?


RE: Easy Cuestion - Mudbill - 03-11-2014

You forgot the semi-colon at the first AddEntityCollideCallback up top in your OnStart.


RE: Easy Cuestion - Straxedix - 03-11-2014

Can send me .hps file how it should be... ?