Speech view out of order

Started by Caracal, Fri 13/07/2012 22:36:17

Previous topic - Next topic

Caracal

Hello everyone!
This time I have an unexpected problem with something rather basic- this is why I am so helpless.
It’s the speech view adjustment. It seems to not work at all this time, even though I am doing everything as I usually do.
To get an idea of the problem here are screenshots:
https://dl.dropbox.com/u/87581860/Speech%20view%20problems.png

Basically once I set up the speech view and assigned it to the character (as usual) once the speech is triggered in the game, the character appears twice on the screen. The speech-double just pops up, out of any willable area and the speech view occurs without any delay or something.
Its just odd I never had this problem before.
Also there is an extra character. A portrait of the character. Each time the player expires, he enters a special room in which a portrait of the character appears and according to the death scene it is suppose to say something different (that’s something I haven’t quite figured out how to do, jet). The problem is, that the portrait is not talking at all. Even though I have set up a speech view, also as usually.
I used this code in the room:

Code: AGS

// room script file

function room_Load()
{
Wait(30);
gInventory.Visible = false;
gDeathMessage.Visible = true;
aExpired.Play();
if (player.PreviousRoom == 2){
  cPortrait.Say("So ein garstiges Gewächs!");
}
}


But it seems as if my “Say” command is totally ignored. Maybe it has something to do with the general Speech problem I seem to have.
Does anyone have any ideas?

Crimson Wizard

What is your global game speech setting? I mean Global Settings -> Dialog -> Speech style? I may be mistaken but I have a guess yours is set to Sierra-style?
Please elaborate, what is your aim, how do you want your speech look like? Unless you tell this it will be more difficult to help you.

Caracal

Quote from: Crimson Wizard on Fri 13/07/2012 22:50:17
What is your global game speech setting? I mean Global Settings -> Dialog -> Speech style? I may be mistaken but I have a guess yours is set to Sierra-style?
Please elaborate, what is your aim, how do you want your speech look like? Unless you tell this it will be more difficult to help you.
Hmmm... that was a good hint! I changed the general settings into Lucasarts (i never noticed i changed them to Sierra Transparent).
This lifted the first problem, i guess AGS wanted to create some sort of portrait for me.
But still, the problem with the character portrait remains.
I want something that is exactly like this:
http://www.youtube.com/watch?v=l_xLZnA3wiw&feature=g-vrec
After the death scene in the game the player changes into Room 304, and there a portrait says something like "the weather is nice" or "lol" whatever.
The problem is just that 1. : the portrait in my game does not talk at all (i tread it as a regular character with a speech view´-see screenshot)
and 2.: i dont know how to set up the diffrent quotes the portrait says after certain death-scenes.

Crimson Wizard

Actually I hoped that would solve second problem as well :) A pity it did not.

Alright, this is only a guess, since frankly I don't remember how this works pretty well. But I think that Speech View requires to have all the loops for all directions (left, right etc). And portrait character is turned to some direction it does not have appropriate loop for.
Actually (regardless if that is the case) I won't recommend using SpeechView for the portrait character. I'd rather recommend using Character.Animate function.

Caracal

Jes i considered the problem with the diffrent directions thats why i set up these loops as well.
If i use Character.Animate, will i be able to just play the speech file (sound file) in the background just as easily as with the Say function???

Crimson Wizard

Quote from: Caracal on Fri 13/07/2012 23:49:39
If i use Character.Animate, will i be able to just play the speech file (sound file) in the background just as easily as with the Say function???
Ah... probably not (unless you make it a normal audio clip). :/

Hmm, well, I am out of ideas for now. You said that:
Quote
the portrait in my game does not talk at all
Do you mean it does not animate or that say lines do not appear? Or both?

Khris

This is probably a dumb question, but just to make sure: is player.PreviousRoom actually 2?

Caracal

Quote from: Khris on Sat 14/07/2012 00:17:51
This is probably a dumb question, but just to make sure: is player.PreviousRoom actually 2?
Yes, previous Room is #2.
But honestly the "previous room" is not a good solution. Just emagine if there are rooms (and there are) in which several death scenes occure... how wouldi i program the diffrent lines the portrait sais? I need a better solution for this.
Also to answer Crimson Wizards question:
The protrait does not talk at all, neither does it moove its libs nor does the speech appear.

Crimson Wizard

#8
Quote from: Caracal on Sat 14/07/2012 17:29:00
But honestly the "previous room" is not a good solution. Just emagine if there are rooms (and there are) in which several death scenes occure... how wouldi i program the diffrent lines the portrait sais? I need a better solution for this.
Well, this one is a simple one. Make a global variable, preferrably of enum type, like:

GlobalScript.ash:
Code: ags

enum DeathType
{
   eDeadByFallingIntoPit,
   eDeadByDrinkingPoison,
   eDeadByGettingTooCloseToNuclearExplosion,
   etc...
}

import DeathType LastDeathType; // declare a variable

GlobalScript.acs:
Code: ags

DeathType LastDeathType; // create a variable
export LastDeathType; // allow other scripts use it


Set variable each time character dies, e.g.:
Code: ags

LastDeathType = eDeadByFallingIntoPit;


Then for the death room:
Code: ags

function room_Load()
{
Wait(30);
gInventory.Visible = false;
gDeathMessage.Visible = true;
aExpired.Play();

if (LastDeathType == eDeadByFallingIntoPit){
  cPortrait.Say("I should be more careful!");
}
else if (...)
... etc...




I am still thinking on your main problem... I'll post if I get any ideas.

Khris


Caracal

Well actually this is the main "problem".
Back at the time we spoke about this i was working on another game. But the difference is that there i had a diffrent image and text appearing after the scene. Now, here i want another monolog to be triggered. I dont quite know how to deal with that change.
Also if i apply the scripting, then there is a problem with the "player_Loop". If i press the "restart" button then the room changes into the previous room (as wanted) but the playercharacter just wont show up. I have looked at it over and over again... But i cant find the mistake (as this has actually nothing to do with the speech of the protrait).
I could send all the scripting i have but i thinkg it would be another topic?

ThreeOhFour

Two things.

Firstly, I am not sure why you have a speech portrait character. If you want a character to have a speech portrait, you need to assign their speech view to be the portrait's view number. Having a seperate character set up as your speech portrait is kinda pointless (unless I've misunderstood you). If you just meant that you wanted a portrait in the death room, then that's a fine way of going about it.

Secondly, the character is saying what you've asked them to say, but you never see it because you have specified the event to occur before the room fades in. If you actually want to be able to see the speech, you need to trigger the event after the room fades in. Use function room_AfterFadeIn rather than function room_Load to fix this.

As for your last issue, once again there could be a whole number of reasons why this is happening. Without seeing some code, we're powerless to help you. Have you checked that you've not used "First time player enters room" to set things up, thereby negating the script the second time you visit? Have you remembered to reset everything such as player view, transparency and coordinates when they enter the room?

Also, unless you really need it, and as much as I like the number, I advise against using room 304 for anything. Unless it's been changed and I am unaware of this, AGS doesn't save room states beyond room 300, so you're best to use rooms below this number unless you really need more than that.

Crimson Wizard

Quote from: ThreeOhFour on Sun 15/07/2012 19:11:59
Firstly, I am not sure why you have a speech portrait character.
It is not a nomral speech view, it is a character image during the "death" sequence.

Quote from: ThreeOhFour on Sun 15/07/2012 19:11:59
Secondly, the character is saying what you've asked them to say, but you never see it because you have specified the event to occur before the room fades in. If you actually want to be able to see the speech, you need to trigger the event after the room fades in. Use function room_AfterFadeIn rather than function room_Load to fix this.
Now, that's something I missed :) maybe I confused room_Load with room_FirstLoad. But yes, this is likely the reason of the problem.

Quote from: ThreeOhFour on Sun 15/07/2012 19:11:59
Also, unless you really need it, and as much as I like the number, I advise against using room 304 for anything. Unless it's been changed and I am unaware of this, AGS doesn't save room states beyond room 300, so you're best to use rooms below this number unless you really need more than that.
It is a death sequence room, it does not need to be saved, as far as I understood that.
Or... can it be you just don't like him using number 304? :D

ThreeOhFour

Aye, it's unlikely that one would need a saving state room for this, but in the event that one wanted to do this it could lead to some confusion as to why it doesn't work.

Seems best to avoid this possible complication if the option is present, basically.

Caracal

All right let me try then:
Well first of all crimson wizard answered most questions:
The portrait is suppose to show up only in the death room. Its not suppose to be some sort of Sierra style portrait. That’s why I thought seting up a new Chara for this would make it easy!
As far as for the scripting concerning the death Room, I have this:
Code: AGS
  In the Global Script ash. I have this:
enum CauseOfDeath {
    eDeathTree, 
    eDeathSwamp
};

Code: AGS
  
import function ShowgDeathGui(CauseOfDeath cod);

import function ShowDeathGUI(CauseOfDeath cod);     //i have been told to do this
String death_message[100];                        //Death message text
int death_picture[100];                           //Death message image


But these things would be relevant if I had a certain death-picture and text appearing for certain ways of death. Her I don’t want all this, I only want the character to say something different each time a death occurs. I added it into the script because I was hoping to change it later on in a way it might help me.
Furthermore I have this in the top of my global script:

Code: AGS
  function ShowgDeath (CauseOfDeath cod){
  lblDeathMessage.Text= death_message[cod];
  gDeathMessage.Visible = true;
   }

The next thing, of which I hoped it would do the most important part I have under the function (on mouse click):
Code: AGS
  
else if (button == eMouseLeft) {
ProcessClick(mouse.x, mouse.y, mouse.Mode );
}
else if (button == eMouseLeft) {
player_loop = player.Loop;
player_x = player.x; player_y = player_y;
player_room = player.Room;
ProcessClick(mouse.x, mouse.y, mouse.Mode );
}
 


Therefore I set up the global variables (Player_Room, Player_loop. Player_x, Player_y). This is suppose to save the charas position before the fatal action occurs. But I am afraid that this might also be a reason of the problem because once I press the “restart” button… the player changes rooms but the character wont appear.
Then I have this triggered when the player presses the restart-Gui Button:
Code: AGS
  
gDeathMessage.Visible = false;
player.Loop = player_loop;
player.ChangeRoom(player_room, player_x, player_y);


I know its basically an attempt to apply Krhis´ code from the other topic in my game but obviously I made something wrong. I just cant see what.
Also there is a scene in which the player gets caught by a tree once a timer is expired after a he walked on a certain region. For this I set up the following in the given Roomscirpt:
Code: AGS
  
function region2_WalksOnto()
{
if (Zbirdfree == 0){
oBaum.SetView(4, 0);
player.Walk(291, 317, eBlock, eWalkableAreas);
player.FaceLocation(341, 129, eBlock);
oBaum.Animate(0, 10, eOnce, eBlock, eForwards);
cBellatrix.LockViewFrame(3, 0, 0);
oBaum.SetView(4, 1);
oBaum.Animate(1, 10, eOnce, eBlock, eForwards);
Wait(60);
player.UnlockView();
oBaum.SetView(4, 0, 1);
player.ChangeRoom(304);
}
SetTimer(1, 420);
}

function room_RepExec()
{
if (IsTimerExpired(1)){
oBaum.SetView(4, 0);
player.Walk(291, 317, eBlock, eWalkableAreas);
player.FaceLocation(341, 129, eBlock);
oBaum.Animate(0, 10, eOnce, eBlock, eForwards);
cBellatrix.LockViewFrame(3, 0, 0);
oBaum.SetView(4, 1);
oBaum.Animate(1, 10, eOnce, eBlock, eForwards);
Wait(60);
SetTimer(1, 420);
player.UnlockView();
oBaum.SetView(4, 0, 1);
player.ChangeRoom(304);
}
}


Everything works fine but once I press the “try again button” the player changes rooms and everything is as it was (Player is still caught by the tree and nothing has changed, as if the “on mouse klick” modifications with global variables did not occure.

SMF spam blocked by CleanTalk