Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: Calin Leafshade on Tue 06/07/2010 04:14:04

Title: [SUGGESTION] Function overrides
Post by: Calin Leafshade on Tue 06/07/2010 04:14:04
So I have just finished coding a custom Say function to allow lipsyncing in Lucas Arts speech but it occurs to me that its going to make things very annoying when i have to do dialog since i cant write Ego: blah blah I have to write cEgo.iSay("blah blah");

Now I know that sounds kinda trivial but it would be nice if we could override certain functions that have built in functionality (like the walk and say functions).

Just a thought.
Title: Re: [SUGGESTION] Function overrides
Post by: Dualnames on Tue 06/07/2010 04:17:56
Quote from: Calin Leafshade on Tue 06/07/2010 04:14:04
So I have just finished coding a custom Say function to allow lipsyncing in Lucas Arts speech but it occurs to me that its going to make things very annoying when i have to do dialog since i cant write Ego: blah blah I have to write cEgo.iSay("blah blah");

Now I know that sounds kinda trivial but it would be nice if we could override certain functions that have built in functionality (like the walk and say functions).

Just a thought.

To add to that, you'll have to number them all by yourself, since its a custom command. I've done that for h2g2 and it's not pretty.
Title: Re: [SUGGESTION] Function overrides
Post by: Calin Leafshade on Tue 06/07/2010 04:20:23
yes that is also a problem that could be fixed with overrides.
Title: Re: [SUGGESTION] Function overrides
Post by: Wonkyth on Tue 06/07/2010 06:34:43
Quote from: wonkyth on Sun 20/06/2010 11:14:59
Polymorphism?
Title: Re: [SUGGESTION] Function overrides
Post by: Misj' on Tue 06/07/2010 08:01:45
Quote from: Calin Leafshade on Tue 06/07/2010 04:14:04... it would be nice if we could override certain functions that have built in functionality (like the walk and say functions).
While I see the advantage in some specific cases, I think that in general it is better (safer, and more convenient to the user) if build-in functionality is left alone. The main reason is, because a certain behaviour is expected from these build-ins, and overriding that behaviour could become quite a major source for bugs; that are difficult to identify.

That at being said, LucasArts lipsync is one of the requirements of this small (high-res) project I'm (extremely slowly to the point of an almost stand-still; if only I had more time) working on...so I would prefer the easiest user-experience.
Title: Re: [SUGGESTION] Function overrides
Post by: tzachs on Tue 06/07/2010 08:25:26
I fully support this suggestion, and also want to add having an option to call the base function (the original say function) when overriding it, something like:

override Say(string sentence)
{
    DoSomeFancyStuff();
    base(sentence);
}
Title: Re: [SUGGESTION] Function overrides
Post by: GarageGothic on Tue 06/07/2010 08:42:51
Do we even know for sure that the dialog script calls the Say function rather than use its own duplicate code? In any case, it would be brilliant to have some kind of on_event_say(Character* charact, String text, int voicefile) function - would also make conversation logging tons easier. A related function I would love to have would be the ability to poll the current lipsync frame of the line being spoken, or even something like Character.GetLipsyncFrame(int voicefile, int millisec) for games using .pam syncing. Just *some* way of retrieving and using that data without sticking to default Sierra portrait.
Title: Re: [SUGGESTION] Function overrides
Post by: Pumaman on Mon 12/07/2010 21:21:24
Yes, agreed. This is something I've been meaning to do for a long time.