Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Adding text to PlayerLookAt
danimora2012 Offline
Junior Member

Posts: 47
Threads: 18
Joined: Apr 2012
Reputation: 0
#1
Shocked  Adding text to PlayerLookAt

I think this is where i post errors and stuff
So...here is the problem...

My player looks at a statue...wich i want him to...but i also want text to apear when that occurs...
What do i need to add?...Also the sound is not working..why...
That makes 2 Problems...
1. I want to make text apear
2. The sound to start when player is looking
Can you help me out? Blush

Here's my script...



PlayMusic("Scary.ogg", true, 0.9, 1.0, 1, true);
AddEntityCollideCallback("Player", "lookarea1", "look", true, 1);
}

void look(string &in asParent, string &in asChild, int alState)
{
SetPlayerActive(false);
StartPlayerLookAt("stephano_1", 3.0f, 5.0f, "");
AddTimer("timer01", 2.5f, "StopLook");
PlaySoundAtEntity("", "Letsgetthem.snt", "Player", 0, false);
}

void StopLook(string &in asTimer)
{
StopPlayerLookAt();
SetPlayerActive(true);
}

////////////////////////////
// Run when leaving map
void OnLeave()
{
StopMusic(1 , 1);
}
(This post was last modified: 09-19-2012, 11:06 PM by danimora2012.)
09-16-2012, 09:24 PM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#2
RE: Adding text to PlayerLookAt

You post all scripting issues in DEVELOPMENT SUPPORT, not technical support.

If you want to play a sound the moment the player looked at the object you forced him to look at, you need to provide a callback for the StartPlayerLookAt function and in that callback play the sound. If you want text to appear on screen for the player, use SetMessage.

Tutorials: From Noob to Pro
(This post was last modified: 09-16-2012, 09:37 PM by Your Computer.)
09-16-2012, 09:37 PM
Website Find
danimora2012 Offline
Junior Member

Posts: 47
Threads: 18
Joined: Apr 2012
Reputation: 0
#3
RE: Adding text to PlayerLookAt

(09-16-2012, 09:37 PM)Your Computer Wrote: You post all scripting issues in DEVELOPMENT SUPPORT, not technical support.

If you want to play a sound the moment the player looked at the object you forced him to look at, you need to provide a callback for the StartPlayerLookAt function and in that callback play the sound. If you want text to appear on screen for the player, use SetMessage.
GOD DANGIT!! Ok thank you...
09-16-2012, 09:43 PM
Find
i3670 Offline
Posting Freak

Posts: 1,308
Threads: 74
Joined: Oct 2011
Reputation: 36
#4
RE: Adding text to PlayerLookAt

You can create an area around the statue that dissappears after use. This depends on how far away the statue is though. I think there's a box called PlayerLookAtCallback, just fill that in with the desired callback name e.g. "AreaLookAtStatue" or something.

You could also add another timer like 1.5f or 1.0f that when that triggers the message shows.

Is the sound a custom sound? If so, how did you convert it to .ogg? simply renaming it .ogg won't do it. I use Audacity when making sounds and then export them as .ogg

"What you think is irrelevant" - A character of our time

A Christmas Hunt
09-17-2012, 09:29 AM
Find




Users browsing this thread: 1 Guest(s)