Help getting Face profile pic object to show up when person is clicked on

Started by AlphaCodeOverride, Mon 06/10/2014 06:37:43

Previous topic - Next topic

AlphaCodeOverride

Hi, I'm new to this forum, and Semi new to AGS, and if I'm on the right part of the forum, I have a possible scripting question.

In the game I'm helping to make, I need to get a picture of the face of the person i am talking to to show up next to the person when the actual person is clicked. I assume i can make this happen by inserting the face picture as an object and making it a hotspot that is hidden until an interaction is made such as clicking on the person, but i don't want it to go to inventory AND i DO want it to dissapear again when I'm done talking to that person. Kind of like some of those games where the face of the person you talk to pops up when you're talking to them and goes away when you're done like the infolink in Deus Ex for an example. My question is, is it possible to do this in AGS and if so, how do i do it in scripting?
--AlphaCodeOverride

Gurok

Yes, it is possible to show a portrait each time a character speaks in AGS. You don't really need to do any scripting if you're happy with the defaults.

In General Settings, under Speech Style, choose SierraWithBackground or SierraTransparent.



For each portrait you want to display, you'll need to make a view containing a frame with the character's portrait.

Set the SpeechView of the character to their portrait view number:



If it's set correctly, you should see their portrait appear to the right of their walk cycle in the character editor.

Finally, run your game and try talking to the character.

If you add multiple frames to your character's speech view, AGS will cycle through them as the character talks. Alternatively, you can do lip sync to show specific frames at specific times. You can set up basic lip sync in the Lip Sync area of the project tree or use Pamela for precise lip sync.
[img]http://7d4iqnx.gif;rWRLUuw.gi

AlphaCodeOverride

not sure how to create a view with the portrait. do i insert it as an object or something else? because there is no view in the properties at all and no way to match the frame with the object that i can find. oh and i might add that the character that the portrait is attached to doesn't move. I created a view and set it to frame 0 because View 2 which is the characters view won't let me scroll up frames so i assume that frame 0 is the only frame for it since it doesn't move. also i might add that cEgo also has a frame 0 so won't they conflict?
--AlphaCodeOverride

Gurok

You don't need to create an object for the portrait. You use an existing sprite to make the view. So if it's not already in your project, you'll need to go to the Sprites page and import it:



Right-click on Views in the Explore Project tree and choose New View:



Double-click on the new view you created. Click Create New Loop and then Create New Frame:



In the dialogue that appears, select the sprite for your character's portrait and click Use This Sprite:



Edit: Just in reply to the edit you made, don't use your character's walk view. Make a new view following the instructions above and set the character's SpeechView to the new view. Each view in your game can have a frame 0 and they shouldn't conflict with each other.
[img]http://7d4iqnx.gif;rWRLUuw.gi

AlphaCodeOverride

I got all that done but when i run the game it doesn't show up.
--AlphaCodeOverride

Gurok

Hrmmm... I'm not sure what's wrong. A couple of possibilities:

1. Does the speech show up above the character's head? If so, you might be missing the SpeechView setting for the character. AGS will keep using LucasArts speech until all of the settings are set.

2. What are you using to display the speech of your characters? If you are using the Display() command, it won't work for portraits. You'll need to use cEgo.Say() or whatever your main character is called.

If you like, I can attach a sample project with a speech view and Sierra speech set up.

Edit: Just in case it helps, here's a sample project. It uses the built-in key sprite as Roger's portrait. If you talk to Roger, he'll say "Hello There!" with a giant key next to his text.
[img]http://7d4iqnx.gif;rWRLUuw.gi

AlphaCodeOverride

the speech shows up next to a picture of the woman on the left of the screen, but it's not showing the portrait i want it to show. This is one of my dialouges, my hotspots use Display() with quotes but i make actual dialouge which i will do voice speech to later.

Ego: "Hello!"
Woman: "Hi there."
return
@1

Woman: "Nothing much."
return
@2

Woman: "Wouldn't you like to know."
goto-dialog dWoman2
@3

Woman: "Goodbye."
stop
--AlphaCodeOverride

Gurok

Quote from: Dentonoid on Mon 06/10/2014 07:52:27
Ego: "Hello!"
Woman: "Hi there."
return
@1

Woman: "Nothing much."
return
@2

Woman: "Wouldn't you like to know."
goto-dialog dWoman2
@3

Woman: "Goodbye."
stop

Ah, this looks fine. These translate into .Say() commands and should work fine with custom portraits.

I'm not sure why it isn't showing the right portrait for you.

If you're saying that you can see *A* portrait, but it's just not the correct one, double check the SpeechView setting of your character. The SpeechView will use whatever is in Loop 0 of that view.

If you're saying you still can't see any portraits, please see my example project above. Maybe seeing an example will give you a better idea of why it's not working.

EDIT: If you've set it up correctly, the editor for your character should look a bit like this: http://i.imgur.com/nhVilWy.png
[img]http://7d4iqnx.gif;rWRLUuw.gi

AlphaCodeOverride

--AlphaCodeOverride

SMF spam blocked by CleanTalk