Frictional Games Forum (read-only)

Full Version: Look a vase falling ...
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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
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();
}
}
Thanks I'll try it when I'm back home Smile


EDIT : ok good it's working fine thx !