Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: Sam. on Fri 18/06/2004 16:38:21

Title: set talk view?
Post by: Sam. on Fri 18/06/2004 16:38:21
in my game i need the main character to answer a mobile phone. i want him to talk on it as a talk view but can't figure out how to change just the talk view. is this possible?
Title: Re: set talk view?
Post by: Qwerty on Fri 18/06/2004 16:44:53
I'm a beginner in ags, but I can guess ;)

First make a view, where character is speaking in the phone.

Then modify view with: SetCharacterView (character_script_name, view_number);
And then release it with: ReleaseCharacterView (character_script_name);

Any help?

Or just wait for post from guy with bigger brains ;D
Title: Re: set talk view?
Post by: Sam. on Fri 18/06/2004 16:47:38
this just chnages the walk view. not the talk view
Title: Re: set talk view?
Post by: Qwerty on Fri 18/06/2004 16:51:21
Oops.

SetCharacterView(EGO,12);
AnimateCharacter(EGO,0,0,0);
while(character[EGO].animating) Wait(1);
ReleaseCharacterView(EGO);

That is from AGS help, try if this helps.
Title: Re: set talk view?
Post by: Ashen on Fri 18/06/2004 17:15:54
You should be able to set it using:

character[CHARID].talkviewÃ,  = The character's talking view number minus 1

So, for example:

character[EGO].talkview = 4; //Where the phone view is 5
DisplaySpeech (EGO, "Hello?");
DisplaySpeech (PHONE, "Sorry, wrong number.");
DisplaySpeech (EGO, "Don't mention it, happens all the time.");
character[EGO].talkview = 3; //Where normal talking view is 4
DisplaySpeech (EGO, "What an idiot.");

EDIT: Or, as Kinoko says, use SetCharacterSpeechView(). I was looking for it to be called SetCharacterTalkView(), since that's what the variable's called, and totally missed it. In fairness, I just got new contact lenses, and my eyes are sore.
Title: Re: set talk view?
Post by: Kinoko on Fri 18/06/2004 17:52:50
Wow, that's a lot of run around when you could just use... this! ^_^

SetCharacterSpeechView (CHARID, int view)

Title: Re: set talk view?
Post by: Scorpiorus on Fri 18/06/2004 17:55:36
Yeah, use the character[CHARID].talkview variable or SetCharacterSpeechView(charid, view) function.

What I'd like to point out is that there is only a single 'see also' reference to that function (it's under SetCharacterBlinkView). I think it could be a good idea to add one under the SetCharacterView.
Title: Re: set talk view?
Post by: Sam. on Fri 18/06/2004 18:37:50
wow. so I just use :
SetCharacterSpeechView(Ego,1)?
superb
Title: Re: set talk view?
Post by: Scorpiorus on Fri 18/06/2004 18:44:50
Yeah, originally there was only one way to alter the talking view via the character[].talkview variable but since the version 2.53 an appropriate function was added.

Quote from: Ashen on Fri 18/06/2004 17:15:54EDIT: Or, as Kinoko says, use SetCharacterSpeechView(). I was looking for it to be called SetCharacterTalkView(), since that's what the variable's called, and totally missed it. In fairness, I just got new contact lenses, and my eyes are sore.
That's another reason why I think the reference to SetCharacterSpeechView should be propagated. Or maybe also add an alias - SetCharacterTalkView()? Since that's what the talking view refers to as in the characters pane.
Title: Re: set talk view?
Post by: Pumaman on Fri 18/06/2004 20:56:38
Good point, I'll add a See Also reference from SetCharacterView.