Product Chat / how do i add sound to a entity character.

Author
Message
HarryWever
3D Media Maker
14
Years of Service
User Offline
Joined: 14th Jan 2010
Location: below Sea level
Posted: 13th Apr 2015 23:08
I made a snake and in the fpe it is set to character, everything works, but i can not set the sound.



when i choose properties i can see it is pointing to the wav file, but no sound in testgame.

What am i doing wrong.

Harry
Harry
PM
Pirate Myke
Forum Support
13
Years of Service
User Offline
Joined: 31st May 2010
Location: El Dorado, California
Posted: 13th Apr 2015 23:18
Voices are sets of sounds: they are called by the folder name in the FPE file for the character.
C:\Program Files (x86)\The Game Creators\SteamLibrary\steamapps\common\Game Guru\Files\audiobank\character

Duplicate one of the folders then change the sounds inside that folder.
Call that folder from the FPE file of the snake.

The script should do the actual calling of each individual sound in the set.

Hope that helps.
Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz, 2400 Mhz, 4 Core(s), 4 Logical Processor(s), 8gb RAM, Nvidia gtx660, Windows 7 Pro 64bit

smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 14th Apr 2015 09:07
Yh needs to be scripted to call the sound, for character sound sets take a look at the ai_soldier code.
I haven't used one myself but I have seen the code there.
life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
HarryWever
3D Media Maker
14
Years of Service
User Offline
Joined: 14th Jan 2010
Location: below Sea level
Posted: 14th Apr 2015 17:14
Yep i think also that its need to be scripted.
I will take a look in one of the soldiers coe.

Thanks

Harry
PM
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 14th Apr 2015 17:21
what sort of sound are you requiring for the snake? if it's a simple hiss then you can set it at sound 0 and then call LoopSound(e,0) ni the main loop
and it'll play
you can set the volume with SetSoundVolume(0~100) as well if it's too loud
life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
HarryWever
3D Media Maker
14
Years of Service
User Offline
Joined: 14th Jan 2010
Location: below Sea level
Posted: 14th Apr 2015 17:25
hi
Yes it a simple rattle hiss sound.
I will try that.
Thanks Smallg

Harry
PM
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 14th Apr 2015 17:45
oh sorry 1 more, you will also need to call StopSound(e,0) in the exit(e) part of the script or the sound will continue playing even if they are dead (as i remembered you can kill your snakes )
life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
HarryWever
3D Media Maker
14
Years of Service
User Offline
Joined: 14th Jan 2010
Location: below Sea level
Posted: 14th Apr 2015 17:48
Yes that worked.. i set the loopsound when its nearby in the script and the snake is attacking.
Thanks

Harry
PM
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 16th Apr 2015 12:21
so i'm trying to use a character sound set myself and it returns an error (see attached pic)

i have used the following code (same as in the ai script but changed to point to the new folder)
<-- in the init(e)
<-- in an if statement in the main loop

the file path looks like this
Quote: "Game Guru\Files\audiobank\character\tigertank\onAlert"

the sound is one the default machine gun noise renamed
Quote: "0.wav"
to match the sounds from the other character sounds

what did i do wrong?
life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11

Attachments

Login to view attachments
HarryWever
3D Media Maker
14
Years of Service
User Offline
Joined: 14th Jan 2010
Location: below Sea level
Posted: 16th Apr 2015 12:55 Edited at: 16th Apr 2015 13:21
Hi Smallg,
for the snake i used PlaySound(e,0).
And in the properties set the sound on channel 0
I also tried PlayCharacterSound(e,"snake").
but at my comp nothing played then or is was silence.
I think it has to do with the path, but i also don't know what to put in there.
You can try double slashes.
\\
If i upload a item to the store i also must use in the fpe file to pointing to the script. double slashes.
Like so: dagored\\test.lua

But it would be strange.. as far i can see your script is oke.
If i take a look at soldier.
In the init part you set the sound



And in the script







Harry
Harry
PM
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 16th Apr 2015 13:20 Edited at: 16th Apr 2015 13:23
the issue is i can only apply 1 sound using the slot system, i want at least 3 (2 different guns and an engine)

i didnt think to check the fpe but i dont see any reference to sounds at all for the stock characters fpe so i guess it's not that either
life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
HarryWever
3D Media Maker
14
Years of Service
User Offline
Joined: 14th Jan 2010
Location: below Sea level
Posted: 16th Apr 2015 13:25
is it possible to set multiple slots in the _init

SetCharacterSound(e,"tigertank")
SetCharacterSound(e,"tigertank2")

i really don't know
;only trying to think with you

Harry
PM
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 16th Apr 2015 13:40
Quote: "SetCharacterSound(e,"tigertank")"


it's that part that seems to cause the error
maybe the folders are hard coded behind the scenes because if i use the existing sound sets it works fine (just obviously not the sounds i would like )
life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
Pirate Myke
Forum Support
13
Years of Service
User Offline
Joined: 31st May 2010
Location: El Dorado, California
Posted: 16th Apr 2015 13:43
there are multiple sounds in some of the character folders. They might play thru randomly when that sound is called. I see it just calls the subfolder under the main voice folder. Does not specify which sound, but by the way they are named, I would guess the engine is just randomly picking one of them in that folder.
Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz, 2400 Mhz, 4 Core(s), 4 Logical Processor(s), 8gb RAM, Nvidia gtx660, Windows 7 Pro 64bit

cybernescence
GameGuru Master
11
Years of Service
User Offline
Joined: 28th Jan 2013
Playing: Cogwheel Chronicles
Posted: 16th Apr 2015 18:38
Myke is correct - it randomly picks a sound from the folder. I got it working OK with new folder name (sound files had to be called 0.wav, 1.wav etc) - but I remember there were some sounds that just wouldn't play and errored out - I didn't have time to work out whether it was length of sound, encoding or whatever, I just replaced them until I had some that worked.

Old Larry
GameGuru TGC Backer
12
Years of Service
User Offline
Joined: 26th Apr 2012
Location: Bucharest, Romania
Posted: 17th Apr 2015 14:36 Edited at: 17th Apr 2015 17:12
I use for example (in my droids script "ai_droid.lua") the: SetCharacterSound(e,"droids") and in the rest of ai_droid script I keeping the: PlayCombatMusic(8000,500)
So, I've make a new folder in the audiobank\character\droids\onAggro (of course, with personalized sounds for "0.wav, 1.wav, 2.wav, 3.wav ..." inside), and all working fine.


See the video example here
Smile today, tomorrow could be worse

http://bestradiolarry.ro/fpsarea/

"The best forum, game software, operating system or web platform, it's that software which can give you most of the features and speed, not just amazing graphics."

Attachments

Login to view attachments
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 17th Apr 2015 17:42 Edited at: 17th Apr 2015 17:49
well then i just dont get it, i can copy the entire contents of the existing "soldier" folder into a new folder called "tank"
change only the
Quote: "SetCharacterSound(e,"soldier")"

to
Quote: "SetCharacterSound(e,"tank")"

in the default ai script and still get the error using exactly the same sound files....

the name is right
i have restarted GG
the sounds all play correctly in my pc outside of GG
the soldier script sounds work fine normally


edit ok now it's working with a custom sound, no idea why but i wont complain
life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
Old Larry
GameGuru TGC Backer
12
Years of Service
User Offline
Joined: 26th Apr 2012
Location: Bucharest, Romania
Posted: 17th Apr 2015 17:55
smallg wrote: "the name is right
i have restarted GG
the sounds all play correctly in my pc outside of GG
the soldier script sounds work fine normally"

So, all is alright now and I'm happy to read that !
Smile today, tomorrow could be worse

http://bestradiolarry.ro/fpsarea/

"The best forum, game software, operating system or web platform, it's that software which can give you most of the features and speed, not just amazing graphics."
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 17th Apr 2015 18:10
yep, working now, i deleted the folder and made a new 1 and it started working... weird but there we are
life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11

Login to post a reply

Server time is: 2024-05-08 09:45:44
Your offset time is: 2024-05-08 09:45:44