Frictional Games Forum (read-only)
Look a vase falling ... - 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 (https://www.frictionalgames.com/forum/forum-35.html)
+--- Thread: Look a vase falling ... (/thread-4518.html)



Look a vase falling ... - Alroc - 09-18-2010

Hi all,

There is the problem I Have a script making a Vase falling of a Desk and I want the player to look at that Vase so there is my script

Code:
void CollideAreaFly01(string &in asParent, string &in asChild, int alState)
{
AddDebugMessage("HAHAHAHA sa marche le vol de vase", false);
AddPropImpulse("Vase_01", 0, 0, -1.2f, "world");
AddTimer("VaseTimer_01",0.5f,"VaseTimerScare");


}

void VaseTimerScare(string &in asParent, string &in asChild, int alState)
{
AddDebugMessage("test Vase qui tombe",false);
StartPlayerLookAt("Vase_01",2.0f,5.0f,"");
AddTimer("VaseTimer_01",1.5f,"");
StopPlayerLookAt();
}

So the problem is that the vase is falling but Player don't look at it ... mhhh
Don't understand why


RE: Look a vase falling ... - Pandemoneus - 09-18-2010

Your code contains a few mistakes.

Spoiler below!

Code:
void VaseTimerScare(string &in asParent, string &in asChild, int alState)

Isn't the function for a timer, it's

Code:
void VaseTimerScare(string &in asTimer)


Spoiler below!

Code:
StartPlayerLookAt("Vase_01",2.0f,5.0f,""); //this is correct
AddTimer("VaseTimer_01",1.5f,""); //this does nothing, since you don't call a timer function (seen at "")
StopPlayerLookAt(); //this is also correct, but it will immediatly stop the StartPlayerLookAt since there is no "wait"

Check out how I did it in my code.


Code:
void CollideAreaFly01(string &in asParent, string &in asChild, int alState)
{
AddDebugMessage("HAHAHAHA sa marche le vol de vase", false);
AddPropImpulse("Vase_01", 0, 0, -1.2f, "world");
AddTimer("VaseTimer_01",0.5f,"VaseTimerScare");
}

void VaseTimerScare(string &in asTimer)
{
if(asTimer == "VaseTimer_01")
{
AddDebugMessage("test Vase qui tombe",false);
StartPlayerLookAt("Vase_01",2.0f,5.0f,"");
AddTimer("VaseTimer_02",1.5f,"VaseTimerScare");
}

if(asTimer == "VaseTimer_02")
{
AddDebugMessage("stop looking at vase",false);
StopPlayerLookAt();
}
}



RE: Look a vase falling ... - Alroc - 09-18-2010

Thanks I'll try it when I'm back home Smile


EDIT : ok good it's working fine thx !