adeonc@Posted: Sun Oct 04, 2009 6:25 am :
Alright, I came here to post that just because I really have no clue of how to do this (and I spend the last few hours trying to figure this out)

In Misc.cpp, idFuncRadioChatter::Event_Activate

There's a string called "sound".
sound = spawnArgs.GetString( "snd_radiochatter", "" );

I noticed that it gets the value that's set on the map for the radio chatter event. Example: vo_1_2_18_20_1

What I really need is to get the "text" label that's in some .lipsync file.
I also noticed that it's pretty unusual to have lipsync files for radio transmitions. Thus, I made a file called radio.lipsync and wrote few lines for test, like:
Code:
lipSync vo_1_2_18_20_1
{
   description   "Corporal Kane, this is Strauss. I am in great danger. Rendezvous with me immediately!"
   text      "#str_300684"
   visemes   "english"   ""
   visemes   "french"   ""
   visemes   "italian"   ""
   visemes   "spanish"   ""
   visemes   "russian"   ""
   visemes   "polish"   ""
}
THEN, I'm trying to archieve a way to get this 'text' string in the ocasion. I imagined that it'd be useful to have the "sound" variable, that returns, in the example, vo_1_2_18_20_1. I think it might be possible to reach there through this identification, but I have no idea at all on how to do that.

Any good ideas? My neurons are dying!

Thanks.



AnthonyJa@Posted: Sun Oct 04, 2009 12:42 pm :
Once you've got the name of the decl, you can then use declManager to find it, and then pull the data out of it. I believe you should find the following code should do what you want:
Code:
rvDeclLipSync *lipSync = declManager->FindLipSync(sound);
if (lipSync)
{
   const char *text = lipSync->GetTranscribeText();
   // you may need to convert the #str_xxxx string into the localised version using this
   // const char *localisedText = common->GetLocalizedString(text);
}



By the way, are you aware of the Q4[CC] project, which added closed captioning to Q4 already? It probably is abandonware now though.



adeonc@Posted: Sun Oct 04, 2009 6:02 pm :
Thanks for the help!

It seems I had some approach to the solution last night if I compare with your code. Also, I had the same problem I'm having when I pasted it:
Image
:(

BTW, I'm aware of Q4[CC], but AFAIK it's for quake 1.3 (I'm currently using Q1.4), not to mention that the subtitles include also sounds effects... not really what I want.



AnthonyJa@Posted: Sun Oct 04, 2009 6:17 pm :
damn'ed consts ;)

declare it as: "const rvDeclLipSync *lipSync = ...."

The compiler is saying that FindDecl will only return a const object, ie one you cannot modify. But that should be fine for your needs, since you don't plan to modify the lipsync object.



adeonc@Posted: Sun Oct 04, 2009 11:17 pm :
AnthonyJa wrote:
damn'ed consts ;)

declare it as: "const rvDeclLipSync *lipSync = ...."

The compiler is saying that FindDecl will only return a const object, ie one you cannot modify. But that should be fine for your needs, since you don't plan to modify the lipsync object.
WOa, that pretty much's gonna help me. You know, I'm a damn noob on C++. At least I'm learning quite much messing around with Quake 4 SDK.

Thanks a million!

EDIT: Oddly enough, my .lipsync files have no effect at all.
I copied lipsync folder to the .pk4 of my MOD. Then I noticed that the changes I make to these files change nothing.
For example, I changed the strings for hub_2.lipsync, just for test, and they're still the same ingame.

What-a?
How to edit this bastard?

Uhm... modifying the original pak file and it had effect. Then it means my pk4 file isn't priorized when loading the lipSync? Wtf?

Thanks.



adeonc@Posted: Tue Oct 06, 2009 3:27 pm :
Help! Quake 4 isn't loading the .lipsync filesin my .pk4!



AnthonyJa@Posted: Tue Oct 06, 2009 4:19 pm :
You probably need to add a file of some other type into the pk4 - I've seen this a couple of times before with other filetypes. If you add an empty .def file in the "defs" folder, and it should pick up your pk4 file.

I was going to have a go at reproducing your problem, but I haven't gotten around to it yet.

One thing to check is that you're picking the "sound" variable up from the spawnArgs on the radiochatter entity and not inside the player. I think you're doing that right anyway, but worth checking since the code would compile in say the player entity, but would get back the wrong string.



adeonc@Posted: Wed Oct 07, 2009 12:42 am :
Image

Okay, I've put the lipSync folder into my zpak_english.pk4 provisionally. Now I'm sure that your code works, thanks very much! Obviously, I'm gonna put your name (and this forum) into the credits, even if nobody's gonna ever download my MOD, I think :P
The fact is that I'm doing this for my friends - mostly brazilians -, many can't understand spoken english.

Anyway, I tried putting an empty "whatever.def" file into the folder defs in my pk4 and it didn't work. It seems that it loads everything but the .lipsync and .vismes files. Thats beyond weird IMO.
I really can't think of anything to try getting around this.
:(

AnthonyJa wrote:
One thing to check is that you're picking the "sound" variable up from the spawnArgs on the radiochatter entity and not inside the player. I think you're doing that right anyway, but worth checking since the code would compile in say the player entity, but would get back the wrong string.
Uhm... at least it's working, but your point makes sense... it's probably better to do that inside the player. Specially because I'm planning to put these subtitles into a multiplayer MOD later. But, first o'all, I wanna make these goddamn lipsync files load from my mod :?



adeonc@Posted: Wed Oct 07, 2009 4:32 pm :
Maybe I'm asking for too much help, but here I'm posting my unfinshed MOD.

There, you can type on console p_hud_debug 2 to see some info (including the phrase itself) whenever a NPC talks or the radio is activated.
p_hud_debug 1 shows delay and stuff.

Could you or anybody take a look and tell me what possibly's wrong with the lipSync files? (The map I'm using for testing is HUB 2)

Thanks!



AnthonyJa@Posted: Sat Oct 10, 2009 9:55 am :
Ok, well the main issue seems to be that you're not making pk4's the right way ;)

Your pk4 files seem to be .rar files that have been renamed, rather than .zip files that have been renamed. That is why Q4 cannot see the files inside it, as it uses zip not rar. If you re-pack the subtitlemod_beta.pk4 and pak001.pk4 files as zip files, it finds the contents.

Having done that, I then found that your events.script has some errors in it (it references an unknown event or sth, but I guess you don't see the issue as it doesn't load it due to the pk4 issue). I've not debugged it, and have for now just removed it from the pk4.

After making those tweaks it worked fine :)



adeonc@Posted: Sat Oct 10, 2009 1:36 pm :
AnthonyJa wrote:
Ok, well the main issue seems to be that you're not making pk4's the right way ;)

Your pk4 files seem to be .rar files that have been renamed, rather than .zip files that have been renamed. That is why Q4 cannot see the files inside it, as it uses zip not rar. If you re-pack the subtitlemod_beta.pk4 and pak001.pk4 files as zip files, it finds the contents.
Oh em gee, that was pretty simple, and how noob I am. I didn't even remember that I've changed the extension of a .rar. By the way, how did you find out which file type it was? :o

AnthonyJa wrote:
Having done that, I then found that your events.script has some errors in it (it references an unknown event or sth, but I guess you don't see the issue as it doesn't load it due to the pk4 issue). I've not debugged it, and have for now just removed it from the pk4.
Oh, that's because in the beginning I thought that it's necessary to add an event with the name of the new void (UpdateSubtitle) in it. Now I already know that it's wrong, but hey, I think I'm less noob today than in the past few weeks :)

Thanks a lot for the help :D



AnthonyJa@Posted: Sat Oct 10, 2009 4:15 pm :
adeonc wrote:
Oh em gee, that was pretty simple, and how noob I am. I didn't even remember that I've changed the extension of a .rar. By the way, how did you find out which file type it was? :o

I have pk4 associated with the XP built in zip support so that I can just browse them with explorer, so double-clicking it told me it was a "corrupt zip file", at which point I guessed it was something like that. Opening it in a hex editor (I used Visual Studio) showed the first 4 bytes as "Rar!"

adeonc wrote:
Thanks a lot for the help :D


No probs, glad it's now working



adeonc@Posted: Sun Oct 04, 2009 6:25 am :
Alright, I came here to post that just because I really have no clue of how to do this (and I spend the last few hours trying to figure this out)

In Misc.cpp, idFuncRadioChatter::Event_Activate

There's a string called "sound".
sound = spawnArgs.GetString( "snd_radiochatter", "" );

I noticed that it gets the value that's set on the map for the radio chatter event. Example: vo_1_2_18_20_1

What I really need is to get the "text" label that's in some .lipsync file.
I also noticed that it's pretty unusual to have lipsync files for radio transmitions. Thus, I made a file called radio.lipsync and wrote few lines for test, like:
Code:
lipSync vo_1_2_18_20_1
{
   description   "Corporal Kane, this is Strauss. I am in great danger. Rendezvous with me immediately!"
   text      "#str_300684"
   visemes   "english"   ""
   visemes   "french"   ""
   visemes   "italian"   ""
   visemes   "spanish"   ""
   visemes   "russian"   ""
   visemes   "polish"   ""
}
THEN, I'm trying to archieve a way to get this 'text' string in the ocasion. I imagined that it'd be useful to have the "sound" variable, that returns, in the example, vo_1_2_18_20_1. I think it might be possible to reach there through this identification, but I have no idea at all on how to do that.

Any good ideas? My neurons are dying!

Thanks.



AnthonyJa@Posted: Sun Oct 04, 2009 12:42 pm :
Once you've got the name of the decl, you can then use declManager to find it, and then pull the data out of it. I believe you should find the following code should do what you want:
Code:
rvDeclLipSync *lipSync = declManager->FindLipSync(sound);
if (lipSync)
{
   const char *text = lipSync->GetTranscribeText();
   // you may need to convert the #str_xxxx string into the localised version using this
   // const char *localisedText = common->GetLocalizedString(text);
}



By the way, are you aware of the Q4[CC] project, which added closed captioning to Q4 already? It probably is abandonware now though.



adeonc@Posted: Sun Oct 04, 2009 6:02 pm :
Thanks for the help!

It seems I had some approach to the solution last night if I compare with your code. Also, I had the same problem I'm having when I pasted it:
Image
:(

BTW, I'm aware of Q4[CC], but AFAIK it's for quake 1.3 (I'm currently using Q1.4), not to mention that the subtitles include also sounds effects... not really what I want.



AnthonyJa@Posted: Sun Oct 04, 2009 6:17 pm :
damn'ed consts ;)

declare it as: "const rvDeclLipSync *lipSync = ...."

The compiler is saying that FindDecl will only return a const object, ie one you cannot modify. But that should be fine for your needs, since you don't plan to modify the lipsync object.



adeonc@Posted: Sun Oct 04, 2009 11:17 pm :
AnthonyJa wrote:
damn'ed consts ;)

declare it as: "const rvDeclLipSync *lipSync = ...."

The compiler is saying that FindDecl will only return a const object, ie one you cannot modify. But that should be fine for your needs, since you don't plan to modify the lipsync object.
WOa, that pretty much's gonna help me. You know, I'm a damn noob on C++. At least I'm learning quite much messing around with Quake 4 SDK.

Thanks a million!

EDIT: Oddly enough, my .lipsync files have no effect at all.
I copied lipsync folder to the .pk4 of my MOD. Then I noticed that the changes I make to these files change nothing.
For example, I changed the strings for hub_2.lipsync, just for test, and they're still the same ingame.

What-a?
How to edit this bastard?

Uhm... modifying the original pak file and it had effect. Then it means my pk4 file isn't priorized when loading the lipSync? Wtf?

Thanks.



adeonc@Posted: Tue Oct 06, 2009 3:27 pm :
Help! Quake 4 isn't loading the .lipsync filesin my .pk4!



AnthonyJa@Posted: Tue Oct 06, 2009 4:19 pm :
You probably need to add a file of some other type into the pk4 - I've seen this a couple of times before with other filetypes. If you add an empty .def file in the "defs" folder, and it should pick up your pk4 file.

I was going to have a go at reproducing your problem, but I haven't gotten around to it yet.

One thing to check is that you're picking the "sound" variable up from the spawnArgs on the radiochatter entity and not inside the player. I think you're doing that right anyway, but worth checking since the code would compile in say the player entity, but would get back the wrong string.



adeonc@Posted: Wed Oct 07, 2009 12:42 am :
Image

Okay, I've put the lipSync folder into my zpak_english.pk4 provisionally. Now I'm sure that your code works, thanks very much! Obviously, I'm gonna put your name (and this forum) into the credits, even if nobody's gonna ever download my MOD, I think :P
The fact is that I'm doing this for my friends - mostly brazilians -, many can't understand spoken english.

Anyway, I tried putting an empty "whatever.def" file into the folder defs in my pk4 and it didn't work. It seems that it loads everything but the .lipsync and .vismes files. Thats beyond weird IMO.
I really can't think of anything to try getting around this.
:(

AnthonyJa wrote:
One thing to check is that you're picking the "sound" variable up from the spawnArgs on the radiochatter entity and not inside the player. I think you're doing that right anyway, but worth checking since the code would compile in say the player entity, but would get back the wrong string.
Uhm... at least it's working, but your point makes sense... it's probably better to do that inside the player. Specially because I'm planning to put these subtitles into a multiplayer MOD later. But, first o'all, I wanna make these goddamn lipsync files load from my mod :?



adeonc@Posted: Wed Oct 07, 2009 4:32 pm :
Maybe I'm asking for too much help, but here I'm posting my unfinshed MOD.

There, you can type on console p_hud_debug 2 to see some info (including the phrase itself) whenever a NPC talks or the radio is activated.
p_hud_debug 1 shows delay and stuff.

Could you or anybody take a look and tell me what possibly's wrong with the lipSync files? (The map I'm using for testing is HUB 2)

Thanks!



AnthonyJa@Posted: Sat Oct 10, 2009 9:55 am :
Ok, well the main issue seems to be that you're not making pk4's the right way ;)

Your pk4 files seem to be .rar files that have been renamed, rather than .zip files that have been renamed. That is why Q4 cannot see the files inside it, as it uses zip not rar. If you re-pack the subtitlemod_beta.pk4 and pak001.pk4 files as zip files, it finds the contents.

Having done that, I then found that your events.script has some errors in it (it references an unknown event or sth, but I guess you don't see the issue as it doesn't load it due to the pk4 issue). I've not debugged it, and have for now just removed it from the pk4.

After making those tweaks it worked fine :)



adeonc@Posted: Sat Oct 10, 2009 1:36 pm :
AnthonyJa wrote:
Ok, well the main issue seems to be that you're not making pk4's the right way ;)

Your pk4 files seem to be .rar files that have been renamed, rather than .zip files that have been renamed. That is why Q4 cannot see the files inside it, as it uses zip not rar. If you re-pack the subtitlemod_beta.pk4 and pak001.pk4 files as zip files, it finds the contents.
Oh em gee, that was pretty simple, and how noob I am. I didn't even remember that I've changed the extension of a .rar. By the way, how did you find out which file type it was? :o

AnthonyJa wrote:
Having done that, I then found that your events.script has some errors in it (it references an unknown event or sth, but I guess you don't see the issue as it doesn't load it due to the pk4 issue). I've not debugged it, and have for now just removed it from the pk4.
Oh, that's because in the beginning I thought that it's necessary to add an event with the name of the new void (UpdateSubtitle) in it. Now I already know that it's wrong, but hey, I think I'm less noob today than in the past few weeks :)

Thanks a lot for the help :D



AnthonyJa@Posted: Sat Oct 10, 2009 4:15 pm :
adeonc wrote:
Oh em gee, that was pretty simple, and how noob I am. I didn't even remember that I've changed the extension of a .rar. By the way, how did you find out which file type it was? :o

I have pk4 associated with the XP built in zip support so that I can just browse them with explorer, so double-clicking it told me it was a "corrupt zip file", at which point I guessed it was something like that. Opening it in a hex editor (I used Visual Studio) showed the first 4 bytes as "Rar!"

adeonc wrote:
Thanks a lot for the help :D


No probs, glad it's now working



adeonc@Posted: Sun Oct 04, 2009 6:25 am :
Alright, I came here to post that just because I really have no clue of how to do this (and I spend the last few hours trying to figure this out)

In Misc.cpp, idFuncRadioChatter::Event_Activate

There's a string called "sound".
sound = spawnArgs.GetString( "snd_radiochatter", "" );

I noticed that it gets the value that's set on the map for the radio chatter event. Example: vo_1_2_18_20_1

What I really need is to get the "text" label that's in some .lipsync file.
I also noticed that it's pretty unusual to have lipsync files for radio transmitions. Thus, I made a file called radio.lipsync and wrote few lines for test, like:
Code:
lipSync vo_1_2_18_20_1
{
   description   "Corporal Kane, this is Strauss. I am in great danger. Rendezvous with me immediately!"
   text      "#str_300684"
   visemes   "english"   ""
   visemes   "french"   ""
   visemes   "italian"   ""
   visemes   "spanish"   ""
   visemes   "russian"   ""
   visemes   "polish"   ""
}
THEN, I'm trying to archieve a way to get this 'text' string in the ocasion. I imagined that it'd be useful to have the "sound" variable, that returns, in the example, vo_1_2_18_20_1. I think it might be possible to reach there through this identification, but I have no idea at all on how to do that.

Any good ideas? My neurons are dying!

Thanks.



AnthonyJa@Posted: Sun Oct 04, 2009 12:42 pm :
Once you've got the name of the decl, you can then use declManager to find it, and then pull the data out of it. I believe you should find the following code should do what you want:
Code:
rvDeclLipSync *lipSync = declManager->FindLipSync(sound);
if (lipSync)
{
   const char *text = lipSync->GetTranscribeText();
   // you may need to convert the #str_xxxx string into the localised version using this
   // const char *localisedText = common->GetLocalizedString(text);
}



By the way, are you aware of the Q4[CC] project, which added closed captioning to Q4 already? It probably is abandonware now though.



adeonc@Posted: Sun Oct 04, 2009 6:02 pm :
Thanks for the help!

It seems I had some approach to the solution last night if I compare with your code. Also, I had the same problem I'm having when I pasted it:
Image
:(

BTW, I'm aware of Q4[CC], but AFAIK it's for quake 1.3 (I'm currently using Q1.4), not to mention that the subtitles include also sounds effects... not really what I want.



AnthonyJa@Posted: Sun Oct 04, 2009 6:17 pm :
damn'ed consts ;)

declare it as: "const rvDeclLipSync *lipSync = ...."

The compiler is saying that FindDecl will only return a const object, ie one you cannot modify. But that should be fine for your needs, since you don't plan to modify the lipsync object.



adeonc@Posted: Sun Oct 04, 2009 11:17 pm :
AnthonyJa wrote:
damn'ed consts ;)

declare it as: "const rvDeclLipSync *lipSync = ...."

The compiler is saying that FindDecl will only return a const object, ie one you cannot modify. But that should be fine for your needs, since you don't plan to modify the lipsync object.
WOa, that pretty much's gonna help me. You know, I'm a damn noob on C++. At least I'm learning quite much messing around with Quake 4 SDK.

Thanks a million!

EDIT: Oddly enough, my .lipsync files have no effect at all.
I copied lipsync folder to the .pk4 of my MOD. Then I noticed that the changes I make to these files change nothing.
For example, I changed the strings for hub_2.lipsync, just for test, and they're still the same ingame.

What-a?
How to edit this bastard?

Uhm... modifying the original pak file and it had effect. Then it means my pk4 file isn't priorized when loading the lipSync? Wtf?

Thanks.



adeonc@Posted: Tue Oct 06, 2009 3:27 pm :
Help! Quake 4 isn't loading the .lipsync filesin my .pk4!



AnthonyJa@Posted: Tue Oct 06, 2009 4:19 pm :
You probably need to add a file of some other type into the pk4 - I've seen this a couple of times before with other filetypes. If you add an empty .def file in the "defs" folder, and it should pick up your pk4 file.

I was going to have a go at reproducing your problem, but I haven't gotten around to it yet.

One thing to check is that you're picking the "sound" variable up from the spawnArgs on the radiochatter entity and not inside the player. I think you're doing that right anyway, but worth checking since the code would compile in say the player entity, but would get back the wrong string.



adeonc@Posted: Wed Oct 07, 2009 12:42 am :
Image

Okay, I've put the lipSync folder into my zpak_english.pk4 provisionally. Now I'm sure that your code works, thanks very much! Obviously, I'm gonna put your name (and this forum) into the credits, even if nobody's gonna ever download my MOD, I think :P
The fact is that I'm doing this for my friends - mostly brazilians -, many can't understand spoken english.

Anyway, I tried putting an empty "whatever.def" file into the folder defs in my pk4 and it didn't work. It seems that it loads everything but the .lipsync and .vismes files. Thats beyond weird IMO.
I really can't think of anything to try getting around this.
:(

AnthonyJa wrote:
One thing to check is that you're picking the "sound" variable up from the spawnArgs on the radiochatter entity and not inside the player. I think you're doing that right anyway, but worth checking since the code would compile in say the player entity, but would get back the wrong string.
Uhm... at least it's working, but your point makes sense... it's probably better to do that inside the player. Specially because I'm planning to put these subtitles into a multiplayer MOD later. But, first o'all, I wanna make these goddamn lipsync files load from my mod :?



adeonc@Posted: Wed Oct 07, 2009 4:32 pm :
Maybe I'm asking for too much help, but here I'm posting my unfinshed MOD.

There, you can type on console p_hud_debug 2 to see some info (including the phrase itself) whenever a NPC talks or the radio is activated.
p_hud_debug 1 shows delay and stuff.

Could you or anybody take a look and tell me what possibly's wrong with the lipSync files? (The map I'm using for testing is HUB 2)

Thanks!



AnthonyJa@Posted: Sat Oct 10, 2009 9:55 am :
Ok, well the main issue seems to be that you're not making pk4's the right way ;)

Your pk4 files seem to be .rar files that have been renamed, rather than .zip files that have been renamed. That is why Q4 cannot see the files inside it, as it uses zip not rar. If you re-pack the subtitlemod_beta.pk4 and pak001.pk4 files as zip files, it finds the contents.

Having done that, I then found that your events.script has some errors in it (it references an unknown event or sth, but I guess you don't see the issue as it doesn't load it due to the pk4 issue). I've not debugged it, and have for now just removed it from the pk4.

After making those tweaks it worked fine :)



adeonc@Posted: Sat Oct 10, 2009 1:36 pm :
AnthonyJa wrote:
Ok, well the main issue seems to be that you're not making pk4's the right way ;)

Your pk4 files seem to be .rar files that have been renamed, rather than .zip files that have been renamed. That is why Q4 cannot see the files inside it, as it uses zip not rar. If you re-pack the subtitlemod_beta.pk4 and pak001.pk4 files as zip files, it finds the contents.
Oh em gee, that was pretty simple, and how noob I am. I didn't even remember that I've changed the extension of a .rar. By the way, how did you find out which file type it was? :o

AnthonyJa wrote:
Having done that, I then found that your events.script has some errors in it (it references an unknown event or sth, but I guess you don't see the issue as it doesn't load it due to the pk4 issue). I've not debugged it, and have for now just removed it from the pk4.
Oh, that's because in the beginning I thought that it's necessary to add an event with the name of the new void (UpdateSubtitle) in it. Now I already know that it's wrong, but hey, I think I'm less noob today than in the past few weeks :)

Thanks a lot for the help :D



AnthonyJa@Posted: Sat Oct 10, 2009 4:15 pm :
adeonc wrote:
Oh em gee, that was pretty simple, and how noob I am. I didn't even remember that I've changed the extension of a .rar. By the way, how did you find out which file type it was? :o

I have pk4 associated with the XP built in zip support so that I can just browse them with explorer, so double-clicking it told me it was a "corrupt zip file", at which point I guessed it was something like that. Opening it in a hex editor (I used Visual Studio) showed the first 4 bytes as "Rar!"

adeonc wrote:
Thanks a lot for the help :D


No probs, glad it's now working