Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Estaog on Sat 26/02/2005 08:51:01

Title: Changing Views
Post by: Estaog on Sat 26/02/2005 08:51:01
Im having a problem with SetCharacterView, here is the code:

(http://img232.exs.cx/img232/752/untitled29ku.gif)

This is view 3:
(http://img228.exs.cx/img228/1517/untitled39zw.gif)

And this is view 6:
(http://img232.exs.cx/img232/9492/untitled40ql.gif)

Now the problem is that the view isn`t changing. I think the code is correct, but if anyone can help me, please do so.
Title: Re: Changing Views
Post by: Sam. on Sat 26/02/2005 11:58:22
your problem is that most of your code is blurred, ags doesn't accept blurred code.

Seriously, i think what your code is missing is the character name. off the top of my head it should be:

SetCharacterView(EGO1, 0,2)

so, ego1 is the name of your character, 0 is the view and 2 is the speed or something.
Title: Re: Changing Views
Post by: DoorKnobHandle on Sat 26/02/2005 12:11:41
It might be alot easier for you to just copy&paste the parts out of your script file, that have to do something with your problem and put those lines here using the [ CODE ] and [ /CODE ] tags (without the spaces)...
Title: Re: Changing Views
Post by: Ashen on Sat 26/02/2005 12:51:39
I'm just glad someone else can see it blurring, I thought my eyes had broken.
Posting the code as text would probably be easier, but from what I can make out:

1) You can use Character numbers instead of names in SetCharacterView, so I don't think Zooty's suggestion works. Is it definately character 0 you want to change? It might be worth changing it to the script name anyway - it makes it easier to see what commands link to what character.
2) It looks like you've got some DisplaySpeech commands in there? I don't think SetCharacterView affects the speech view, so you may need to change that to 6 at the beginning (and back again afterwards, of course).

Although, when the code's readable, it may be something completely different.
Title: Re: Changing Views
Post by: Estaog on Sat 26/02/2005 15:32:57
The reason it`s blurred is that it contains some spoilers. And i think the reason is the DisplaySpeech function. But how can i make him bend down and speak?
Title: Re: Changing Views
Post by: Ashen on Sat 26/02/2005 18:02:54
It's hard to say exactly, without seeing the spoilers (or maybe I'm just nosey), but the two most obviouss ways would seem to be:
Make a 'Bending and Talking' view, then change to that temporarily.

SetCharacterSpeechView (0, BENDTALK);
DisplaySpeech (0, "Hey, how'd this get here?");
SetCharacterSpeechView (0, TALK);


Or, some combination of AnimateCharacter/Ex and DisplaySpeechBackground, e.g (not tested, so don't quote me on this):

SetCharacterView (0, 6); // Assuming view 6 has the anim you want
DisplaySpeechBackground (0, "Hmm, what have we here?");
AnimateCharacterEx (0, character[0].loop, 3, 0, 0, 1); // Character will animate while saying last line.
AddInventory (3);
DisplaySpeech (0, "I found a spoon. Good for me!"); // Clears the background speech.
//Could also be more AnimateCharEx & DisplaySpeechBG commands.
ReleaseCharacterView (0);

It might take a little fiddling to sync up the animation and the pause you need to make the speech readable. I think there've been a few posts in the past dealing with animations during DisplaySpeechBackground, so search up one of them for more details.
Title: Re: Changing Views
Post by: Estaog on Sat 26/02/2005 18:56:28
Thanks for all your help guys. I just used ChangeCharacterSpeechView and the problem is gone.     
U no` what im sayin?
Title: Re: Changing Views
Post by: Indie Boy on Sat 26/02/2005 19:27:14
(potter can understand blur)i dont understand how
Spoiler
display speech "there is nothing more in there"
[close]
is a spoiler ???
Title: Re: Changing Views
Post by: Estaog on Sat 26/02/2005 19:33:25
Because they reveal a location of something. And that`s not what it says  :=.