Portico: Status Report #1
November 22nd, 2008 Michael Schwarz and categorized as 3DGS, porticoSo, I thought I will keep you updated, after my prior claim to be “back”.
I am having quite some trouble with media_play, which is the function I use to play sounds in the “dialog” system. Well, not quite a dialog system, but used to display the captions and play the sound files whenever the AI is talking.
My trouble is that the media_play function doesn’t play sounds correctly if you have more than 1 speaker. If you have a Quad Speaker system like me, the sound only comes from the front speakers, yet the two rear speakers keep quiet (or in my case, only play the jingle from the little table radio - Goddamn! ent_playsound works fine with a surround system) which kind of destroys the illusion that you have a voice in your head.
I should also mention, that the “Dialog” System and the “Caption” system are independent from each other, thus I can also use the captions to display what the Turrets may play, or even for some other uses.
Right now, the “Dialog” system reads out “pcap” files which look like this:
:fx:ai_on.ogg
:wait:1
:file:ai_story02b.ogg
Hello, and again welcome to the
:wait:3.4
Tuscture Science Practical Application Testing Facility
:wait:4.7
:pause:
...
:event:evStory01()
:resume:
:wait:1
- voluntary test subject.
There are ultimately 7 “commands” you can use in these PCAP (Portico Captions) files:
- ":file:” - To play the voices, like the one from the AI
- “:pause:” - to pause the sound played by :file:
- “:resume":” - to resume a previously paused sound
- “:wait:” - Wait the indicated number of seconds
- “:fx:” - Play another sound, e.g. for playing a reboot sound.
- “:event:” - Execute a function, to enhance the “adventure”.
Now that were only 6, what about the 7th commandment? That’s the part where the dialog system and the caption system interact: Normal text adds the text to the caption system by the “vGUI_PushCaption” function, much like this:
vGUI_PushCaption(sDialogCurIn, iiDialogDefTexttime);
or
vGUI_PushCaption("This text will display for 500 ticks", 500);
Right now I am working on making the Captions more “smooth”. They already fade out and to white as the time elapses, though the "background box” is still static, and I’d like it to adapt to the text content and smoothly expand or retract depending on the situation.
Right now it looks like this:
I hope you like these small sneak peeks into the portal development. Please leave a comment if you have any questions burning on your fingers or just to chat!
This article has been read 49 times
looks very cool !! ^^
One question!
where do you get this dialog system?
Its not c-lite or C-sript,isn’t it?
please could you explain me this:
vGUI_PushCaption(sDialogCurIn, iiDialogDefTexttime);
What kind of function is vGUI… ?
Nice work ^^
LG BasTi
hey!
The dialog system is written specifically for this game, but it is built modular, that means as soon as I release the source code, you can implement it in any of your projects.
the vGUI_PushCaption function, is simply one of the functions of the Caption system. The first parameter is the string that is being added, and the second the time in ticks that it will be displayed.
In case you mean the abstract name, that is because I like having sorted scripts, no messes, always nicely done. So I use some helpers to make notations of the type of a variable or function.
“v” in this case stands for “void”, “GUI” for the “namespace” it is in and the name after the dash, the name of the function.
For example:
var bGlobal_UseCaption = false;
b = boolean
Global = the namespace
UseCaption = variable name
it’s heavily improvised, but thats what you gotta do when using C-script ;)