Alroc
Junior Member
Posts: 24
Threads: 4
Joined: Sep 2010
Reputation:
0
Look a vase falling ...
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
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
09-18-2010, 12:18 PM
Pandemoneus
Senior Member
Posts: 328
Threads: 2
Joined: Sep 2010
Reputation:
0
RE: Look a vase falling ...
Your code contains a few mistakes.
Spoiler below!
void VaseTimerScare(string &in asParent, string &in asChild, int alState)
Isn't the function for a timer, it's
void VaseTimerScare(string &in asTimer)
Spoiler below!
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.
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();
}
}
09-18-2010, 12:32 PM
Alroc
Junior Member
Posts: 24
Threads: 4
Joined: Sep 2010
Reputation:
0
RE: Look a vase falling ...
Thanks I'll try it when I'm back home
EDIT : ok good it's working fine thx !
09-18-2010, 02:22 PM