Page 2 of 2

Re: [Idea] Character Voice edit

Posted: Mon Feb 03, 2014 10:58 pm
by Sanocon
cchausman wrote:
Sanocon wrote:I already did that and it works, but only for the npcs not the player. The only sounds you get when your the player is physical contact sounds.
To clarify, physical contact sounds such as a punch landing or a weapon slicing flesh, not the character vocalizing.

On that note, I don't even think the NPCs make injury vocalizations, just effort sounds (attacking) and the death one.
Look in the data/sounds folder. There are different types the default is non-voice acting based, that's why they sound that way. (I can't remeber which alpha video it is but David did cover this on changing voice files.)

Ok I'm going to try adding the voice files myself and see the debug script when I boot a level. Anybody know what programing format the aschar file is so I can activate the proper programing highlighter?

Re: [Idea] Character Voice edit

Posted: Mon Feb 03, 2014 11:57 pm
by cchausman
Sanocon wrote:
cchausman wrote:
Sanocon wrote:I already did that and it works, but only for the npcs not the player. The only sounds you get when your the player is physical contact sounds.
To clarify, physical contact sounds such as a punch landing or a weapon slicing flesh, not the character vocalizing.

On that note, I don't even think the NPCs make injury vocalizations, just effort sounds (attacking) and the death one.
Look in the data/sounds folder. There are different types the default is non-voice acting based, that's why they sound that way. (I can't remeber which alpha video it is but David did cover this on changing voice files.)

Ok I'm going to try adding the voice files myself and see the debug script when I boot a level. Anybody know what programing format the aschar file is so I can activate the proper programing highlighter?
I believe .as is the extension for an action script file. I don't understand the rest of what you said though.

Re: [Idea] Character Voice edit

Posted: Wed Feb 05, 2014 7:42 pm
by Sanocon
ok so after a while, i figured out how to implement the sounds. (programming talk activated) so what's going on is the aschar script uses [string sound ="name/of/file/path/and/script.xml";] to load and play the sound, however "sound" is a local variable and it can only be declared once. cchausman had it close,
cchausman wrote:

Code: Select all

awake && knocked_out == _unconscious){
        string sound = "Data/Sounds/voice/animal/wolf_get_hit.xml";
        string sound = "Data/Sounds/hit/hit_medium_juicy.xml";
        PlaySoundGroup(sound, this_mo.position);
}
however since "sound" has already been declared as a string, "string" is not needed, so the code needs to be like this.

Code: Select all

awake && knocked_out == _unconscious){
        string sound = "Data/Sounds/voice/animal/wolf_get_hit.xml";
        sound = "Data/Sounds/hit/hit_medium_juicy.xml";
        PlaySoundGroup(sound, this_mo.position);
}
(programming talk off)
I'll see which ones work and which ones don't. if i run into any probloms I'll let you folks know.

Re: [Idea] Character Voice edit

Posted: Wed Feb 05, 2014 9:33 pm
by Anton
cchausman wrote:I believe .as is the extension for an action script file. I don't understand the rest of what you said though.
*Angelscript (just so people aren't confused about the scripting language being used…)

Re: [Idea] Character Voice edit

Posted: Wed Feb 05, 2014 10:17 pm
by cchausman
Sanocon wrote:ok so after a while, i figured out how to implement the sounds. (programming talk activated) so what's going on is the aschar script uses [string sound ="name/of/file/path/and/script.xml";] to load and play the sound, however "sound" is a local variable and it can only be declared once. cchausman had it close,
cchausman wrote:

Code: Select all

awake && knocked_out == _unconscious){
        string sound = "Data/Sounds/voice/animal/wolf_get_hit.xml";
        string sound = "Data/Sounds/hit/hit_medium_juicy.xml";
        PlaySoundGroup(sound, this_mo.position);
}
however since "sound" has already been declared as a string, "string" is not needed, so the code needs to be like this.

Code: Select all

awake && knocked_out == _unconscious){
        string sound = "Data/Sounds/voice/animal/wolf_get_hit.xml";
        sound = "Data/Sounds/hit/hit_medium_juicy.xml";
        PlaySoundGroup(sound, this_mo.position);
}
(programming talk off)
I'll see which ones work and which ones don't. if i run into any probloms I'll let you folks know.
Well hot damn, I was close! Do you know how to implement sounds into code that never initially had that "string sound" line to begin with?

Code: Select all

void TakeDamage(float how_much){
    if(this_mo.controlled){
        AchievementEventFloat("player_damage", how_much);
    }
    const float _permananent_damage_mult = 0.4f;
    how_much *= p_damage_multiplier;
    temp_health -= how_much;
    permanent_health -= how_much * _permananent_damage_mult;
    if(permanent_health <= 0.0f && knocked_out != _dead){
        level.SendMessage("character_died "+this_mo.getID());
        SetKnockedOut(_dead);
        this_mo.StopVoice();
    }
    if(temp_health <= 0.0f && knocked_out == _awake){
        level.SendMessage("character_knocked_out "+this_mo.getID());
        SetKnockedOut(_unconscious);
        --lives;
        if(lives > 0){
            RecoverHealth();
            recovery_time = 3.0f;
            roll_recovery_time = 3.0f;
        } else {
            if(this_mo.controlled){
                TimedSlowMotion(0.1f,0.7f, 0.05f);
            }
            if(!this_mo.controlled && tethered == _TETHERED_FREE){
                this_mo.PlaySoundGroupVoice("death",0.4f);
            }
            //SetRagdollType(_RGDL_INJURED);
        }
    }
}

Re: [Idea] Character Voice edit

Posted: Wed Feb 05, 2014 11:32 pm
by Sanocon
cchausman wrote:Well hot damn, I was close! Do you know how to implement sounds into code that never initially had that "string sound" line to begin with?
when you type in the script for a a non existing sound script, did the game give an error saying that the "enemycontrol.as" failed to load or something?

Re: [Idea] Character Voice edit

Posted: Wed Feb 05, 2014 11:35 pm
by Thomason1005
Angelscript is similar to on c++

and for the sound you should be able to just use
PlaySoundGroup("Data/Sounds/hit/hit_medium_juicy.xml", this_mo.position);
anywhere you want

Re: [Idea] Character Voice edit

Posted: Wed Feb 05, 2014 11:46 pm
by cchausman
Sanocon wrote:when you type in the script for a a non existing sound script, did the game give an error saying that the "enemycontrol.as" failed to load or something?
No, fixing those script sound lines to only list once where there were originally two let the game run fine. Unfortunately though voices still did not play, just the weapon impacts.
Thomason1005 wrote:Angelscript is similar to on c++

and for the sound you should be able to just use
PlaySoundGroup("Data/Sounds/hit/hit_medium_juicy.xml", this_mo.position);
anywhere you want
That would be great, if I knew how to read any of this code in the first place.

Re: [Idea] Character Voice edit

Posted: Thu Feb 06, 2014 12:24 am
by Sanocon
ok, test time. I'm going to need help on this next part. I need help finding parts of code to add the voice sounds. I'm going to turn the topic from "Idea" to "mod" since we figured out the snipet of code to solf the problom.

use the code from Thomason1005 as a test. The "n" key uses the same sound, if it is louder than the sound from the "n" key, it is repeating the sound.

Re: [Mod] Character Voice edit

Posted: Fri Feb 07, 2014 9:46 pm
by Sanocon
So, I'm finally starting to change up some code, since almost all of the button based keys can be knocked out quickly, I might as well start on the button I cant seem to find. The jump key. Now i think i found something which it calls the key "mouse0" I need to know if i'm close or not or if the spacebar has a different i.d. name.

Re: [Mod] Character Voice edit

Posted: Sat Feb 08, 2014 1:49 pm
by Thomason1005
Sanocon wrote:So, I'm finally starting to change up some code, since almost all of the button based keys can be knocked out quickly, I might as well start on the button I cant seem to find. The jump key. Now i think i found something which it calls the key "mouse0" I need to know if i'm close or not or if the spacebar has a different i.d. name.
mouse0 doesnt sound right. It might not be spacebar as you wont find any keys in the script that can be changed in the options screen.

Re: [Mod] Character Voice edit

Posted: Sat Feb 08, 2014 1:54 pm
by Sanocon
Thomason1005 wrote:
Sanocon wrote:So, I'm finally starting to change up some code, since almost all of the button based keys can be knocked out quickly, I might as well start on the button I cant seem to find. The jump key. Now i think i found something which it calls the key "mouse0" I need to know if i'm close or not or if the spacebar has a different i.d. name.
mouse0 doesnt sound right. It might not be spacebar as you wont find any keys in the script that can be changed in the options screen.
So what should I look for?

Edit: there is a script called playercontrol.as, which uses the aschar scrip. I also found a file called aircontrols.as which aschar uses. any leads on what file i edit and where?

Re: [Mod] Character Voice edit

Posted: Sun Feb 09, 2014 2:55 am
by Thomason1005
so as far as i understand it, aschar.as simulates the character which is then controlled either by playercontrol.as (player) or enemycontrol.as (ai).

the button presses for character controlling that can be rebound in the settings are used in playercontrol.as like p.e. GetInputDown(this_mo.controller_id, "jump") for the jump.

i dont know if this is where you want to go for the sounds, as these are basically called from aschar.as

i honestly dont really know what you want to make with this mod. what sounds are missing on player and is this a problem of the turner character or any char that is controlled by a player?

Re: [Mod] Character Voice edit

Posted: Sun Feb 09, 2014 5:59 am
by learn_more
see viewtopic.php?p=212619#p212619 for a reference

Re: [Mod] Character Voice edit

Posted: Sun Feb 09, 2014 10:04 am
by Sanocon
Thomason1005 wrote:so as far as i understand it, aschar.as simulates the character which is then controlled either by playercontrol.as (player) or enemycontrol.as (ai).

the button presses for character controlling that can be rebound in the settings are used in playercontrol.as like p.e. GetInputDown(this_mo.controller_id, "jump") for the jump.

i dont know if this is where you want to go for the sounds, as these are basically called from aschar.as

i honestly dont really know what you want to make with this mod. what sounds are missing on player and is this a problem of the turner character or any char that is controlled by a player?
this mod is just for pure aesthetics, plus i find it odd that only the A.I. can make vocal sounds. aka the knockout and throwing a punch/kick.

I may make a new script entirely for easy player edit/easy workarrounds for character actions.