How to get that Sound before GLaDOS speaks?
Quote from andu on April 9, 2012, 2:42 pmlpfreaky90 wrote:see how long the on and off sounds take; (onwhateverstartstheannouncement; turnonsound;playsound;0.00
onwhateverstartstheannouncement; announcement; theinputtostartachoreochravedscene; time it takesfor turnoffsound.
I believe scenes have a onendscene thing; use that to trigger turnoffsound. If that doesn't work let the thing that triggers the scene play turnoff sound after a delay equal to the lenght of the turnonsound and announcement together.Hope that helped.
Sure, that should work. But isn't that a little too complicated?
Does anybody know how Valve did it in their maps? I've taken a look at them, but couldn't find anything.
onwhateverstartstheannouncement; announcement; theinputtostartachoreochravedscene; time it takesfor turnoffsound.
I believe scenes have a onendscene thing; use that to trigger turnoffsound. If that doesn't work let the thing that triggers the scene play turnoff sound after a delay equal to the lenght of the turnonsound and announcement together.
Hope that helped.
Sure, that should work. But isn't that a little too complicated?
Does anybody know how Valve did it in their maps? I've taken a look at them, but couldn't find anything.
Quote from Lpfreaky90 on April 9, 2012, 3:21 pmYea; it's somewhat complicated. It's just something I came up with. I personally never even noticed this sound. I might be able to take a look at it but it'll take a couple more hours I'm afraid.
Yea; it's somewhat complicated. It's just something I came up with. I personally never even noticed this sound. I might be able to take a look at it but it'll take a couple more hours I'm afraid.

Quote from ChickenMobile on April 9, 2012, 10:38 pmandu wrote:Sure, that should work. But isn't that a little too complicated?Does anybody know how Valve did it in their maps? I've taken a look at them, but couldn't find anything.
If you did read my message (3rd post) you would know. The scenes are however played through Glados.nut not through a direct output. This is how you would play a scene file through a normal output:
- Put the glados_gen_actor.vmf instance from portal 2sdk_contentmapsinstanceschoreo into your map
Remember: the coop GLaDOS lines are used with the coop_glados_ents.vmf instance and the singleplayer uses the one listed above. If you want to use lines from both coop and SP you will need to place both instances in AND collapse the instance, then change the name of @glados to something different.
- Using a button or w/e output you are using to play the sounds; make it play your selected scene file:
outputs.jpg- Find the correct number of your wanted line through: ...portal2scriptsvscriptschoreoglados_scenetable_include.nut
Be warned: many of the scene files play directly after each other -> you can tell what does by looking at the out-dented comments '//' and the lines that follow each other are indented '//'
- Code: Select all
//BlueFirstToEnd
//Blue is awarded five points!
SceneTable["mp_coop_startBlueFirstToEnd01"] <- ...
//Again, those are science collaboration points, which you should not confuse...
SceneTable["mp_coop_startBlueFirstToEnd02"] <- ...To find a line of code, first I would browse through the lines here then go into glados_scenetable_include.nut and find the correct lines in the comments which Valve nicely added for us. Grab the name of the SceneTable array element such as SceneTable["mp_coop_startBlueFirstToEnd01"] and find it in the SceneTableLookup[] array below. In this case it is SceneTableLookup[8]
- Put the number in your output shown in the picture above: GladosPlayVcd(NUMBERHERE)
I was thinking of contributing a VDC page showing the scene files with their subsequent numbers, but I would have to go through hundreds of lines also I bet there is an easier way.
Does anybody know how Valve did it in their maps? I've taken a look at them, but couldn't find anything.
If you did read my message (3rd post) you would know. The scenes are however played through Glados.nut not through a direct output. This is how you would play a scene file through a normal output:
- Put the glados_gen_actor.vmf instance from portal 2sdk_contentmapsinstanceschoreo into your map
Remember: the coop GLaDOS lines are used with the coop_glados_ents.vmf instance and the singleplayer uses the one listed above. If you want to use lines from both coop and SP you will need to place both instances in AND collapse the instance, then change the name of @glados to something different.
- Using a button or w/e output you are using to play the sounds; make it play your selected scene file:
outputs.jpg
- Find the correct number of your wanted line through: ...portal2scriptsvscriptschoreoglados_scenetable_include.nut
Be warned: many of the scene files play directly after each other -> you can tell what does by looking at the out-dented comments '//' and the lines that follow each other are indented '//'
- Code: Select all
//BlueFirstToEnd
//Blue is awarded five points!
SceneTable["mp_coop_startBlueFirstToEnd01"] <- ...
//Again, those are science collaboration points, which you should not confuse...
SceneTable["mp_coop_startBlueFirstToEnd02"] <- ...
To find a line of code, first I would browse through the lines here then go into glados_scenetable_include.nut and find the correct lines in the comments which Valve nicely added for us. Grab the name of the SceneTable array element such as SceneTable["mp_coop_startBlueFirstToEnd01"] and find it in the SceneTableLookup[] array below. In this case it is SceneTableLookup[8]
- Put the number in your output shown in the picture above: GladosPlayVcd(NUMBERHERE)
I was thinking of contributing a VDC page showing the scene files with their subsequent numbers, but I would have to go through hundreds of lines also I bet there is an easier way.
Quote from BEARD! on April 10, 2012, 8:25 amchickenmobile wrote:I was thinking of contributing a VDC page showing the scene files with their subsequent numbers, but I would have to go through hundreds of lines also I bet there is an easier way.I'll try to put a script together to match the vcd number to the voice line.
I'll try to put a script together to match the vcd number to the voice line.
Co-operative: Lightspeed Upstairs Downstairs
Quote from andu on April 11, 2012, 10:13 am@chickenmobile thanks for your great post!
But when I try this I get an error message in my console:
AN ERROR HAS OCCURED [the index 'GladosPlayVcd' does not exist]
CALLSTACK
*FUNCTION [main()] InputRunScript line [1]LOCALS
[this] TABLE
Entity @glados encountered an error in RunScript()Any idea how this can be solved?
@chickenmobile thanks for your great post!
But when I try this I get an error message in my console:
AN ERROR HAS OCCURED [the index 'GladosPlayVcd' does not exist]
CALLSTACK
*FUNCTION [main()] InputRunScript line [1]
LOCALS
[this] TABLE
Entity @glados encountered an error in RunScript()
Any idea how this can be solved?

Quote from ChickenMobile on April 11, 2012, 10:21 amandu wrote:@chickenmobile thanks for your great post!But when I try this I get an error message in my console:
AN ERROR HAS OCCURED [the index 'GladosPlayVcd' does not exist]
CALLSTACK
*FUNCTION [main()] InputRunScript line [1]LOCALS
[this] TABLE
Entity @glados encountered an error in RunScript()Any idea how this can be solved?
That error appears either when:
- You called a the wrong script
- Your script input is in the wrong format (copy the picture).
- Your script has a syntax error.
I hope for your sake that there isn't a syntax error in your glados.nut otherwise portal won't play scenes.
Did you put the glados ents instance in your map? Also what input are you giving @glados?
But when I try this I get an error message in my console:
AN ERROR HAS OCCURED [the index 'GladosPlayVcd' does not exist]
CALLSTACK
*FUNCTION [main()] InputRunScript line [1]
LOCALS
[this] TABLE
Entity @glados encountered an error in RunScript()
Any idea how this can be solved?
That error appears either when:
- You called a the wrong script
- Your script input is in the wrong format (copy the picture).
- Your script has a syntax error.
I hope for your sake that there isn't a syntax error in your glados.nut otherwise portal won't play scenes.
Did you put the glados ents instance in your map? Also what input are you giving @glados?
Quote from BEARD! on April 11, 2012, 1:42 pmBEARD! wrote:chickenmobile wrote:I was thinking of contributing a VDC page showing the scene files with their subsequent numbers, but I would have to go through hundreds of lines also I bet there is an easier way.I'll try to put a script together to match the vcd number to the voice line.
I did just that, and posted this to the wiki as a proof-of-concept. If anyone finds it useful or knows how to make it more useful, let me know. I'll try to get round to parsing more files (e.g. single player) too.
I'll try to put a script together to match the vcd number to the voice line.
I did just that, and posted this to the wiki as a proof-of-concept. If anyone finds it useful or knows how to make it more useful, let me know. I'll try to get round to parsing more files (e.g. single player) too.
Co-operative: Lightspeed Upstairs Downstairs
Quote from andu on April 11, 2012, 1:53 pmYes, I use the glados instance in my map. Then I did as you said and searched my line in glados_scenetable_include.nut
And of course the corresponding number.
Then I created a relay which is triggered when I want GlaDOS to speak. It has the following output:
Yes, I use the glados instance in my map. Then I did as you said and searched my line in glados_scenetable_include.nut
And of course the corresponding number.
Then I created a relay which is triggered when I want GlaDOS to speak. It has the following output:
Quote from Lpfreaky90 on April 11, 2012, 3:46 pm@andu: it seems like sp_a2_pull_the_rugstart01 is commented out on line 1356.
(the // before the name) If that is the case the Vcd won't load either; I'm not 100% sure of it but try using one that doesnt have a // before the mapname.
@andu: it seems like sp_a2_pull_the_rugstart01 is commented out on line 1356.
(the // before the name) If that is the case the Vcd won't load either; I'm not 100% sure of it but try using one that doesnt have a // before the mapname.

Quote from ChickenMobile on April 11, 2012, 7:03 pmlpfreaky90 wrote:@andu: it seems like sp_a2_pull_the_rugstart01 is commented out on line 1356.
(the // before the name) If that is the case the Vcd won't load either; I'm not 100% sure of it but try using one that doesnt have a // before the mapname.That is correct. If it is commented out, the game will pull an error because the SceneTable array cannot find that element. If this sound does exist and you really want to use it, you probably need to do it the original way lpfreaky or someone else mentioned above. ->
An ambient generic dingon sound played before your glados voice plays, a delay, and then the dingoff sound after she has finished speaking.Not many people know that when Glados speaks, the game volume dims, is extremely 'ehoey' and some of the sounds pitch changes (usually pitch 100) because Glados sounds have a determined preset in the scene files. Presently, not many people will notice that is is missing. -> lp said that they didn't even notice the ding sound in the first place.
EDIT: Well done Beard. The tables though are a bit hard to follow. I suggest having 1 table for all the lines with The title whited accross the whole width of the table and the subtitle in an un-whited row.
e.g.
Title = mp_coop_start
subtitle = BlueFirstToEnd
(the // before the name) If that is the case the Vcd won't load either; I'm not 100% sure of it but try using one that doesnt have a // before the mapname.
That is correct. If it is commented out, the game will pull an error because the SceneTable array cannot find that element. If this sound does exist and you really want to use it, you probably need to do it the original way lpfreaky or someone else mentioned above. ->
An ambient generic dingon sound played before your glados voice plays, a delay, and then the dingoff sound after she has finished speaking.
Not many people know that when Glados speaks, the game volume dims, is extremely 'ehoey' and some of the sounds pitch changes (usually pitch 100) because Glados sounds have a determined preset in the scene files. Presently, not many people will notice that is is missing. -> lp said that they didn't even notice the ding sound in the first place.
EDIT: Well done Beard. The tables though are a bit hard to follow. I suggest having 1 table for all the lines with The title whited accross the whole width of the table and the subtitle in an un-whited row.
e.g.
Title = mp_coop_start
subtitle = BlueFirstToEnd