[SUGGESTION] Function overrides

Started by Calin Leafshade, Tue 06/07/2010 04:14:04

Previous topic - Next topic

Calin Leafshade

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.

Dualnames

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.
Worked on Strangeland, Primordia, Hob's Barrow, The Cat Lady, Mage's Initiation, Until I Have You, Downfall, Hunie Pop, and every game in the Wadjet Eye Games catalogue (porting)

Calin Leafshade

yes that is also a problem that could be fixed with overrides.

Wonkyth

"But with a ninja on your face, you live longer!"

Misj'

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.

tzachs

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);
}

GarageGothic

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.

Pumaman

Yes, agreed. This is something I've been meaning to do for a long time.

SMF spam blocked by CleanTalk