Hi! Welcome to the forum for Platinum Arts Sandbox Free 3D Game Maker. I currently have the forums locked as I am attempting to properly update them.

In the meantime please join the new Discord Server!

If you have any questions please e-mail me through the Platinum Arts website.

Making NPC's Or objects play a sound

Learn more on how to use Sandbox, or submit your own tutorials or resources.
Post Reply
daltonds1
Member
Member
Posts: 368
Joined: September 13th, 2010, 12:26 am
Name: Dalton
IRC Username: Daltonds1
Location: Tomball, Texas

Making NPC's Or objects play a sound

Post by daltonds1 »

This is what we will be doing..

ALSO THE SOUND KEEPS PLAYING WHEN YOU WALK AWAY FROM THE NPC

If you want to make a NPC Make a sound like a recording of you talking or something..
Then this is what we will be doing.

First you will need a sound... Of course..
I have no links for sounds sorry

Next
we are going to go to this location

PlatinumArtsSandbox2.5\packages\sounds

After that make a new folder called mysounds
Then go ahead and place your sound in there and rename it to haha

Next.
Go ahead and go to My_stuff\Packages\base\MAPNAME-art.cfg mines called dalton-art so ill go to that

Open it

Find this

Code: Select all

mapsound "freesound/fireplace" 255 32767 // 0
Above it add this

Code: Select all

mapsound "mysounds/haha" 255 32767 // 33
To explain
mysounds/haha = the file directory and the sound
//33 = the Sound number

then save.
Now open

MAPNAME.CFG
mines
dalton.cfg so ill open that.

If you dont have a MAPNAME.CFG
make a new txt document and save it as your maps name.cfg
So if your map name was harry you will save it as harry.cfg

Open that and then at the top add this

Code: Select all

// Sounds
haha = (registersound mysounds/haha 255)
level_trigger_1 = [sound $haha; sleep 120000]
// End sounds
To explain

haha = the variable
level_trigger_1 = the trigger you will set the 3rd attribute to
$haha = reads the variable

and done.

Now for the ingame part.

Go in game and make a new npc

Make the the 3rd attriube to 11 and the 4th to 1

11 = will make npc talk (IF YOU HAVE A GUI MENU)
and the 1 = trigger
chocolatepie33
Support Team
Support Team
Posts: 2458
Joined: April 27th, 2010, 5:31 pm
IRC Username: CP

Re: Making NPC's Or objects play a sound

Post by chocolatepie33 »

You might wanna add pics to help show where you're talking about, and simplify it. But it's real nice.
Julius wrote:Contribute to http://www.opengameart.org NOW!
Save the wiki!
Post Reply