Frictional Games Forum (read-only)
what do i need to do... - 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: what do i need to do... (/thread-25928.html)



what do i need to do... - Amnesiaplayer - 08-21-2014

i want that player is walking "slower"
because i made something... afterp ulling a lever a wall is going up... and a music will come.. some music that it looks like it's the end and then there is outside... andthe music is long... i want that player CAN'T run... for that time... what's the script for player walk... (not run Sad )
|( but it's not the end of the game Big Grin )


RE: what do i need to do... - CarnivorousJelly - 08-21-2014

Hello there!
This page may be very helpful to you in the future. But to answer your question:
SetPlayerWalkSpeedMul(0.7)
SetPlayerRunSpeedMul(0.4)

Or you could use
SetPlayerMoveSpeedMul(0.5)

You can replace the numbers in the brackets with whatever you want. Higher than one is faster than normal, lower than one is slower than normal.


RE: what do i need to do... - Neelke - 08-21-2014

I'm guessing you mean this?

Code:
void SetPlayerMoveSpeedMul(float afMul);
void SetPlayerRunSpeedMul(float afMul);
void SetPlayerLookSpeedMul(float afMul);

Changes the player's move/run/look speed. Default is 1.



RE: what do i need to do... - Amnesiaplayer - 08-21-2014

thanks Big Grin but it keep saying error end of file or something ? my script
PHP Code:
void OnStart()
{
AddUseItemCallback("""Cellar""CellarDoor""UsedKeyOnDoor"true);
AddUseItemCallback("""Mes""Barrel""Killperson"true); 
PlayMusic("Kasteel"true0.7f10false);
}


void MoveWall(string &in asEntityint alState
{
    if (
alState == -1)
    {
        
SetMoveObjectState("MoveWall"1);
        
SetLeverStuckState("secretlever", -1false);
        
PlaySoundAtEntity("""quest_completed.snt""MoveWall"0false);
                
StopMusic(51);
                
PlayMusic("Outside"true0.7f10false);
                
SetPlayerMoveSpeedMul(0.5)

    }

void UsedKeyOnDoor(string &in asItemstring &in asEntity)
{
SetLevelDoorLocked("CellarDoor"false); 
PlaySoundAtEntity("""unlock_door.snt""CellarDoor"0false);
RemoveItem("Cellar");


void BarrelCreak(string&in asParentstring &in asChildint alState)
{
PlaySoundAtEntity("""break_wood.snt""Barrel"0.5ffalse);
SetPropHealth("Barrel"0);
}

void Killperson(string &in asItemstring &in asEntity)
{
PlaySoundAtEntity("""19_inject.snt""Player"0false);
CreateParticleSystemAtEntity("""ps_blood_tiny_splash.ps""Barrel"false);
SetEntityActive("secretlever"true);




RE: what do i need to do... - Neelke - 08-21-2014

No bracket at SetPlayerMoveSpeedMul.

Also you're missing a } closing this script.

Needs to be like this:

Code:
void MoveWall(string &in asEntity, int alState)
{
    if (alState == -1)
    {
        SetMoveObjectState("MoveWall", 1);
        SetLeverStuckState("secretlever", -1, false);
        PlaySoundAtEntity("", "quest_completed.snt", "MoveWall", 0, false);
                StopMusic(5, 1);
                PlayMusic("Outside", true, 0.7f, 1, 0, false);
                SetPlayerMoveSpeedMul(0.5);

    }
}



RE: what do i need to do... - Amnesiaplayer - 08-21-2014

Thnaks Big Grin it worked Tongue
Wink